s-news
[Top] [All Lists]

Re: Survival duration predictions

To: gfraser1@staffmail.ed.ac.uk
Subject: Re: Survival duration predictions
From: Terry Therneau <therneau@mayo.edu>
Date: Mon, 31 Jan 2005 17:10:08 -0600 (CST)
Cc: s-news@wubios.wustl.edu
Reply-to: Terry Therneau <therneau@mayo.edu>
 1. You can get a survival curve for each person by
   curves <- survfit(my.model, newdata=mydata)

 2. Now the printout
        print(curves)
will include a line for each person, with the median and mean survival.
  
 3. temp <- summary(curves)
    temp$table

Contains the numerical data found in the printout above, for further processing.

But take note -- if you have a lot of censoring, the median can be poorly
estimated, and the mean even more so.  In that case, you should look at
parametric survival estimates, as in survreg. 

 4. Since you have the full set of curves, you can also get other quantiles,
but it's a bit more work.  At that point I would agree with Frank H, and
say to use the functions in the Design library.

        Terry Therneau
        
-------------------------------------------------------------------
 >From: George Fraser <gfraser1@staffmail.ed.ac.uk>
 >Subject: [S] Survival duration predictions
 >To: s-news@lists.biostat.wustl.edu  

 >Hi,
 >
 >I've generated a cox model, but I'm struggling to work out how to output
 >predictions based on the model I've made.
 >
 >my.model<-coxph(Surv(duration,status) ~ gender + var1 + var2,
 >data=mydata)
 >
 >My test data set looks something like this:
 >
 >id,duration,gender,var1,var2 
 >a, 65, m, 1, 3 
 >b, 34, f, 1, 5 
 >...
 >
 >For each id, I would like to output a predicted duration based on the
 >cox model so that I can compare it with other models.
 >
 >I've looked at the coxph documentation, but I can only see how to output
 >survival probabilities. I'm probably missing something obvious, but
 >trawling the mail archives has been fruitless, any suggestions?
 >
 >Cheers, 
 >George
 >
 >
 >--------------------------------------------------------------------
 >This message was distributed by s-news@lists.biostat.wustl.edu.  To
 >unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
 >the BODY of the message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>