我想绘制以下Cox比例风险模型的ROC曲线。
coxph_tvc <- coxph(Surv(time0, time1, event_tvc) ~ channelname)
我尝试了survivalROC Package。
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)
有什么建议吗?你知道其他任何包