Evaluates prognostic ability of a survival model by calculating time-dependent AUC at the 30th and 90th percentiles of survival time. These thresholds assess short-term and long-term predictive accuracy.
Examples
if (requireNamespace("glmnet", quietly = TRUE) &&
requireNamespace("survival", quietly = TRUE) &&
requireNamespace("timeROC", quietly = TRUE)) {
library(survival)
set.seed(123)
x <- matrix(rnorm(100 * 5), ncol = 5)
y <- Surv(rexp(100), rbinom(100, 1, 0.5))
fit <- glmnet::cv.glmnet(x, y, family = "cox")
acture_y <- data.frame(time = y[, 1], status = y[, 2])
auc_results <- PrognosticAUC(fit, newx = x, s = "lambda.min", acture.y = acture_y)
}