Generate wild bootstrap replicates of a statistic for a linear mixed-effects model.
# S3 method for lmerMod
wild_bootstrap(
model,
.f,
B,
hccme = c("hc2", "hc3"),
aux.dist = c("mammen", "rademacher", "norm", "webb", "gamma"),
.refit = TRUE
)# S3 method for lme
wild_bootstrap(
model,
.f,
B,
hccme = c("hc2", "hc3"),
aux.dist = c("mammen", "rademacher", "norm", "webb", "gamma"),
.refit = TRUE
)
wild_bootstrap(model, .f, B, hccme, aux.dist, .refit = TRUE)
The returned value is an object of class "lmeresamp".
The model object you wish to bootstrap.
A function returning the statistic(s) of interest.
The number of bootstrap resamples.
either "hc2" or "hc3", indicating which
heteroscedasticity consistent covariance matrix estimator to use.
one of "mammen", "rademacher", "norm",
"webb", or "gamma" indicating which auxiliary
distribution to draw the errors from
a logical value indicating whether the model should be refit to
the bootstrap resample, or if the simulated bootstrap resample should be
returned. Defaults to TRUE.
The wild bootstrap algorithm for LMEs implemented here was outlined by Modugno & Giannerini (2015). The algorithm is outlined below:
Draw a random sample equal to the number of groups (clusters) from an auxillary distribution with mean zero and unit variance. Denote these as \(w_1, \ldots, w_g\).
Calculate the selected heteroscedasticity consistent matrix estimator for the marginal residuals, \(\tilde{v}_i\)
Generate bootstrap responses using the fitted equation: \(y_i^* = X_i \beta + \tilde{v}_i w_j\)
Refit the model and extract the statistic(s) of interest.
Repeat steps 2-4 B times.
Modugno, L., & Giannerini, S. (2015). The Wild Bootstrap for Multilevel Models. Communications in Statistics -- Theory and Methods, 44(22), 4812--4825.
Examples are given in bootstrap
parametric_bootstrap, resid_bootstrap,
case_bootstrap, reb_bootstrap,
wild_bootstrap for more details on a specific bootstrap.
bootMer in the lme4 package for an
implementation of (semi-)parametric bootstrap for mixed models.