CGR Bootstrap for Nested LMEs
Description
Generate semiparametric bootstrap replicates of a statistic for a nested linear mixedeffects model.
Usage
1 2 3 4 5 6 7  ## S3 method for class 'lmerMod'
cgr_bootstrap(model, fn, B)
## S3 method for class 'lme'
cgr_bootstrap(model, fn, B)
cgr_bootstrap(model, fn, B)

Arguments
model 
The model object you wish to bootstrap. 
fn 
A function returning the statistic(s) of interest. 
B 
The number of bootstrap resamples. 
Details
The semiparametric bootstrap algorithm implemented was outlined by Carpenter, Goldstein and Rasbash (2003). The algorithm is outlined below:
Obtain the parameter estimates from the fitted model and calculate the estimated error terms and EBLUPs.
Rescale the error terms and EBLUPs so that the empirical variance of these quantities is equal to estimated variance components from the model.
Sample independently with replacement from the rescaled estimated error terms and rescaled EBLUPs.
Obtain bootstrap samples by combining the samples via the fitted model equation.
Refit the model and extract the statistic(s) of interest.
Repeat steps 35 B times.
Value
The returned value is an object of class "boot", compatible with the boot
package's boot
methods.
References
Carpenter, J. R., Goldstein, H. and Rasbash, J. (2003) A novel bootstrap procedure for assessing the relationship between class size and achievement. Journal of the Royal Statistical Society. Series C (Applied Statistics), 52, 431–443.
See Also

parametric_bootstrap
,resid_bootstrap
,case_bootstrap
,cgr_bootstrap
,reb_bootstrap
for more details on a specific bootstrap. 
bootMer
in the lme4 package for an implementation of (semi)parameteric bootstrap for mixed models. 
boot
,boot.ci
, andplot.boot
from the boot package.