An Introduction to Linear Mixed-Effects Modeling in R
Open accessThe DOI matches its Crossref record; 38 of the 38 references it cites were found in a registry or an index.
Abstract
This Tutorial serves as both an approachable theoretical introduction to mixed-effects modeling and a practical introduction to how to implement mixed-effects models in R. The intended audience is researchers who have some basic statistical knowledge, but little or no experience implementing mixed-effects models in R using their own data. In an attempt to increase the accessibility of this Tutorial, I deliberately avoid using mathematical terminology beyond what a student would learn in a standard graduate-level statistics course, but I reference articles and textbooks that provide more detail for interested readers. This Tutorial includes snippets of R code throughout; the data and R script used to build the models described in the text are available via OSF at https://osf.io/v6qag/ , so readers can follow along if they wish. The goal of this practical introduction is to provide researchers with the tools they need to begin implementing mixed-effects models in their own research.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“LMMs can use all available data for each subject while also handling missing data more appropriately (Brown, 2021;Gueorguieva & Krystal, 2004).”
From Effects of mindfulness meditation and Acceptance and commitment therapy in patients with obstructive sleep apnea with residual excessive sleepiness: A randomized controlled pilot study (2023) · cites this paper as Brown, 2021
In the citing paper
“Despite the unbalanced EDSS data, the mixed-effects models allowed us to examine the impact of CHIT1 on disability progression over time while also considering variability within and across MS patients and time as well as controlling for relevant variables81.”
From CHIT1 at diagnosis predicts faster disability progression and reflects early microglial activation in multiple sclerosis (2024) · cites this paper as [81]
In the citing paper
“We analyzed our data by means of mixed models (i.e., with experimental conditions as factors), as they are more flexible compared to repeated measures ANOVAs with betweenlevel factors-especially when it comes to handling missing data (Brown, 2021).”
From A Randomized Controlled Study on the Effectiveness of Plain Language Summaries of Psychological Meta-Analyses: Targeting Knowledge, User Experience, Relevance, and Trust (2025) · cites this paper as Brown, 2021
In the citing paper
“A likelihood-ratio test (Brown 2021) using the ANOVA function in the lmerTest Rpackage (v.3.1-3, Kuznetsova et al. 2017) was conducted to compare all alternative models to the baseline (see Table 1 for all the results).”
From What Heritage Bilinguals Tell Us about the Language of Emotion (2022) · cites this paper as Brown 2021
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Fitting Linear Mixed-Effects Models Using lme4
Bates, D., Mächler, M., Bolker, B., & Walker, S. (2015) · Journal of Statistical Software · doi:10.18637/jss.v067.i01 · Cited by 86,835
lmerTest Package: Tests in Linear Mixed Effects Models
Kuznetsova, A., Brockhoff, P. B., & Christensen, R. H. B. (2017) · Journal of Statistical Software · doi:10.18637/jss.v082.i13 · Cited by 24,346
Wickham, H., Averick, M., Bryan, J., Chang, W., McGowan, L., François, R., Grolemund, G., Hayes, A., Henry, L., Hester, J., et al. (2019) · Journal of Open Source Software · doi:10.21105/joss.01686 · Cited by 22,138
Multilevel analysis : an introduction to basic and advanced multilevel modeling
Snijders, T. A. B., & Bosker, R. (1999) · Cited by 14,026
Hierarchical Linear Models: Applications and Data Analysis Methods
Davidian, M. (2003) · Journal of the American Statistical Association · doi:10.1198/jasa.2003.s288 · Cited by 13,723
Random effects structure for confirmatory hypothesis testing: Keep it maximal
Barr, D. J., Levy, R., Scheepers, C., & Tily, H. J. (2013) · Journal of Memory and Language · doi:10.1016/j.jml.2012.11.001 · Cited by 10,328 · cited 4×
“…in this example, the random-effects structure including random intercepts for both participants and items, as well as by-participant random slopes for word difficulty, would represent the maximal random-effects structure justified by the design (see Barr et al., 2013; Matuschek et al., 2017).”
BackgroundInfluentialbrms : An R Package for Bayesian Multilevel Models Using Stan
Bürkner, P.-C. (2017) · Journal of Statistical Software · doi:10.18637/jss.v080.i01 · Cited by 9,476
Mixed-effects modeling with crossed random effects for subjects and items
Baayen, R. H., Davidson, D. J., & Bates, D. M. (2008) · Journal of Memory and Language · doi:10.1016/j.jml.2007.12.005 · Cited by 8,540
(2010) · Cited by 7,034
Simmons, J. P., Nelson, L. D., & Simonsohn, U. (2011) · Psychological Science · doi:10.1177/0956797611417632 · Cited by 6,567
Categorical data analysis: Away from ANOVAs (transformation or not) and towards logit mixed models
Jaeger, T. F. (2008) · Journal of Memory and Language · doi:10.1016/j.jml.2007.11.007 · Cited by 3,317
Dichotomizing continuous predictors in multiple regression: a bad idea
Royston, P., Altman, D. G., & Sauerbrei, W. (2006) · Statistics in Medicine · doi:10.1002/sim.2331 · Cited by 2,312 · cited 1×
“…technique, and continuous predictors (e.g., time in a longitudinal study) must be treated categorically (i.e., binned), which reduces statistical power and makes it difficult to model nonlinear relationships between predictors and outcomes (e.g., Liben-Nowell et al., 2019; Royston et al., 2005).”
BackgroundMeasuring the Prevalence of Questionable Research Practices With Incentives for Truth Telling
John, L. K., Loewenstein, G., & Prelec, D. (2012) · Psychological Science · doi:10.1177/0956797611430953 · Cited by 2,239 · cited 1×
“This is a questionable research practice (John et al., 2012) known as hypothesizing after the results are known (HARKing) and should be avoided because, as Kerr (1998) put it, HARKing transforms Type I error (false positives) into theory.”
MethodBalancing Type I error and power in linear mixed models
Matuschek, H., Kliegl, R., Vasishth, S., Baayen, H., & Bates, D. (2017) · Journal of Memory and Language · doi:10.1016/j.jml.2017.01.001 · Cited by 2,010 · cited 3×
“…in this example, the random-effects structure including random intercepts for both participants and items, as well as by-participant random slopes for word difficulty, would represent the maximal random-effects structure justified by the design (see Barr et al., 2013; Matuschek et al., 2017).”
BackgroundMethodHARKing: Hypothesizing after the results are known
Kerr, N. L. (1998) · Personality and Social Psychology Review · doi:10.1207/s15327957pspr0203_4 · Cited by 1,989
Bates, D. M., Kliegl, R. M., Vasishth, S., & Baayen, R. H. (2015) · arXiv (Cornell University) · doi:10.48550/arxiv.1506.04967 · Cited by 1,008
Lo, S., & Andrews, S. (2015) · Frontiers in Psychology · doi:10.3389/fpsyg.2015.01171 · Cited by 973
The Statistical Crisis in Science
Gelman, A., & Loken, E. (2014) · American Scientist · doi:10.1511/2014.111.460 · Cited by 963 · cited 1×
“This results in a massive number of “forking paths” (Gelman & Loken, 2014) that the researcher may embark upon to obtain statistically significant results.”
BackgroundWestfall, J., Kenny, D. A., & Judd, C. M. (2014) · Journal of Experimental Psychology: General · doi:10.1037/xge0000014 · Cited by 928
Best practice guidance for linear mixed-effects models in psychological science
Meteyard, L., & Davies, R. A. I. (2020) · Journal of Memory and Language · doi:10.1016/j.jml.2020.104092 · Cited by 698 · cited 3×
“There are no explicit rules for reporting findings from model comparisons and the associated parameter estimates from the preferred model (Meteyard & Davies, 2020).”
BackgroundMethodInfluentialAnalyzing ‘visual world’ eyetracking data using multilevel logistic regression
Barr, D. J. (2008) · Journal of Memory and Language · doi:10.1016/j.jml.2007.09.002 · Cited by 671 · cited 1×
“When the data are aggregated in this way, however, important information about variability within participants or items is lost, which reduces statistical power (see Barr, 2008), that is, the likelihood of detecting an effect if one exists.”
BackgroundGrowth Curve Analysis and Visualization Using R
Mirman, D. (2017) · Chapman & Hall/CRC eBooks · doi:10.1201/9781315373218 · Cited by 573
Examples of mixed-effects modeling with crossed random effects and with binomial data
Quené, H., & van den Bergh, H. (2008) · Journal of Memory and Language · doi:10.1016/j.jml.2008.02.002 · Cited by 534
Mirman, D., Dixon, J. A., & Magnuson, J. S. (2008) · Journal of Memory and Language · doi:10.1016/j.jml.2007.11.006 · Cited by 531
R for Data Science: Import, Tidy, Transform, Visualize, and Model Data
Wickham, H., & Grolemund, G. (2016) · Cited by 524
Statistics for Linguists: An Introduction Using R
Winter, B. (2019) · Routledge eBooks · doi:10.4324/9781315165547 · Cited by 511 · cited 4×
“…correlation between by-participant random intercepts and slopes, but only because ceiling effects prevented the modality effect from emerging in some individuals (see Winter, 2019, p. 239, for another example of random-effects correlations that may indicate the presence of ceiling effects).”
BackgroundInfluentialExperiments with More Than One Random Factor: Designs, Analytic Models, and Statistical Power
Judd, C. M., Westfall, J., & Kenny, D. A. (2017) · Annual Review of Psychology · doi:10.1146/annurev-psych-122414-033702 · Cited by 466
Linear models and linear mixed effects models in R with linguistic applications
Winter, B. (2013) · arXiv (Cornell University) · doi:10.48550/arxiv.1308.5499 · Cited by 460
Educational Applications of Hierarchical Linear Models: A Review
Raudenbush, S. W. (1988) · Journal of Educational Statistics · doi:10.2307/1164748 · Cited by 301
Winter, B., & Wieling, M. (2016) · Journal of Language Evolution · doi:10.1093/jole/lzv003 · Cited by 218 · cited 1×
“…models are, what they offer over other analytic techniques, and how to implement them in R. Table 3 lists helpful links, as well as additional resources for readers interested in more in-depth descriptions of particular topics. and implementing general additive modeling: Winter and Wieling (2016)”
BackgroundErber, N. P. (1972) · Journal of Speech and Hearing Research · doi:10.1044/jshr.1502.413 · Cited by 151 · cited 1×
“Previous research has shown that being able to see as well as hear a talker in a noisy environment substantially improves listeners’ ability to identify speech relative to hearing the talker alone (e.g., Erber, 1972).”
BackgroundPrimer on Multiple Regression Coding: Common Forms and the Additional Case of Repeated Contrasts
Craig A. Wendorf, C. A. W. (2004) · Understanding Statistics · doi:10.1207/s15328031us0301_3 · Cited by 105 · cited 1×
“…1 so the intercept corresponds to the grand mean) will not change the fit of the model; it will simply change the interpretation of the regression coefficients (but often leads to misinterpretation of interactions, as I discuss below; see Wendorf, 2004, for a description of various coding schemes).”
BackgroundBayesian regression modeling (for factorial designs): A tutorialPreprint
Franke, M., & Roettger, T. B. (2019) · PsyArXiv (OSF Preprints) · doi:10.31234/osf.io/cdxv3 · Cited by 95
A real experiment is a factorial experiment?
Baayen, R. H. (2010) · The Mental Lexicon · doi:10.1075/ml.5.1.06baa · Cited by 90 · cited 2×
“Further, continuous predictors do not pose a problem for mixed-effects models (see Baayen, 2010), and the fitted model provides coefficient estimates that indicate the magnitude and direction of the effects of interest.”
BackgroundIntroduction to the Concept of Likelihood and Its Applications
Etz, A. J. (2018) · Advances in Methods and Practices in Psychological Science · doi:10.1177/2515245917744314 · Cited by 88
About Face: Seeing the Talker Improves Spoken Word Recognition but Increases Listening Effort
Brown, V. A., & Strand, J. F. (2019) · Journal of Cognition · doi:10.5334/joc.89 · Cited by 37 · cited 2×
“The response time data are based on data from a previous experiment of mine (Brown & Strand, 2019; complete data set available at https://osf.io/86zdp/), but the response times themselves have been modified for pedagogical purposes (i.e., to illustrate particular issues that you may encounter when…”
BackgroundMethodSelf-citationLoudness Trumps Pitch in Politeness Judgments: Evidence from Korean Deferential Speech
Idemaru, K., Winter, B., Brown, L., & Oh, G. E. (2019) · Language and Speech · doi:10.1177/0023830918824344 · Cited by 36
The Danger of Testing by Selecting Controlled Subsets, with Applications to Spoken-Word Recognition
Liben‐Nowell, D., Strand, J. F., Sharp, A. M., Wexler, T., & Woods, K. (2019) · Journal of Cognition · doi:10.5334/joc.51 · Cited by 14 · cited 1×
“…technique, and continuous predictors (e.g., time in a longitudinal study) must be treated categorically (i.e., binned), which reduces statistical power and makes it difficult to model nonlinear relationships between predictors and outcomes (e.g., Liben-Nowell et al., 2019; Royston et al., 2005).”
Background
Research works printed but not linked: 1
- S Lee, S Ditko, Amazing Fantasy. 1151962Comic book
Cited by
Contrast coding choices in a decade of mixed models
Brehm, L., & Alday, P. M. (2022) · Journal of Memory and Language · doi:10.1016/j.jml.2022.104334 · Cited by 167
“…good resources for beginners: Meteyard and Davies (2020) use a meta-analytic approach to showcase the uncertainties that researchers have about using mixed models and present a set of clear reporting guidelines, and Brown (2021) presents a complete MEM tutorial in the R programming language.”
Background(2013) · Natural language processing · doi:10.1075/nlp · Cited by 77
Lee, M. H. J., Montgomery, J., & Lai, C. K. (2024) · ACM Conference on Fairness, Accountability, and Transparency (FAccT) · doi:10.1145/3630106.3658975 · Cited by 106
“7 We also fitted additional un-pre-registered models to facilitate interpretation of race/ethnicity and gender fixed effects in the presence of interactions [8].”
MethodNeuromuscular recruitment strategies of the vastus lateralis according to sex
Guo, Y., Jones, E. J., Inns, T. B., Ely, I. A., Stashuk, D. W., Wilkinson, D. J., Smith, K. E., Piasecki, J., Phillips, B. E., Atherton, P. J., et al. (2022) · Acta Physiologica · doi:10.1111/apha.13803 · Cited by 78
Guo, X., Tavakoli, A., Angulo, A. V., Robartes, E., Chen, T. D., & Heydarian, A. (2022) · Transportation Research Part F Traffic Psychology and Behaviour · doi:10.1016/j.trf.2022.11.015 · Cited by 59
“LMM is centered around the idea of variability across participants [8, 25].”
Metadata
- Authors
- Brown, V. A.
- Affiliations
- Washington University in St. Louis (US)
- Corresponding author
- Brown, Violet A.
- ORCID
- Brown, Violet A.
- Venue
- Advances in Methods and Practices in Psychological Science
- Publisher
- SAGE Publications
- Published
- 2021-01
- Volume
- 4
- Issue
- 1
- ISSN
- 2515-2459 (ISSN-L)
- 2515-2467
- OpenAlex
- W3044002230
- Semantic Scholar
- 940b482d81719d24ea86ae2803ce208e7ec871ef
- Cited by
- 576
- References
- 36
- Citations by year
- 2026: 124 · 2025: 159 · 2024: 127 · 2023: 101 · 2022: 59 · 2021: 5
- FWCI
- 54.44
- Type
- journal article
- Language
- en
- Open access
- gold
- doi.org
- Licence
- Locations
- Advances in Methods and Practices in Psychological Science (publishedVersion, cc-by-nc)
- DOAJ (DOAJ: Directory of Open Access Journals) (submittedVersion, cc-by-sa)
- Funders
- national science foundation (DGE-1745038; National Science Foundation Graduate Research Fellowship)
- Topics
- Physical Sciences › Mathematics › Statistics and Probability › Statistical Methods and Bayesian Inference
- Physical Sciences › Mathematics › Statistics and Probability › Data Analysis with R
- Social Sciences › Economics, Econometrics and Finance › Economics and Econometrics › Spatial and Panel Data Analysis
- Keywords
- linear mixed models, R programming language, hierarchical data, random effects, statistical software implementation, psychological research methods
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.