[英]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)
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.