% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/evaluation.R
\name{eval_timeROC}
\alias{eval_timeROC}
\title{Time-Dependent AUC and Integrated AUC}
\usage{
eval_timeROC(time, event, S_mat, times)
}
\arguments{
\item{time}{Numeric vector of observed follow-up times.}

\item{event}{Numeric vector of event indicators (1 = event, 0 = censored).}

\item{S_mat}{A numeric matrix of predicted survival probabilities.}

\item{times}{Numeric vector of evaluation times matching the columns of \code{S_mat}.}
}
\value{
A list containing the \code{AUC_curve} at each time point, the
\code{times}, and the integrated AUC \code{iAUC}.
}
\description{
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
 )
}
