Re: [R] newbie estimating survival curve w/ survfit for coxph

2006-12-22 Thread Terry Therneau
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 ar

Re: [R] : newbie estimating survival curve w/ survfit for coxph

2006-12-21 Thread Charles C. Berry
Spencer, It always helps to look at the documentation for the objects you use. ?survfit.object tells you: --- COMPONENTS strata if there are multiple curves, this component gives the number of elements of the time etc. vectors corresponding to

[R] : newbie estimating survival curve w/ survfit for coxph

2006-12-21 Thread sj
I am wondering how to estimate the survival curve for a particular case(s) given a coxph model using this example code: #fit a cox proportional hazards model and plot the #predicted survival curve fit <- coxph( Surv(futime,fustat)~resid.ds+strata(rx)+ecog.ps+age,data=ovarian[1:23,])