[R] Predictions from "coxph" or "cph" objects

Therneau, Terry M., Ph.D. therneau at mayo.edu
Mon Jul 7 15:49:00 CEST 2014

I've been off on vacation for a few days and so am arriving late to this discussion.

  Try ?print.survfit, and look at the print.rmean option and the discussion thereof in the 
"Details" section of the page.  It will answer your question, in more detail than you 
asked.  The option applies to survival curves from coxph fits as well.

Short summary
1. For any positive random variable X, mean(x) = integral from 0 to inf of the survival 
curve.  For some reason I found this particular homework problem impossible, back when I 
was a new grad student, consequently I remember it well.

2. When there is censoring the survival curve never drops to zero, which makes the full 
integral not evaluable.  There are well known responses to this problem, but the mean 
survival is used by so few that these "well known" approaches are only known by a small 
few. Enough people got confused by the resulting truncated mean that I set the default 
option for print.rmean to "don't print it".  The downside is that the few who do want a 
mean (like you) often have trouble discovering how to obtain it.

A reference manual (with index) for the survival package is sorely needed.  Someday...

Terry Therneau

Dear R users,

My apologies for the simple question, as I'm starting to learn the concepts
behind the Cox PH model. I was just experimenting with the survival and rms
packages for this.

I'm simply trying to obtain the expected survival time (as opposed to the
probability of survival at a given time t). I can't seem to find an option
from the "type" argument in the predict methods from coxph{survival} or
cph{rms} that will give me expected survival times.

More information about the R-help mailing list