使用PEC包计算C指数的时候报错
f<-cph(Surv(survival.time,death)~Age+stroke+Angiotensin.II.receptor.blocker+hematocrit+albumin+creatinine+alanine.aminotransferase+total_KtV,data=tdata,x=T,Y=T,surv = T)
set.seed(123)
c_index<-cindex(list("f"=f),
eval.times=seq(0,3650,365),
cens.model = "cox",
keep.pvalues = T,
confInt = T,
confLevel = 0.95,
splitMethod = "bootcv",
B=1000)
报错内容
Error in UseMethod("predictEventProb", object) :
no applicable method for 'predictEventProb' applied to an object of class "c('cph', 'rms', 'coxph')"
In addition: Warning messages:
1: In cindex(list(`model f` = f), eval.times = seq(0, 3650, 365), cens.model = "cox", :
Formula missing. Using formula from first model
2: In cindex(list(`model f` = f), eval.times = seq(0, 3650, 365), cens.model = "cox", :
Argument data is missing. I use the data from the call to the first model instead.