% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/roc_time.R
\name{roc_time}
\alias{roc_time}
\title{Time-dependent ROC Curve for Survival Analysis}
\usage{
roc_time(
  input,
  vars,
  time = "time",
  status = "status",
  time_point = 12,
  time_type = "month",
  palette = "jama",
  cols = "normal",
  seed = 1234,
  show_col = FALSE,
  path = NULL,
  main = "PFS",
  index = 1,
  fig.type = "pdf",
  width = 5,
  height = 5.2
)
}
\arguments{
\item{input}{Data frame containing variables for analysis.}

\item{vars}{Character vector. Variable(s) to be evaluated.}

\item{time}{Character string. Name of the time variable. Default is `"time"`.}

\item{status}{Character string. Name of the status variable. Default is `"status"`.}

\item{time_point}{Integer or vector. Time point(s) for ROC analysis. Default is `12`.}

\item{time_type}{Character string. Time unit (`"day"` or `"month"`). Default is `"month"`.}

\item{palette}{Character string. Color palette for the plot. Default is `"jama"`.}

\item{cols}{Character vector or string. Color specification: `"normal"`, `"random"`,
or custom color vector.}

\item{seed}{Integer. Random seed for reproducibility. Default is `1234`.}

\item{show_col}{Logical indicating whether to display the color palette.
Default is `FALSE`.}

\item{path}{Character string or `NULL`. Path to save the plot. Default is `NULL`.}

\item{main}{Character string. Main title of the plot. Default is `"PFS"`.}

\item{index}{Integer. Index for plot filename. Default is `1`.}

\item{fig.type}{Character string. Output file type (e.g., `"pdf"`, `"png"`).
Default is `"pdf"`.}

\item{width}{Numeric. Width of the plot. Default is `5`.}

\item{height}{Numeric. Height of the plot. Default is `5.2`.}
}
\value{
A ggplot object representing the time-dependent ROC plot.
}
\description{
Generates a time-dependent Receiver Operating Characteristic (ROC) plot to evaluate
the predictive performance of one or more variables in survival analysis. Calculates
the Area Under the Curve (AUC) for each specified time point and variable, and
creates a multi-line ROC plot with annotated AUC values.
}
\examples{
# Simulate data for offline testing
set.seed(123)
sim_input <- data.frame(
  ID = paste0("Sample", 1:100),
  time = runif(100, 1, 60),
  status = sample(0:1, 100, replace = TRUE),
  Marker1 = rnorm(100),
  Marker2 = rnorm(100),
  Marker3 = rnorm(100)
)
\dontrun{
roc_time(
  input = sim_input, vars = c("Marker1", "Marker2", "Marker3"),
  time = "time", status = "status", time_point = 12, path = NULL, main = "OS"
)
}
}
\author{
Dongqiang Zeng
}
