Skip to contents

Multiplies the residuals by random weights (Rademacher or Mammen) and refits OLS. sandwich::vcovBS implements the standard wild bootstrap variance-covariance and fwildclusterboot::boottest adds cluster-wild p-values; both are cross-referenced here. The inline implementation is retained because rmorie's API returns the resampled coefficient distribution (not just a vcov), which is what downstream MRM analyses consume.

Usage

wild_bootstrap(
  y,
  X,
  statistic_idx = 2L,
  n_boot = 999L,
  ci_level = 0.95,
  weight_distribution = "rademacher",
  seed = 42L
)

Arguments

y

Numeric response vector.

X

Numeric design matrix (include an intercept column).

statistic_idx

Column index of the coefficient of interest (1-based).

n_boot

Number of replicates.

ci_level

Confidence level.

weight_distribution

"rademacher" or "mammen".

seed

Random seed.

Value

A morie_bootstrap_result.

See also