Journal of Data Science logo


Login Register

  1. Home
  2. To appear
  3. Data-Driven Model Structure Diagrams for ...

Journal of Data Science

Submit your article Information
  • Article info
  • Related articles
  • More
    Article info Related articles

Data-Driven Model Structure Diagrams for Hierarchical Linear Mixed Models
Greta M. Linse ORCID icon link to view author Greta M. Linse details   Mark C. Greenwood   Ronald K. June  

Authors

 
Placeholder
https://doi.org/10.6339/26-JDS1222
Pub. online: 26 March 2026      Type: Statistical Data Science      Open accessOpen Access

Received
11 August 2025
Accepted
21 February 2026
Published
26 March 2026

Abstract

Hierarchical linear mixed models are commonly used in many scientific fields. However, without a strong statistical background, it can be hard to understand the relationships between the random effect variables and the inferences that can be made when a model has nested random effects. Visualizing relationships makes it easier for the practitioner to understand what relationships the model is capable of estimating and testing. We present an R package modeldiagramR that seamlessly creates a visualization of the model based on the data and the model object created when fitting a linear mixed model using either lme4 or nlme.

Supplementary material

 Supplementary Material
The supplementary material is an R script file that contains all the code used to create the figures and model diagrams from this manuscript.

References

 
Bache SM, Wickham H (2022). magrittr: A Forward-Pipe Operator for R. R package version 2.0.3.
 
Bates D, Mächler M, Bolker B, Walker S (2015). Fitting linear mixed-effects models using lme4. Journal of Statistical Software, 67(1): 1–48. https://doi.org/10.18637/jss.v067.i01
 
Brooks ME, Kristensen K, van Benthem KJ, Magnusson A, Berg CW, ... Bolker BM (2017). glmmTMB balances speed and flexibility among packages for zero-inflated generalized linear mixed modeling. The R Journal, 9(2): 378–400. https://doi.org/10.32614/RJ-2017-066
 
Gelman A, Hill J (2021). Data Analysis Using Regression and Multilevel/Hierarchical Models Analytical Methods for Social Research. Cambridge Univ. Press, Cambridge, 23rd printing edition.
 
Henry L, Wickham H (2024). tidyselect: Select from a Set of Strings. R package version 1.2.1.
 
Iannone R (2016). DiagrammeRsvg: Export DiagrammeR Graphviz Graphs as SVG. R package version 0.1.
 
Iannone R, Roy O (2024). DiagrammeR: Graph/Network Visualization. R package version 1.0.11.
 
Koneswarakantha B (2023). easyalluvial: Generate Alluvial Plots with a Single Line of Code. R package version 0.3.2.
 
Kuznetsova A, Brockhoff PB, Christensen RHB (2017). lmerTest package: Tests in linear mixed effects models. Journal of Statistical Software, 82(13): 1–26. https://doi.org/10.18637/jss.v082.i13
 
Luetkemeier MJ, Hanisko JM, Aho KM (2017). Skin tattoos alter sweat rate and Na+ concentration. Medicine & Science in Sports & Exercise, 49(7): 1432–1436. https://doi.org/10.1249/MSS.0000000000001244
 
Murillo D, Gezan S (2024). FielDHub: A Shiny App for Design of Experiments in Life Sciences. R package version 1.4.2.
 
Müller K, Wickham H (2023). tibble: Simple Data Frames. R package version 3.2.1.
 
Pinheiro J, Bates D, R Core Team (2024). nlme: Linear and Nonlinear Mixed Effects Models. R package version 3.1-166.
 
Pinheiro JC, Bates DM (2000). Mixed-Effects Models in S and S-PLUS. Springer, New York.
 
R Core Team (2024). R: A Language and Environment for Statistical Computing. R Foundation for Statistical Computing, Vienna, Austria.
 
Ramsey FL, Schafer DW (2013). The Statistical Sleuth: A Course in Methods of Data Analysis. Brooks/Cole, Cengage Learning, Boston, 3rd edition. OCLC: 794592462.
 
Shönbrodt F (2014). Mixed Models in R. Ludwig-Maximilians-Universität München. https://www.personality-project.org/r/tutorials/summerschool.14/MLM_Schoenbrodt.pdf.
 
Tennekes M, Jonge ED, Daas PJH (2021). Visualizing and Inspecting Large Datasets with Tableplots. Journal of Data Science 11(1): 43–58. Publisher: School of Statistics, Renmin University of China.
 
Warnes GR, Bolker B, Lumley T, Magnusson A, Venables B, ..., Moeller S (2023). gtools: Various R Programming Tools. R package version 3.9.5.
 
Wickham H (2023a). forcats: Tools for Working with Categorical Variables (Factors). R package version 1.0.0.
 
Wickham H (2023b). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.5.1.
 
Wickham H, François R, Henry L, Müller K, Vaughan D (2023). dplyr: A Grammar of Data Manipulation. R package version 1.1.4.
 
Wickham H, Vaughan D, Girlich M (2024). tidyr: Tidy Messy Data. R package version 1.3.1.
 
Zavez K, Harel O (2024). LearnVizLMM: Learning and Communicating Linear Mixed Models Without Data. R package version 1.0.0.
 
Zuur AF, Ieno EN, Walker N, Saveliev AA, Smith GM (2009). Mixed Effects Models and Extensions in Ecology with R. Statistics for Biology and Health. Springer, New York.

Related articles PDF XML
Related articles PDF XML

Copyright
2026 The Author(s). Published by the School of Statistics and the Center for Applied Statistics, Renmin University of China.
by logo by logo
Open access article under the CC BY license.

Keywords
data visualization diagnostic plots model assumption assessment model visualization multivariate high dimensional data random effects

Funding
This work was supported by the National Institute of Arthritis and Musculoskeletal and Skin Diseases of the National Institutes of Health under Award Number 1R01AR081489 and the National Institute of General Medical Sciences of the National Institutes of Health under Award Number P20GM103474. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.

Metrics
since February 2021
150

Article info
views

61

PDF
downloads

Export citation

Copy and paste formatted citation
Placeholder

Download citation in file


Share


RSS

Journal of data science

  • Online ISSN: 1683-8602
  • Print ISSN: 1680-743X

About

  • About journal

For contributors

  • Submit
  • OA Policy
  • Become a Peer-reviewer

Contact us

  • JDS@ruc.edu.cn
  • No. 59 Zhongguancun Street, Haidian District Beijing, 100872, P.R. China
Powered by PubliMill  •  Privacy policy