使用Sbrier(R)估计Cox生存模型的预测准确性 [英] Estimating prediction accuracy of a Cox survival model using sbrier (R)

查看:992
本文介绍了使用Sbrier(R)估计Cox生存模型的预测准确性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

格拉夫(Graf)等人(1999)在一篇论文中提出了综合的Brier分数(IBS),作为衡量生存模型预测准确性的良好方法(请参见例如 Wiering等人的综述文件。,第23页)。



它在软件包 ipred 中作为函数 sbrier 。但是,虽然brier分数定义显然适用于Cox比例风险模型,但我无法让 sbrier 返回 coxph 模型。



这是问题所在。

 图书馆(生存)
图书馆(ipred)
数据( DLBCL,包装= ipred)

#fit coxph模型
smod<-Surv (DLBCL $ time,DLBCL $ cens)
coxmod <-coxph(smod〜IPI,data = DLBCL)#我只是从DLBCL
?sbrier

之后

  obj:Surv类的对象。 
pred:预测值。概率或残差对象列表。

所以我们有一个幸存对象列表

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

或生存概率

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

第一个返回的

  sbrier(smod,list(survfit(coxmod)))中的错误:
pred必须具有长度(时间)

第二个

  sbrier(smod,survfit(coxmod,newdata = DLBCL)$ surv)中的错误: 
pred

的尺寸错误

示例未列出 coxph 模型。也许不支持。否则,我该怎么办?

解决方案

您可以改用pec软件包。



示例:

 库(pec)
set.seed(18713)
库(prodlim)
库(生存)
dat = SimSurv(100)
pmodel = coxph(Surv(time,status)〜X1 + X2,data = dat)
perror = pec(list(Cox = pmodel),Hist(时间,状态)〜1,data = dat)
##累积预测误差
crps(perror)#在最小时间和1之间
##同一件事:
ibs(perror)


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 e.g. overview paper by Wiering et al., page 23).

It was implemented in the package ipred as function 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.

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. Following ?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. Perhaps it's not supported. Otherwise, where do I go wrong?

解决方案

You can use the pec package, instead.

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) 

这篇关于使用Sbrier(R)估计Cox生存模型的预测准确性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆