Wild bootstrap for linear regression with heteroskedasticity
Source:R/bootstrap_methods.R
wild_bootstrap.RdMultiplies 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
)See also
sandwich::vcovBS, fwildclusterboot::boottest,
morie_did_wild_cluster_bootstrap().