Skip to contents

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_taylor or survey_nonprob design object.

replicates

integer(1), default 500L. 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 to svrep::as_bootstrap_design(). One of "Rao-Wu-Yue-Beaumont" (default), "Rao-Wu", "Antal-Tille", "Preston", or "Canty-Davison".

mse

logical(1), default TRUE. If TRUE, variance is estimated as the deviation from the full-sample estimate.

seed

integer(1) or NULL. If non-NULL, sets the RNG seed via withr::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.