R-alpha: new class for chisquare tests?
Kurt Hornik <hornik@ci.tuwien.ac.at> writes:
I sort of asked this before, but perhaps not explicitly enough. In my ctest collection, there are several chisquare-based tests. For some of them, it may be useful to also return information on expected (and observed) counts. The question is, how should this be done. Of course, there is no problem adding the corresponding components to the list returned by the functions. However, as these are of class `htest', the components don't show up in the printed output. (Of course, one can easily obtain them if they are in the list, but I think Peter is with me when I say that this is not the right thing in an intro course.) * Should we extend print.htest() to display info on expected and observed counts in case it is there? * (Should we have an extra argument to control this behavior?) * Or should there be a class "chisqtest" with a slightly different print and perhaps also summary method? * Or ...?
Couldn't the basic logic of print.lm/summary.lm/anova.lm be applied
here too? I.e.
h<-chisquare.test(blipblop)
observed(h)
fitted(h)
partials(h)
This might be implemented simply by adding items to the return list,
and have fitted.htest() extract the relevant item if it is there.
Or maybe slightly safer from a name-space point of view: add *one*
extra item ("comp", say) which is a list containing the other stuff.
O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-