Skip to content
Prev 106497 / 398513 Next

newbie estimating survival curve w/ survfit for coxph

fit <- coxph(Surv(futime,fustat)~ age +strata(rx), data=ovarian,
 	              subset=1:23)
 curves <- survfit(fit, newdata=ovarian[24:26,])
 

 I don't think this is mentioned in the documentation (I'll have to fix that!),
but subscripting works for survfit objects.  In this case there are 2 strata
and 3 subjects, and

   curves[1,2]  will return the survival curve for strata 1, subject 2.
   curves[2,1]  will return the survival curve for strata 2, subject 1,
etc.

	Terry Therneau