Evaluates the cumulative/dynamic time-dependent AUC and integrated AUC (iAUC) using inverse probability of censoring weighting (IPCW).
Examples
data("metabric", package = "SuperSurv")
dat <- metabric[1:40, ]
x_cols <- grep("^x", names(dat))[1:3]
X <- dat[, x_cols, drop = FALSE]
newX <- X[1:10, , drop = FALSE]
times <- seq(50, 150, by = 50)
fit <- surv.coxph(
time = dat$duration,
event = dat$event,
X = X,
newdata = newX,
new.times = times,
obsWeights = rep(1, nrow(dat)),
id = NULL
)
eval_timeROC(
time = dat$duration[1:10],
event = dat$event[1:10],
S_mat = fit$pred,
times = times
)
#> $AUC_curve
#> [1] 1.0000000 0.5000000 0.7192982
#>
#> $times
#> [1] 50 100 150
#>
#> $iAUC
#> [1] 0.6798246
#>
