% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot_bootstrap}
\alias{plot_bootstrap}
\title{Bootstrap Coefficient Comparison Plot}
\usage{
plot_bootstrap(x, features = NULL, batch_size = 9)
}
\arguments{
\item{x}{Either a \code{"bootstrap_orthoMTL"} object (as returned
by \code{\link{bootstrap_orthoMTL}}) or a \code{data.frame} with
columns \code{id}, \code{time}, \code{coeff}, and \code{group}.}

\item{features}{A character vector of feature names to plot. If
\code{NULL} (default), all features are plotted.}

\item{batch_size}{Number of features per facet page. Default:
\code{9}.}
}
\value{
A list of \code{ggplot2} objects, one per batch/page.
}
\description{
Displays faceted line plots comparing real (bootstrapped) vs null
(permuted) coefficient trajectories across tasks for selected or
all features. Each panel shows the mean and standard error of the
coefficient at each task/threshold.
}
\details{
Blue lines show coefficients from models fitted on bootstrapped
(resampled) data — reflecting estimation variability under real
signal. Grey lines show coefficients from models fitted on
permuted outcomes — reflecting the null distribution.

When the blue (real) band is clearly separated from the grey
(null) band, the feature's coefficient is distinguishable from
noise at that task/threshold.
}
\examples{
\donttest{
set.seed(42)
n <- 30; p <- 5; n_tasks <- 3
X <- matrix(rnorm(n * p), n, p)
colnames(X) <- paste0("V", seq_len(p))
SurvTime <- rexp(n, rate = 0.1)
Event <- rbinom(n, 1, 0.7)
thresholds <- c(4, 6, 10)
Y <- create_longitudinal_labels(SurvTime, Event, thresholds)
W <- create_indicator_matrix(Y)
K <- create_constraint_matrix(n_tasks)
boot_res <- bootstrap_orthoMTL(
  X = X, Y = Y, lambda = 1e-3, step_size = 0.1,
  K = K, survival = TRUE, censored.mat = W,
  n_repeats = 5, n_cores = 1, verbose = FALSE
)
plots <- plot_bootstrap(boot_res)
plots[[1]]
}
}
\seealso{
\code{\link{bootstrap_orthoMTL}}
}
