Learn R Programming

lmeresampler (version 0.2.4)

reb_bootstrap.lmerMod: REB Bootstrap for Two-Level Nested LMEs

Description

Generate random effect block (REB) bootstrap replicates of a statistic for a two-level nested linear mixed-effects model.

Usage

# S3 method for lmerMod
reb_bootstrap(model, .f, B, reb_type, .refit = TRUE)

# S3 method for lme reb_bootstrap(model, .f, B, reb_type, .refit = TRUE)

reb_bootstrap(model, .f, B, reb_type, .refit = TRUE)

Value

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

Arguments

model

The model object you wish to bootstrap.

.f

A function returning the statistic(s) of interest.

B

The number of bootstrap resamples.

reb_type

Specification of what random effect block bootstrap version to implement. Possible values are 0, 1 or 2.

.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 random effects block (REB) bootstrap was outlined by Chambers and Chandra (2013) and has been developed for two-level nested linear mixed-effects (LME) models. Consider a two-level LME of the form $$y = X \beta + Z b + \epsilon$$

The REB bootstrap algorithm (type = 0) is as follows:

  1. Calculate the nonparametric residual quantities for the fitted model

    • marginal residuals \(r = y - X\beta\)

    • predicted random effects \(\tilde{b} = (Z^\prime Z)^{-1} Z^\prime r\)

    • error terms \(\tilde{e} = r - Z \tilde{b}\)

  2. Take a simple random sample, with replacement, of the predicted random effects, \(\tilde{b}\).

  3. Draw a simple random sample, with replacement, of the group (cluster) IDs. For each sampled cluster, draw a random sample, with replacement, of size \(n_i\) from that cluster's vector of error terms, \(\tilde{e}\).

  4. Generate bootstrap samples via the fitted model equation \(y = X \widehat{\beta} + Z \tilde{b} + \tilde{e}\)

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

  6. Repeat steps 2-5 B times.

Variation 1 (type = 1): The first variation of the REB bootstrap zero centers and rescales the residual quantities prior to resampling.

Variation 2 (type = 2): The second variation of the REB bootstrap scales the estimates and centers the bootstrap distributions (i.e., adjusts for bias) after REB bootstrapping.

References

Chambers, R. and Chandra, H. (2013) A random effect block bootstrap for clustered data. Journal of Computational and Graphical Statistics, 22, 452--470.

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.