wild_bootstrap: Wild Bootstrap for LME models

View source: R/generics.R

wild_bootstrap.lmerModR Documentation

Wild Bootstrap for LME models

Description

Generate wild bootstrap replicates of a statistic for a linear mixed-effects model.

Usage

## S3 method for class 'lmerMod'
wild_bootstrap(
  model,
  .f,
  B,
  hccme = c("hc2", "hc3"),
  aux.dist = c("mammen", "rademacher", "norm", "webb", "gamma"),
  .refit = TRUE
)

## S3 method for class '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.

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.

Value

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

References

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

See Also

  • 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.


aloy/lmeresampler documentation built on Dec. 12, 2023, 9:26 a.m.