简体   繁体   English

使用sbrier(R)估计Cox生存模型的预测准确性

[英]Estimating prediction accuracy of a Cox survival model using sbrier (R)

The integrated Brier score (IBS) has been suggested in a paper by Graf et al (1999) as a good measure for prediction accuracy in survival models (see eg overview paper by Wiering et al. , page 23). Graf等人(1999)在一篇论文中提出了综合Brier评分(IBS),作为生存模型预测准确性的一个很好的衡量标准(参见Wiering等人的综述论文 ,第23页)。

It was implemented in the package ipred as function sbrier . 它在ipred包中ipred为函数sbrier However, whereas the brier score definition obviously applies to Cox proportional hazard models, I cannot get sbrier to return the Brier score for a coxph model. 然而,尽管野蔷薇得分定义显然也适用于Cox比例风险模型,我不能让sbrier返回布来得分的coxph模型。

Here is the problem set up. 这是设置的问题。

library(survival)
library(ipred)
data("DLBCL", package = "ipred")

#Fit coxph model    
smod   <- Surv(DLBCL$time, DLBCL$cens)
coxmod <- coxph(smod ~ IPI, data = DLBCL) # I just chose a significant covariate from DLBCL

Now I want to estimate the IBS. 现在我想估计IBS。 Following ?sbrier 以下?sbrier

obj  : an object of class Surv.
pred : predicted values. Either a probability or a list of survfit objects.

So we have a list of survfit objects 所以我们有一个幸存对象列表

sbrier(smod, list(survfit(coxmod) ))

or survival probabilties 或生存概率

sbrier(smod, survfit(coxmod,newdata=DLBCL)$surv )

The first returning 第一次回归

Error in sbrier(smod, list(survfit(coxmod))) : 
  pred must be of length(time)

The second 第二

Error in sbrier(smod, survfit(coxmod, newdata = DLBCL)$surv) : 
  wrong dimensions of pred

The examples do not list a coxph model. 示例未列出coxph模型。 Perhaps it's not supported. 也许它不受支持。 Otherwise, where do I go wrong? 否则,我哪里出错了?

You can use the pec package, instead. 您可以使用pec包。

Example: 例:

library(pec)
set.seed(18713)
library(prodlim)
library(survival)
dat=SimSurv(100)
pmodel=coxph(Surv(time,status)~X1+X2,data=dat)
perror=pec(list(Cox=pmodel),Hist(time,status)~1,data=dat)
## cumulative prediction error
crps(perror) # between min time and 1
## same thing:
ibs(perror) 
library(survival)
library(ipred)
data("DLBCL", package = "ipred")



smod   <- Surv(DLBCL$time, DLBCL$cens)
coxmod <- coxph(smod ~ IPI, data = DLBCL)
coxmod
Call:
coxph(formula = smod ~ IPI, data = DLBCL)
     coef exp(coef) se(coef)    z      p
IPI 0.505     1.657    0.181 2.79 0.0053
Likelihood ratio test=8.15  on 1 df, p=0.0043
n= 38, number of events= 20 
   (2 observations deleted due to missingness)

Only 38 observations were used . 仅使用了38次观察。 The others needed to be removed before predicting. 在预测之前需要删除其他人。

DLBCL <- DLBCL[!(is.na(DLBCL$IPI)|is.na(DLBCL$time)|is.na(DLBCL$cens)),]

pred  <- predict(coxmod)
 sbrier(smod, pred,btime=2)

result 结果

Brier score 
  1.457241 
attr(,"time")
[1] 2

The btime must be specified, which means ibs can't be calculated. 必须指定btime,这意味着无法计算ibs。 I have not figured it out yet. 我还没弄明白。

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

相关问题 使用R中的Cox比例风险模型计算生存预测 - Calculate the Survival prediction using Cox Proportional Hazard model in R 考克斯模型的年生存率[R] - yearly survival rates with cox model [R] 使用R中的生存包在考克斯比例风险模型中实现非线性关系 - implementing a non-linear relationship within a cox proportional hazards model using the survival package in R 如何预测R中Cox回归模型的生存时间? - How to predict survival time in Cox's Regression Model in R? Cox ph的出色预测准确性 - Extimate prediction accuracy of cox ph 使用 R 包“survival”和“rms”校准 Cox PH 模型:时间单位混淆 - Calibrating a Cox PH model with R packages 'survival' and 'rms': time unit confusion 未计算 R 中 Cox 回归中的中位生存期 - Not calculated median survival in Cox regression in R 在使用R进行的生存分析中,考克斯比例危害模型中surv函数的目的是什么? - In Survival Analysis with R, what is the purpose of the `surv`function in the Cox Proportional Hazards Model? 如何满足 R 中幼苗存活数据的 Cox 比例风险模型假设 - How to meet Cox proportional hazard model assumptions for seedling survival data in R 如何在 R 中获取仅拦截 cox ph 模型,这在生存包中意味着什么? - How to get for an intercept only cox ph model in R and what does that mean in the survival package?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM