【发布时间】:2016-01-13 12:51:50
【问题描述】:
我想为以下 Cox 比例风险模型绘制 ROC 曲线。
Cox 比例风险模型 - 使用时变协变量
coxph_tvc <- coxph(Surv(time0, time1, event_tvc) ~ channelname)
我尝试了survivalROC包。
library(survivalROC)
predsurv<- predict(coxph_tvc, type = "lp")
nobs <- NROW(data_tvc)
cutoff <- 3650
rocfit <- survivalROC.C( Stime = time1,
status = event_tvc,
marker = channelname,
predict.time = cutoff,
span = 1500)
plot(rocfit$FP, rocfit$TP, type = "l",
xlim = c(0,1), ylim = c(0,1),
xlab = paste( "FP \n AUC =",round(rocfit$AUC,3)),
ylab = "TP",main = "Year = 1" )
abline(0,1)
有什么建议吗?你知道其他包吗
【问题讨论】:
-
minimal reproducible example 的任何数据?
-
“我尝试了survivalROC包。”发生了什么?
-
对具有时变协变量的模型的预测需要在请求的预测期间为每个协变量提供一个场景。你搭建过这样一套完整的场景吗?
标签: r survival-analysis roc cox-regression