[R] automatic chi-square grouping in R
Roger.Lee@hannover-re.com
Roger.Lee at hannover-re.com
Fri Oct 11 10:41:19 CEST 2002
I'm doing some chi-square tests, and I recall some arbitrary rule that says each band must have at least 5 events in order for the test to be meaningful. Is there some way to do the banding automagically in R ? For instance, in the following survdiff, I'm trying to see if ADL affects survival. But when ADL=3,5 and 6, the number observed is too little. Anyway for me to tell R how to group them ? Like "R, combine ADL=5 and ADL=6, and redo the test" ?
-----------
Call:
survdiff(formula = Surv(days, status) ~ adl, data = nu)
N Observed Expected (O-E)^2/E (O-E)^2/V
adl=0 92 6 8.74 0.86134 1.17556
adl=1 38 5 3.41 0.74346 0.83435
adl=2 60 9 10.56 0.22975 0.39159
adl=3 44 4 5.22 0.28487 0.33978
adl=4 27 6 2.32 5.83153 6.30818
adl=5 31 3 3.12 0.00456 0.00506
adl=6 16 2 1.63 0.08385 0.08835
Chisq= 8.2 on 6 degrees of freedom, p= 0.226
-------
On a related note, is it possible to tell R to group together values, for instance, if I have age in my data ranging from 30-60, is it possible to tell R to convert all ages 30-35 into 32.5, all age from 36-40 into 37.5 ... etc ? I mean I can always do this in Excel before I feed the data into R, but it seems R must be able to do something like this. I just don't know where to begin looking in the manual for something like this ...
Thanks so much guys,
Roger
====== Legal Disclaimer ======
As you may know, emails sent via Internet can easily be altered or manipulated by third persons. For this reason, we do not assume any responsibility for changes made to this message after it was sent.
Furthermore please note that the information (including any attachments) in this email is strictly confidential and solely intended for the addressee named above. If you are neither the intended recipient nor an employee or agent responsible for delivering this message to the intended recipient, we hereby notify you that any form of unauthorized use, publication, reproduction, copying or disclosure of this emails contents is not permitted.
If you have received this communication in error, please notify the sender and delete the email from your computer system.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list