% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_preparation.R
\name{create_longitudinal_labels}
\alias{create_longitudinal_labels}
\title{Convert Survival Data to Longitudinal Binary Labels}
\usage{
create_longitudinal_labels(SurvTime, Event, thresholds = c(4, 6))
}
\arguments{
\item{SurvTime}{A numeric vector of length \code{n} containing
observed survival times. Must be non-negative.}

\item{Event}{A numeric vector of length \code{n} encoding censoring
status. \code{1} = event observed, \code{0} = censored.}

\item{thresholds}{A numeric vector of length \code{numTasks}
representing the time thresholds at which to evaluate survival
status. Default: \code{c(4, 6)}.}
}
\value{
A numeric matrix of dimensions \code{n x numTasks}. Column
  names are set to the threshold values. Contains \code{1}, \code{0},
  and \code{NA} values as described above.
}
\description{
Transforms time-to-event survival data into a matrix of binary labels
at user-defined time thresholds. This is the core data transformation
that enables survival analysis within the multi-task learning framework.
}
\details{
The encoding logic for each patient at each threshold is:
\itemize{
  \item \code{1} — patient is progression-free at this threshold
    (survival time exceeds threshold, regardless of event status)
  \item \code{0} — patient experienced an event before this threshold
    (survival time < threshold AND event observed)
  \item \code{NA} — patient was censored before this threshold
    (survival time < threshold AND no event observed); label is unknown
}
}
\examples{
# Simulate 10 patients
set.seed(42)
SurvTime <- rexp(10, rate = 0.1)
Event <- rbinom(10, 1, 0.7)
thresholds <- c(4, 6, 10, 15)

Y <- create_longitudinal_labels(SurvTime, Event, thresholds)
Y   # 1 = progression-free, 0 = event, NA = censored
}
\seealso{
\code{\link{create_indicator_matrix}} to convert \code{NA}
  values into a binary censoring indicator matrix.
}
