Adding column of predicted Hazard Ratio to dataframe after Cox Regression in R

心不动则不痛 提交于 2019-12-05 10:21:13

The predict.coxph function allows you to generate several different "type" of output. One of them is "expected" which may be what you mean by "probability". It's not really a probability since the numbers sometimes exceed 1.0 when the relative risk, "baseline hazard" and times under observation are high.

The "risk" option for "type" returns the hazard ratio.

There is a survfit.coxph which allows one to calculate predicted survival. The object it returns has both surv and a cumhaz list components.

You might want to try this:

sme$cumhaz <- survfit(fit, newdata=sme)$cumhaz
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!