[R] obtainl survival curves for single strata
Bond, Stephen
Stephen.Bond at cibc.com
Thu Jan 31 16:56:20 CET 2013
Dear useRs,
What is the syntax to obtain survival curves for single strata on many subjects?
I have a model based on Surv(time,response) object, so there is a single row per subject and no start,stop and no switching of strata.
The newdata has many subjects and each subject has a strata and the survival based on the subject risk and the subject strata is needed.
If I do
newpred <- survfit(cph.approve,new=newapp,se=F)
I get all strata for every subject.
Attempting
> newpred <- survfit(cph.approve,new=newapp,id=CertId,se=F)
Error in survfit.coxph(cph.approve, new = newapp, id = CertId, se = F) :
The individual option is only valid for start-stop data
> newpred <- survfit(cph.approve,new=newapp,indi=T,se=F)
Error in survfit.coxph(cph.approve, new = newapp, indi = T, se = F) :
The individual option is only valid for start-stop data
Please, advise if obtaining a single strata for a basic (time,response) model is possible? Due to differing lengths of the surv for different strata this will not go in a "wide" data.frame without padding.
Thanks everybody and have a great day.
Stephen B
More information about the R-help
mailing list