mlmpower: An R Package for Conducting Power Analysis and Data Simulation with Multilevel Models
Brian T Keller · 2024
Power analysis is a critical step in designing studies involving multilevel models, yet existing approaches can be complex and limited in flexibility. This paper introduces mlmpower, an R package designed to simplify Monte Carlo power analysis for multilevel models. The package accommodates various model specifications, including cross-level interactions, random slopes, and within-cluster and between-cluster predictors. Unlike other methods, which often require a pilot study or extensive prior data, mlmpower uses intuitive effect size metrics to simulate data and estimate power with confidence intervals. Inspired by ggplot2, the package's syntax allows for modular model building, making it accessible even to researchers with minimal simulation experience. Additionally, mlmpower supports including missing data mechanisms, offering more realistic power estimates for longitudinal and cross-sectional studies.