Generates bootstrap replicate weights via svrep::as_bootstrap_design().
Both survey_taylor and survey_nonprob inputs are supported.
Usage
create_bootstrap_weights(
data,
replicates = 500L,
...,
type = c("Rao-Wu-Yue-Beaumont", "Rao-Wu", "Antal-Tille", "Preston", "Canty-Davison"),
mse = TRUE,
seed = NULL
)Arguments
- data
A
survey_taylororsurvey_nonprobdesign object.- replicates
integer(1), default500L. Number of bootstrap replicates. Must be >= 2. Whole-number doubles are coerced silently.- ...
Must be empty. Forces all subsequent arguments to be named.
- type
character(1). Bootstrap variant passed tosvrep::as_bootstrap_design(). One of"Rao-Wu-Yue-Beaumont"(default),"Rao-Wu","Antal-Tille","Preston", or"Canty-Davison".- mse
logical(1), defaultTRUE. IfTRUE, variance is estimated as the deviation from the full-sample estimate.- seed
integer(1)orNULL. If non-NULL, sets the RNG seed viawithr::local_seed()for the duration of the call; caller's RNG state is restored on exit.
Value
A survey_replicate with replicates new rep_1...rep_N columns,
@variables$type = "bootstrap", and a "replicate_creation" entry in the
weighting history.
