reb_bootstrap.lmerMod | R Documentation |
Generate random effect block (REB) bootstrap replicates of a statistic for a two-level nested linear mixed-effects model.
## S3 method for class 'lmerMod' reb_bootstrap(model, .f, B, reb_type, .refit = TRUE) ## S3 method for class 'lme' reb_bootstrap(model, .f, B, reb_type, .refit = TRUE) reb_bootstrap(model, .f, B, reb_type, .refit = TRUE)
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 |
.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 |
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 β + Z b + ε
The REB bootstrap algorithm (type = 0
) is as follows:
Calculate the nonparametric residual quantities for the fitted model
marginal residuals r = y - Xβ
predicted random effects \tilde{b} = (Z^\prime Z)^{-1} Z^\prime r
error terms \tilde{e} = r - Z \tilde{b}
Take a simple random sample, with replacement, of the predicted random effects, \tilde{b}.
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}.
Generate bootstrap samples via the fitted model equation y = X \widehat{β} + Z \tilde{b} + \tilde{e}
Refit the model and extract the statistic(s) of interest.
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.
The returned value is an object of class "lmeresamp".
Chambers, R. and Chandra, H. (2013) A random effect block bootstrap for clustered data. Journal of Computational and Graphical Statistics, 22, 452–470.
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.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.