[R] anova.coxph with subsets of data

Therneau, Terry M., Ph.D. therneau at mayo.edu
Wed Jan 29 15:35:24 CET 2014

--- begin included message ---

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?


---- end inclusion ----

The p-value seems wrong because it is wrong.  You've found a bug in the survival package.
(It has to do with missing values, and the attempt of anova.coxph to ensure that it does 
not fit a sequence of models such that an observation is dropped partway through the list.)

Terry Therneau

More information about the R-help mailing list