Hello, I might be barking up the wrong tree here, but I want to make sure I have a full understanding of this. What I would like to know is what tests are performed to give the p-values for each variable in the table that is the result of coxph regression when the variables are categorical only. More specifically, when expected counts are less than 5 is the Fisher's exact test used instead of the Chi^2 test? Many thanks Dan -- ************************************************************** Daniel Brewer, Ph.D. Institute of Cancer Research Email: daniel.brewer at icr.ac.uk ************************************************************** The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP. This e-mail message is confidential and for use by the addre...{{dropped}}
On 9/18/2007 12:41 PM, Daniel Brewer wrote:> Hello, > I might be barking up the wrong tree here, but I want to make sure I > have a full understanding of this. What I would like to know is what > tests are performed to give the p-values for each variable in the table > that is the result of coxph regression when the variables are > categorical only. > > More specifically, when expected counts are less than 5 is the Fisher's > exact test used instead of the Chi^2 test?I think you need to check the reference (Anderson and Gill) or the source to be sure, but I wouldn't expect either of those tests to be used here. I'd guess these are generalized likelihood ratio tests: fit the model with the variable, fit it without, and look at the difference in (partial) log likelihood. If the variable does not affect the response then twice the difference in log likelihood would have an asymptotic chi-square distribution. Fisher's exact test and the Pearson chi-square test are not appropriate here, because the individuals are not exchangeable under the null hypothesis. Duncan Murdoch
Daniel, With regards to the use of Fisher's exact test when cell counts are less than 5, take a look at: D'Agostino, RB, Chase, W and Belanger, A (1988). 'The appropriateness of some common procedures for testing the equality of two independent binomial populations.' 42:198-202. Regards, -Cody Cody Hamilton Edwards Lifesciences -----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of Daniel Brewer Sent: Tuesday, September 18, 2007 9:42 AM To: r-help at stat.math.ethz.ch Subject: [R] Cox regression and p-values Hello, I might be barking up the wrong tree here, but I want to make sure I have a full understanding of this. What I would like to know is what tests are performed to give the p-values for each variable in the table that is the result of coxph regression when the variables are categorical only. More specifically, when expected counts are less than 5 is the Fisher's exact test used instead of the Chi^2 test? Many thanks Dan -- ************************************************************** Daniel Brewer, Ph.D. Institute of Cancer Research Email: daniel.brewer at icr.ac.uk ************************************************************** The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP. This e-mail message is confidential and for use by the addre...{{dropped}} ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Fisher's "exact" test is for comparing two proportions, which is a completely different problem than Cox regression, and so the test has no relevance to this problem. It has, however, sparked a large literature of debate; already alluded to by many of the responses. The tests in the coxph table are Wald tests, beta/ se(beta). For large sample sizes the Wald, score, and likelihood ratio tests will be equivalent, but for small samples the prevailing wisdom is that the likelihood ratio tests are the most reliable. To do the LR test, you need to refit the Cox model without the variable of interest. Then compare the two printouts, one for the full model and one for the reduced model: both will contain a line "Likelihood ratio test = xxx on y df" where xxx and y are numbers. The LR test for the omitted variable is the difference in the two "xxx" values, which is chi-squared with degrees of freedom equal to the difference in the "y" values. Terry Therneau>I might be barking up the wrong tree here, but I want to make sure I >have a full understanding of this. What I would like to know is what >tests are performed to give the p-values for each variable in the table >that is the result of coxph regression when the variables are >categorical only. >More specifically, when expected counts are less than 5 is the Fisher's >exact test used instead of the Chi^2 test?