% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gg_rfsrc.R
\name{bootstrap_survival}
\alias{bootstrap_survival}
\title{Bootstrap pointwise confidence bands for a mean survival curve}
\usage{
bootstrap_survival(gg_dta, bs_samples, level_set)
}
\arguments{
\item{gg_dta}{A wide \code{data.frame} of survival probabilities as returned
by the survival branch of \code{\link{gg_rfsrc.rfsrc}}, before the
optional pivot to long form. Columns \code{obs_id}, \code{event}, and
\code{group} (if present) are excluded from the resampling.}

\item{bs_samples}{Integer; number of bootstrap resamples.}

\item{level_set}{Numeric vector of length 2 giving the lower and upper
quantile probabilities for the confidence band (e.g. \code{c(0.025, 0.975)}
for a 95\% CI).}
}
\value{
A \code{data.frame} with one row per unique event time and columns
  \code{value} (time), \code{lower}, \code{upper}, \code{median}, and
  \code{mean}.
}
\description{
Draws \code{bs_samples} bootstrap resamples (with replacement) of the
per-observation survival curves stored in \code{gg_dta}, computes the column
means to obtain a bootstrapped mean curve per resample, then returns the
pointwise quantiles at \code{level_set} and the overall mean across
resamples.
}
\keyword{internal}
