Windows XP
R 2.8.1
I am trying to use anova(fitCont,fitCat) to compare two Cox models (coxph) one in which age is entered as a continuous variable, and a second where age is entered as a three-level factor (young, middle, old). The Analysis of Deviance Table produced by anova does not give a p value. Is there any way to get anova to produce p values?
Thank you,
John Sorkin
ANOVA results are pasted below:
anova(fitCont,fitCat)
Analysis of Deviance Table
Model 1: Surv(Time30, Died) ~ Rx + Age
Model 2: Surv(Time30, Died) ~ Rx + AgeGrp
Resid. Df Resid. Dev Df Deviance
1 62 147.38
2 61 142.38 1 5.00
The entire program including the original coxph models follows:
Call:
coxph(formula = Surv(Time30, Died) ~ Rx + AgeGrp, data = GVHDdata)
n= 64
coef exp(coef) se(coef) z p
Rx 1.19 3.27 0.525 2.26 0.024
AgeGrp[T.(15,25]] 1.98 7.26 0.771 2.57 0.010
AgeGrp[T.(25,45]] 1.61 5.02 0.806 2.00 0.045
exp(coef) exp(-coef) lower .95 upper .95
Rx 3.27 0.306 1.17 9.16
AgeGrp[T.(15,25]] 7.26 0.138 1.60 32.88
AgeGrp[T.(25,45]] 5.02 0.199 1.04 24.38
Rsquare= 0.217 (max possible= 0.915 )
Likelihood ratio test= 15.7 on 3 df, p=0.00133
Wald test = 12.0 on 3 df, p=0.0075
Score (logrank) test = 14.5 on 3 df, p=0.00232
anova(fitCont,fitCat)
Analysis of Deviance Table
Model 1: Surv(Time30, Died) ~ Rx + Age
Model 2: Surv(Time30, Died) ~ Rx + AgeGrp
Resid. Df Resid. Dev Df Deviance
1 62 147.38
2 61 142.38 1 5.00
John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)
Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}