I have built a cox proportional hazards model in the R survival package. I want to score new data set using this model. I thought the survfit function would doing this using survfit(original model, newdata), but it only seems to predict only the outcomes for the original data, not the original model using the new data.

Any insight is appreciated!

  • $\begingroup$ If you're after predictions of survival probability, the function survest [survival-package] (or predictSurvProb [pec-package]) is very useful for this. $\endgroup$
    – Rob
    Aug 10, 2014 at 14:18

1 Answer 1


Use the predict function. According to the survival package documentation there is a predict.coxph function, so when that package is loaded and you pass predict a coxph object it will use it for prediction with your new data. See ?predict.coxph for the additional arguments.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.