Skip to main content
QUICK REVIEW

[Paper Review] Bootstrapping Clustered Data in R using lmeresampler

Adam Loy, Jenna Korobova|arXiv (Cornell University)|Jun 11, 2021
Bayesian Methods and Mixture ModelsComputer Science12 citations
TL;DR

This paper introduces the lmeresampler package for bootstrapping linear mixed-effects models in R, offering five resampling methods—cases, residual, parametric, wild, and block bootstrap—for clustered data. It enables bias-corrected inference, confidence intervals, and function-of-parameter estimation, with support for parallel computing via doParallel and foreach.

ABSTRACT

Linear mixed-effects models are commonly used to analyze clustered data structures. There are numerous packages to fit these models in R and conduct likelihood-based inference. The implementation of resampling-based procedures for inference are more limited. In this paper, we introduce the lmeresampler package for bootstrapping nested linear mixed-effects models fit via lme4 or nlme. Bootstrap estimation allows for bias correction, adjusted standard errors and confidence intervals for small samples sizes and when distributional assumptions break down. We will also illustrate how bootstrap resampling can be used to diagnose this model class. In addition, lmeresampler makes it easy to construct interval estimates of functions of model parameters.

Motivation & Objective

  • To address the lack of accessible, user-friendly bootstrap procedures for linear mixed-effects (LME) models in R, especially for clustered or multilevel data.
  • To provide a unified, easy-to-use interface for multiple bootstrap methods (cases, residual, parametric, wild, block) tailored for LME models fitted with lme4 or nlme.
  • To enable robust statistical inference—especially bias correction, standard error adjustment, and confidence intervals—when distributional assumptions are violated or sample sizes are small.
  • To support estimation of complex functions of model parameters, such as repeatability, using resampling-based methods.
  • To facilitate parallel bootstrapping through integration with doParallel and foreach, improving computational efficiency for large-scale resampling.

Proposed method

  • The lmeresampler package implements five bootstrap procedures: cases (nonparametric), residual, parametric, wild, and block bootstrap, all adapted for nested, Gaussian LME models.
  • The bootstrap() function serves as a unified interface, allowing users to specify the type of bootstrap (e.g., type = 'parametric') and the number of resamples (B).
  • For parametric bootstrapping, the package uses the fitted model’s estimated parameters (β̂, D̂, σ̂²) to simulate new response vectors y* from the conditional distribution y|b ~ N(Xβ + Zb, σ²I).
  • The residual and wild bootstrap methods resample residuals (marginal or conditional) to generate new response data, preserving the model’s error structure.
  • The block bootstrap preserves cluster-level dependence by resampling entire clusters of observations, maintaining the hierarchical structure.
  • The package supports parallelization via the combine_lmeresamp() utility function, which merges results from multiple bootstrap runs executed across cores using foreach and doParallel.

Experimental results

Research questions

  • RQ1How can bootstrap resampling be effectively applied to linear mixed-effects models with clustered data to improve inference under small sample sizes or violated distributional assumptions?
  • RQ2What are the most appropriate bootstrap methods (e.g., parametric, residual, block) for nested LME models, and how do they compare in terms of bias correction and coverage?
  • RQ3Can a single, user-friendly R package streamline access to multiple bootstrap procedures for LME models, reducing reliance on custom coding or external software?
  • RQ4How can bootstrapping be efficiently parallelized in R to reduce computation time for large-scale resampling in LME models?
  • RQ5Can bootstrap-based methods be used to estimate complex functions of model parameters, such as repeatability, with reliable confidence intervals?

Key findings

  • The lmeresampler package successfully implements five bootstrap methods—cases, residual, parametric, wild, and block—for nested linear mixed-effects models in R.
  • The parametric bootstrap in lmeresampler produces a 95% confidence interval for the fixed effect of 'time' in the JSP dataset of [0.299, 0.480], demonstrating practical interval estimation.
  • The package enables estimation of functions of model parameters, such as repeatability, with bootstrap confidence intervals, as shown in the beetle dataset example.
  • Parallel bootstrapping using two cores reduced the runtime for 2000 bootstrap iterations from ~38.8 seconds (single core) to ~19.3 seconds, achieving a speedup factor of approximately 2.01.
  • The combine_lmeresamp() function effectively merges results from multiple parallel bootstrap runs into a single lmeresamp object, enabling consistent downstream analysis.
  • The package supports generalized linear mixed models (GLMMs) via glmer() for cases, residual, and parametric bootstraps, and parametric bootstraps for models with crossed random effects, though performance may be suboptimal in such cases.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.