Recently I am working with survival data and trying to fit time-dependent ROC.
And I have difficulty estimating the optimal cutoff for time-dependent ROC.
Here is the process I do.
library(survival) library(timeROC) library(survivalROC) data(pbc) head(pbc) pbc<-pbc[!is.na(pbc$trt),] pbc$status<-as.numeric(pbc$status==2) # create event indicator: 1 for death, 0 for censored ROC.bili1<-timeROC(T=pbc$time, delta=pbc$status,marker=pbc$bili, cause=1,weighting="marginal", times=c(365,365*3,365*5,365*10), iid=TRUE) ROC.bili1
And here are the results
Time-dependent-Roc curve estimated using IPCW (n=312, without competing risks). Cases Survivors Censored AUC (%) se t=365 22 290 0 85.59 3.51 t=1095 59 240 13 85.02 2.68 t=1825 85 159 68 87.58 2.29 t=3650 120 32 160 81.57 3.85 Method used for estimating IPCW:marginal Total computation time : 0.29 secs.
Next step, I would like to estimate the optimal cutoff in 10 years (time = 365*10)
However, it seems that
timeROC does not return the results I want.
And it is reported that
ROC.bili2<-survivalROC(Stime=pbc$time, status=pbc$status, marker=pbc$bili, predict.time=365*10, method = 'KM')
Estimate the optimal cutoff
ROC.bili2$cut.values[which.max(ROC.bili2$TP-ROC.bili2$FP)]  1.9
And calculate the AUC
ROC.bili2[["AUC"]]  0.8394563
I got the optimal cutoff is 1.9, but the AUC is 0.8394 which is different from using
So my question is
If I can use 1.9 as the optimal cutoff?
Why is the AUC difference between
Is there any way to calculate the optimal cutoff using
Any insight is appreciated.