Bootstrap Resampling for Multilevel Models

Functions for bootstrapping with multilevel data and models (and mixed-effect models). It implements multiple bootstrap methods under the parametric, residual, and case bootstrap categories, as discussed in Van der Leeden, Meijer, and Busing (2008) and Carpenter, Goldstein, and Rasbash (2003) . Currently it supports fitted objects from the 'lme4' package.


bootmlm

The bootmlm package does bootstrap resampling for multilevel models. Currently only models fitted with lme4::lmer() is supported. You can install the package on GitHub:

install.packages("bootmlm")

See this paper for a performance comparison of different bootstrapped confidence intervals for multilevel effect size estimations:

Lai, M. H. C. (2021). Bootstrap confidence interval for multilevel standardized effect size. Multivariate Behavioral Research, 56(4), 558--578. https://doi.org/10.1080/00273171.2020.1746902

Example

Here is an example to get the bootstrap distributions of the fixed effects and the level-1 error SD:

library(lme4)
fm01ML <- lmer(Yield ~ (1 | Batch), Dyestuff, REML = FALSE)
mySumm <- function(x) {
  c(getME(x, "beta"), sigma(x))
}
# Covariance preserving residual bootstrap
library(bootmlm)
boo01 <- bootstrap_mer(fm01ML, mySumm, type = "residual", nsim = 100)
# Plot bootstrap distribution of fixed effect
library(boot)
plot(boo01, index = 1)
# Get confidence interval
boot.ci(boo01, index = 2, type = c("norm", "basic", "perc"))
# BCa using influence values computed from `empinf_mer`
boot.ci(boo01, index = 2, type = "bca", L = empinf_mer(fm01ML, mySumm, 2))

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bootmlm")

0.1.1 by Mark Lai, 5 months ago


https://github.com/marklhc/bootmlm, https://marklhc.github.io/bootmlm/


Report a bug at https://github.com/marklhc/bootmlm/issues


Browse source code at https://github.com/cran/bootmlm


Authors: Mark Lai [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports boot, lme4, Matrix, methods, numDeriv, stats, utils

Suggests nlme, testthat, MASS, knitr, rmarkdown, haven, msm, dplyr, purrr, ggplot2


Suggested by r2mlm.


See at CRAN