Dear list, 
I'm using the rms package to fit some Cox models. I run anova() on them to 
obtain sequential p-values, but I'm getting strange results when I run it on a 
subset of the data. 

Following the example on the help page of anova.coxph:
> library(rms)
> data(ovarian)
> fit <- coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian)
> anova(fit)
> fit2 <- coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data=ovarian)
> anova(fit2,fit)

would give me the same result, as expected. 
But If I do

> fit <- coxph(Surv(futime, fustat) ~ resid.ds *rx + ecog.ps, data = ovarian, 
> subset=ovarian$age>50)
>  anova(fit)
>  fit2 <- coxph(Surv(futime, fustat) ~ resid.ds +rx + ecog.ps, data=ovarian, 
> subset=ovarian$age>50)
>  anova(fit2,fit)

The first p-value seems to be wrong. 
Would anybody please explain to me why?

Cheers, 
Oscar

PS. I'm using R 3.0.1.

Oscar M. Rueda, PhD.
 Postdoctoral Research Fellow, Caldas Lab, Breast Cancer Functional
 Genomics.
 University of Cambridge. Cancer Research UK Cambridge Institute.
 Li Ka Shing Centre, Robinson Way.
 Cambridge CB2 0RE
 England
______________________________________________
R-help@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.

Reply via email to