I want to compare different models for survival analysis. To do so I use the "pec" R package. I use 10-fold cross validation. To compare the different models I run the model for 30 cycles. As result I can get the (i) Integrated Brier Score (IBS) of the average pec curve, (ii) crossvalErr for this pec curve, and (iii) the crossvalErr for each individual cycle. However, I would like to be able to get the IBS for each cycle, at different times.
# create a fit
fit <-Surv(survival,censored)~v1+v2+v3+v4
# models
cph <- selectCox(fit, data=data, rule="aic")
rsf <- rfsrc(fit, data=data, forest=True, ntree=1000)
cforest <- pecCforest(fit, data=data, controls=cforest_classical(ntree=1000))
fitpec <- pec(list("selectcox" = fitcox, "rsf" = fitrsf, "cforest" = fitcforest), data = dd_Ex, formula = Surv(surv_m,Censored)~1,
splitMethod = "cv10", B=20, keep.index=TRUE, keep.matrix=TRUE)
To get the IBS I use the code below, but this only gives me the IBS of the average pec:
crps(fitpec, times=c(12, 24, 36, 48, 60, 120, 240, 480), what="crossvalErr")
Integrated Brier score (crps):
IBS[0;time=12) IBS[0;time=24) IBS[0;time=36) IBS[0;time=48) IBS[0;time=60) IBS[0;time=120) IBS[0;time=240)
[1,] 0.015 0.068 0.121 0.153 0.168 0.168 0.133
[2,] 0.014 0.058 0.093 0.110 0.115 0.108 0.081
[3,] 0.013 0.053 0.089 0.107 0.116 0.116 0.091
[4,] 0.012 0.050 0.083 0.099 0.106 0.104 0.078
IBS[0;time=480)
[1,] 0.095
[2,] 0.059
[3,] 0.070
[4,] 0.051
I also tried to use the crossValErrMat, which contains the data for the pec curves of all cycles, but that gives me an error:
crps(fitpec30R$CrossValErrMat[[1]]$Reference, times=c(12, 24, 36, 48, 60, 120, 240, 480), what="crossvalErr")
Error: class(object)[1] == "pec" is not TRUE
How can I find the IBS for each cycle? Thank you!