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).
generate_boot_indices(data, treatment_var, boot_level = "full")Integer vector of bootstrap indices of length nrow(data).
Data frame to bootstrap from.
Name of treatment variable.
Bootstrap sampling level: "full" (default) samples from entire dataset, "strata" samples within each treatment group preserving group sizes.