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)

Arguments

model

The model object you wish to bootstrap.

.f

A function returning the statistic(s) of interest.

B

The number of bootstrap resamples.

hccme

either "hc2" or "hc3", indicating which heteroscedasticity consistent covariance matrix estimator to use.

aux.dist

one of "mammen", "rademacher", "norm", "webb", or "gamma" indicating which auxiliary distribution to draw the errors from

.refit

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.

Value

The returned value is an object of class "lmeresamp".

Details

The wild bootstrap algorithm for LMEs implemented here was outlined by Modugno & Giannerini (2015). The algorithm is outlined below:

  1. 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\).

  2. Calculate the selected heteroscedasticity consistent matrix estimator for the marginal residuals, \(\tilde{v}_i\)

  3. Generate bootstrap responses using the fitted equation: \(y_i^* = X_i \beta + \tilde{v}_i w_j\)

  4. Refit the model and extract the statistic(s) of interest.

  5. Repeat steps 2-4 B times.

References

Modugno, L., & Giannerini, S. (2015). The Wild Bootstrap for Multilevel Models. Communications in Statistics -- Theory and Methods, 44(22), 4812--4825.

See also