-1

I want to build a survival model then calculate the X-year (e.g. 10-year) risk of survival.

Is there a way to do this using coxph or survreg? Is this possible using random survival forest (e.g. ranger)?

P.S. not sure if important but data is wide (~100 features - mostly continuous) and 17k samples.

Adam Waring
  • 1,158
  • 8
  • 20

1 Answers1

-1

For anyone else trying to do the same. If you build a cox-model with survival::coxph or rms::cph you can use the function pec::predictSurvProb.

Adam Waring
  • 1,158
  • 8
  • 20
  • 1
    Doesn't answer the question posed (for random forest results). Doesn't offer code and I'm pretty sure there are already answer to the question of how to generate this sort of estimate from coxph or cph models. – IRTFM Jan 19 '22 at 23:04
  • Having this question and answer would have saved me a lot of time searching when I was looking so I will leave it up because of that. Also because I would still like to know the answer to the random forest part of the question. – Adam Waring Jan 20 '22 at 09:51
  • The way to get useful answers is to follow the directions in [ask] and [MCVE]. – IRTFM Jan 20 '22 at 17:38