generate_boot_indices: Generate Bootstrap Sample Indices

View source: R/A03-bootstrap-variance.R

generate_boot_indicesR Documentation

Generate Bootstrap Sample Indices

Description

Helper function to generate bootstrap sample indices for either full sample resampling (observational studies) or stratified resampling within treatment groups (randomized controlled trials with fixed allocation).

Usage

generate_boot_indices(data, treatment_var, boot_level = "full")

Arguments

data

Data frame to bootstrap from.

treatment_var

Name of treatment variable.

boot_level

Bootstrap sampling level: "full" (default) samples from entire dataset, "strata" samples within each treatment group preserving group sizes.

Value

Integer vector of bootstrap indices of length nrow(data).


PSsurvival documentation built on Dec. 9, 2025, 9:07 a.m.