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
______________________________________________
[email protected] 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.