# How to get predictions in terms of survival time from a Cox PH model?

I want to develop a prediction model (Cox PH) for all-cause mortality in a dataset of participants of whom (almost) all have died at the end of follow-up (e.g. 1-year).

Instead of predicting the absolute risk of dying at a certain timepoint, I would like to predict the survival time (in months) for each individual.

Is it possible to obtain such predictions in R (from e.g. a coxph-object) and, if yes, how can I do that?

The Cox Proportional Hazards model doesn't model the underlying hazard, which is what you'd need to predict survival time like that - this is both the model's great strength and one of it's major drawbacks.

If you are particularly interested in obtaining estimates of the probability of survival at particular time points, I would point you towards parametric survival models (aka accelerated failure time models). These are implemented in the survival package for R, and will give you parametric survival time distributions, wherein you can simply plug in the time you are interested in and get back a survival probability.

• Thanks for your answer. I am not particularly interested in obtaining estimates of the survival probability at a particular time, but rather in the predicted survival time for each individual. So instead of e.g. 'the probability of surviving at 1 year is 10%', I would like to get predictions like 'the predicted survival time of this individual is 10 months'. Is it possible to get such predictions from a Cox PH or AFT model?
– Rob
Dec 12 '13 at 8:53
• @Rob I believe it's still not workable in a Cox PH model. It's perfectly doable with a AFT model, though the complexity of getting back an estimate will likely depend on how many covariates you have. Dec 12 '13 at 19:36
• Thanks, I will look into the AFT models. I have been reading about prediction of individual survival times, but it seems "that human survival is so uncertain that even the best statistical analysis cannot provide single-number predictions of real use for individual patients." (link)..
– Rob
Dec 13 '13 at 8:50
• @Rob That's correct - all of these techniques talk about trends in populations. Attempting the accurate prediction of any given person is something of a lost cause, and really not an appropriate use of the tool. Dec 13 '13 at 18:30
• Given the available literature I found, I think you are correct regarding prediction of individual survival times. However, both Cox and AFT models are certainly appropriate tools for prediction of individual absolute risks at certain time points (e.g. see books by Harrell and Steyerberg ).
– Rob
Dec 16 '13 at 13:09

@statBeginner Yes it will. It requires two steps:

x <- survfit(cox.ph.model, newdata = dataset)
dataset$Results <- summary(x)$table[,"median"]


but I am not sure if median time to survival is accurate enough.

• I agree with @akshay that median survival time, while useful, may not be appropriate for individual cases especially if predicting a time to event. Individual survival times can be incredibly heterogeneous so I would advise caution using any median survival time for prediction. Nov 3 '17 at 13:35
• This is the conditional median, not the median. Dec 20 '20 at 18:01

Although I agree with these point, median survival IS clinically useful.

You might be interested in our work (and others) looking at using the median as a basis for survival intervals - we think these are more useful.