Perform Per-Feature Survival Modeling on Bootstrap Resamples

bootstrap_survival(x, meta.info, formula.str, competing_risks)

Arguments

x

A list of data matrices (bootstrap resample), where each element corresponds to a resampled group. Rows represent features (e.g., proteins, metabolites) and columns represent samples.

meta.info

A data frame containing the metadata for the samples, including time, event, and any additional covariates used in formula.str.

formula.str

A string specifying the formula to be used in model fitting. Must include a Surv(time, event) term. The per-feature coefficient term (y) is prepended automatically.

competing_risks

Logical. If FALSE (default), a Cox proportional hazards model is fitted per feature using coxph. If TRUE, a competing risks model is fitted per feature using crr from the cmprsk package.

Value

A list containing the following elements:

d

A numeric vector of absolute coefficients (\(|\beta|\)) for each feature.

s

A numeric vector of standard errors of the coefficients for each feature.

Details

For each feature (row), the function constructs a temporary data frame combining the bootstrap-resampled expression values (y) with the sample metadata. It then fits either a Cox proportional hazards model (competing_risks = FALSE) or a Fine subdistribution hazard model (competing_risks = TRUE) per feature, extracting the coefficient and its standard error for the feature term y.

See also