Learn R Programming

PSsurvival (version 0.2.0)

generate_boot_indices: 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")

Value

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

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.