简体   繁体   English

如何预测R中Cox回归模型的生存时间?

[英]How to predict survival time in Cox's Regression Model in R?

I have a modeled a problem using Cox's regression and now want to predict the estimated survival time for an individual. 我使用Cox回归建模了一个问题,现在想要预测一个人的估计生存时间。 The model has a list of covariates on which the survival time depends. 该模型具有生存时间所依赖的协变量列表。 This tells us how to calculate P(T>t) which is basically the survival Function (1-CDF) for a given individual. 告诉我们如何计算P(T> t),它基本上是给定个体的生存函数(1-CDF)。

I want to predict something which is slightly different. 我想预测一些略有不同的东西。 Given values for the covariates that have been used, I want to predict the the estimated number of days that the person would live. 鉴于已使用的协变量的值,我想预测该人居住的估计天数。 This, according to me, is similar to sampling from the pdf. 据我所知,这类似于pdf的抽样。 How can I do this using the survival package in R? 如何使用R中的生存包来完成此操作? Below is a summary of the fit using Cox's regression model. 以下是使用Cox回归模型的拟合概要。

Call:
coxph(formula = Surv(Time, death) ~ variable1 + variable2 + variable3 + 
variable4 + variable5 + variable6 + variable7 + variable8 + variable9, 
data = DataTest, method = "breslow")

n= 23756, number of events= 23756 

          coef exp(coef) se(coef)      z Pr(>|z|)    
variable1  0.02494   1.02526  0.02375  1.050  0.29354    
variable2 -0.20715   0.81290  0.02395 -8.650  < 2e-16 ***
variable3  0.12940   1.13814  0.02263  5.717 1.08e-08 ***
variable4  0.02469   1.02500  0.02289  1.079  0.28077    
variable5  0.13165   1.14070  0.02235  5.891 3.84e-09 ***
variable6  0.22286   1.24965  0.01534 14.526  < 2e-16 ***
variable7 -0.10513   0.90021  0.02035 -5.167 2.38e-07 ***
variable8  -0.12215   0.88501  0.02243 -5.447 5.13e-08 ***
variable9  -0.04930   0.95189  0.01827 -2.698  0.00697 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

      exp(coef) exp(-coef) lower .95 upper .95
variable1    1.0253     0.9754    0.9786    1.0741
variable2    0.8129     1.2302    0.7756    0.8520
variable3    1.1381     0.8786    1.0888    1.1898
variable4    1.0250     0.9756    0.9800    1.0720
variable5    1.1407     0.8767    1.0918    1.1918
variable6    1.2496     0.8002    1.2126    1.2878
variable7    0.9002     1.1109    0.8650    0.9368
variable8    0.8850     1.1299    0.8470    0.9248
variable9    0.9519     1.0505    0.9184    0.9866

Concordance= 0.543  (se = 0.002 )
Rsquare= 0.022   (max possible= 1 )
Likelihood ratio test= 516.5  on 9 df,   p=0
Wald test            = 503.1  on 9 df,   p=0
Score (logrank) test = 505.1  on 9 df,   p=0

Due to the censored nature of survival data, it is usually more useful to compute a median survival time instead of a mean expected survival time. 由于生存数据的审查性质,计算中位生存时间而不是平均预期生存时间通常更有用。 You can very easily recover the median survival time for each person in your data by running the following: 通过运行以下内容,您可以非常轻松地恢复数据中每个人的中位生存时间:

survfit(cox.ph.model,newdata= DataTest)

I do not think you can estimate the survival time of a single observation using Cox Proportional Hazards model. 我不认为您可以使用Cox比例风险模型估算单次观察的存活时间。 The model outputs hazard ratio as the output and is well suited understanding the effects of covariates on survival as it does not make any assumptions of the baseline hazard function. 该模型输出风险比作为输出,非常适合理解协变量对生存的影响,因为它没有对基线危险函数做出任何假设。 If you want to estimate the survival time for a single observation, you are better off using distributions such as Weibull or Exponential which will allow you to do that and which are a part of the Survival package. 如果你想估计一次观察的存活时间,你最好使用Weibull或Exponential这样的分布,这将允许你这样做,哪些是生存包的一部分。

Thanks, 谢谢,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM