<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v1.0 20120330//EN" "JATS-journalpublishing1.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="research-article">
<front>
<journal-meta>
<journal-id journal-id-type="publisher-id">JDS</journal-id>
<journal-title-group><journal-title>Journal of Data Science</journal-title></journal-title-group>
<issn pub-type="epub">1683-8602</issn><issn pub-type="ppub">1680-743X</issn><issn-l>1680-743X</issn-l>
<publisher>
<publisher-name>School of Statistics, Renmin University of China</publisher-name>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="publisher-id">JDS1222</article-id>
<article-id pub-id-type="doi">10.6339/26-JDS1222</article-id>
<article-categories><subj-group subj-group-type="heading">
<subject>Statistical Data Science</subject></subj-group></article-categories>
<title-group>
<article-title>Data-Driven Model Structure Diagrams for Hierarchical Linear Mixed Models</article-title>
</title-group>
<contrib-group>
<contrib contrib-type="author">
<contrib-id contrib-id-type="orcid">https://orcid.org/0000-0002-7823-7716</contrib-id>
<name><surname>Linse</surname><given-names>Greta M.</given-names></name><email xlink:href="mailto:greta.linse@montana.edu">greta.linse@montana.edu</email><xref ref-type="aff" rid="j_jds1222_aff_001">1</xref><xref ref-type="corresp" rid="cor1">∗</xref>
</contrib>
<contrib contrib-type="author">
<name><surname>Greenwood</surname><given-names>Mark C.</given-names></name><xref ref-type="aff" rid="j_jds1222_aff_001">1</xref>
</contrib>
<contrib contrib-type="author">
<name><surname>June</surname><given-names>Ronald K.</given-names></name><xref ref-type="aff" rid="j_jds1222_aff_002">2</xref>
</contrib>
<aff id="j_jds1222_aff_001"><label>1</label>Department of Mathematical Sciences, <institution>Montana State University</institution>, Bozeman, Montana, <country>United States of America</country></aff>
<aff id="j_jds1222_aff_002"><label>2</label>Mechanical &amp; Industrial Engineering Department, <institution>Montana State University</institution>, Bozeman, Montana, <country>United States of America</country></aff>
</contrib-group>
<author-notes>
<corresp id="cor1"><label>∗</label>Corresponding author Email: <ext-link ext-link-type="uri" xlink:href="mailto:greta.linse@montana.edu">greta.linse@montana.edu</ext-link>.</corresp>
</author-notes>
<pub-date pub-type="ppub"><year>2026</year></pub-date><pub-date pub-type="epub"><day>26</day><month>3</month><year>2026</year></pub-date><volume content-type="ahead-of-print">0</volume><issue>0</issue><fpage>1</fpage><lpage>21</lpage><supplementary-material id="S1" content-type="archive" xlink:href="jds1222_s001.zip" mimetype="application" mime-subtype="x-zip-compressed">
<caption>
<title>Supplementary Material</title>
<p>The supplementary material is an <sans-serif>R</sans-serif> script file that contains all the code used to create the figures and model diagrams from this manuscript.</p>
</caption>
</supplementary-material><history><date date-type="received"><day>11</day><month>8</month><year>2025</year></date><date date-type="accepted"><day>21</day><month>2</month><year>2026</year></date></history>
<permissions><copyright-statement>2026 The Author(s). Published by the School of Statistics and the Center for Applied Statistics, Renmin University of China.</copyright-statement><copyright-year>2026</copyright-year>
<license license-type="open-access" xlink:href="https://creativecommons.org/licenses/by/4.0/">
<license-p>Open access article under the <ext-link ext-link-type="uri" xlink:href="https://creativecommons.org/licenses/by/4.0/">CC BY</ext-link> license.</license-p></license></permissions>
<abstract>
<p>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 <sans-serif>R</sans-serif> package <italic>modeldiagramR</italic> 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 <italic>lme4</italic> or <italic>nlme</italic>.</p>
</abstract>
<kwd-group>
<label>Keywords</label>
<kwd>data visualization</kwd>
<kwd>diagnostic plots</kwd>
<kwd>model assumption assessment</kwd>
<kwd>model visualization</kwd>
<kwd>multivariate high dimensional data</kwd>
<kwd>random effects</kwd>
</kwd-group>
<funding-group><funding-statement>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.</funding-statement></funding-group>
</article-meta>
</front>
<back>
<ref-list id="j_jds1222_reflist_001">
<title>References</title>
<ref id="j_jds1222_ref_001">
<mixed-citation publication-type="other"> <string-name><surname>Bache</surname> <given-names>SM</given-names></string-name>, <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name> (<year>2022</year>). magrittr: A Forward-Pipe Operator for R. R package version 2.0.3.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_002">
<mixed-citation publication-type="journal"> <string-name><surname>Bates</surname> <given-names>D</given-names></string-name>, <string-name><surname>Mächler</surname> <given-names>M</given-names></string-name>, <string-name><surname>Bolker</surname> <given-names>B</given-names></string-name>, <string-name><surname>Walker</surname> <given-names>S</given-names></string-name> (<year>2015</year>). <article-title>Fitting linear mixed-effects models using lme4</article-title>. <source><italic>Journal of Statistical Software</italic></source>, <volume>67</volume>(<issue>1</issue>): <fpage>1</fpage>–<lpage>48</lpage>. <ext-link ext-link-type="doi" xlink:href="https://doi.org/10.18637/jss.v067.i01" xlink:type="simple">https://doi.org/10.18637/jss.v067.i01</ext-link></mixed-citation>
</ref>
<ref id="j_jds1222_ref_003">
<mixed-citation publication-type="journal"> <string-name><surname>Brooks</surname> <given-names>ME</given-names></string-name>, <string-name><surname>Kristensen</surname> <given-names>K</given-names></string-name>, <string-name><surname>van Benthem</surname> <given-names>KJ</given-names></string-name>, <string-name><surname>Magnusson</surname> <given-names>A</given-names></string-name>, <string-name><surname>Berg</surname> <given-names>CW</given-names></string-name>, ... <string-name><surname>Bolker</surname> <given-names>BM</given-names></string-name> (<year>2017</year>). <article-title>glmmTMB balances speed and flexibility among packages for zero-inflated generalized linear mixed modeling</article-title>. <source><italic>The R Journal</italic></source>, <volume>9</volume>(<issue>2</issue>): <fpage>378</fpage>–<lpage>400</lpage>. <ext-link ext-link-type="doi" xlink:href="https://doi.org/10.32614/RJ-2017-066" xlink:type="simple">https://doi.org/10.32614/RJ-2017-066</ext-link></mixed-citation>
</ref>
<ref id="j_jds1222_ref_004">
<mixed-citation publication-type="book"> <string-name><surname>Gelman</surname> <given-names>A</given-names></string-name>, <string-name><surname>Hill</surname> <given-names>J</given-names></string-name> (<year>2021</year>). <source><italic>Data Analysis Using Regression and Multilevel/Hierarchical Models</italic></source> <series><italic>Analytical Methods for Social Research</italic></series>. <publisher-name>Cambridge Univ. Press</publisher-name>, <publisher-loc>Cambridge</publisher-loc>, <edition>23rd</edition> printing edition.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_005">
<mixed-citation publication-type="other"> <string-name><surname>Henry</surname> <given-names>L</given-names></string-name>, <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name> (<year>2024</year>). tidyselect: Select from a Set of Strings. R package version 1.2.1.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_006">
<mixed-citation publication-type="other"> <string-name><surname>Iannone</surname> <given-names>R</given-names></string-name> (<year>2016</year>). <italic>DiagrammeRsvg: Export DiagrammeR Graphviz Graphs as SVG</italic>. R package version 0.1.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_007">
<mixed-citation publication-type="other"> <string-name><surname>Iannone</surname> <given-names>R</given-names></string-name>, <string-name><surname>Roy</surname> <given-names>O</given-names></string-name> (<year>2024</year>). DiagrammeR: Graph/Network Visualization. R package version 1.0.11.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_008">
<mixed-citation publication-type="other"> <string-name><surname>Koneswarakantha</surname> <given-names>B</given-names></string-name> (<year>2023</year>). easyalluvial: Generate Alluvial Plots with a Single Line of Code. R package version 0.3.2.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_009">
<mixed-citation publication-type="journal"> <string-name><surname>Kuznetsova</surname> <given-names>A</given-names></string-name>, <string-name><surname>Brockhoff</surname> <given-names>PB</given-names></string-name>, <string-name><surname>Christensen</surname> <given-names>RHB</given-names></string-name> (<year>2017</year>). <article-title>lmerTest package: Tests in linear mixed effects models</article-title>. <source><italic>Journal of Statistical Software</italic></source>, <volume>82</volume>(<issue>13</issue>): <fpage>1</fpage>–<lpage>26</lpage>. <ext-link ext-link-type="doi" xlink:href="https://doi.org/10.18637/jss.v082.i13" xlink:type="simple">https://doi.org/10.18637/jss.v082.i13</ext-link></mixed-citation>
</ref>
<ref id="j_jds1222_ref_010">
<mixed-citation publication-type="journal"> <string-name><surname>Luetkemeier</surname> <given-names>MJ</given-names></string-name>, <string-name><surname>Hanisko</surname> <given-names>JM</given-names></string-name>, <string-name><surname>Aho</surname> <given-names>KM</given-names></string-name> (<year>2017</year>). <article-title>Skin tattoos alter sweat rate and Na+ concentration</article-title>. <source><italic>Medicine &amp; Science in Sports &amp; Exercise</italic></source>, <volume>49</volume>(<issue>7</issue>): <fpage>1432</fpage>–<lpage>1436</lpage>. <ext-link ext-link-type="doi" xlink:href="https://doi.org/10.1249/MSS.0000000000001244" xlink:type="simple">https://doi.org/10.1249/MSS.0000000000001244</ext-link></mixed-citation>
</ref>
<ref id="j_jds1222_ref_011">
<mixed-citation publication-type="other"> <string-name><surname>Murillo</surname> <given-names>D</given-names></string-name>, <string-name><surname>Gezan</surname> <given-names>S</given-names></string-name> (<year>2024</year>). FielDHub: A Shiny App for Design of Experiments in Life Sciences. R package version 1.4.2.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_012">
<mixed-citation publication-type="other"> <string-name><surname>Müller</surname> <given-names>K</given-names></string-name>, <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name> (<year>2023</year>). tibble: Simple Data Frames. R package version 3.2.1.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_013">
<mixed-citation publication-type="other"> <string-name><surname>Pinheiro</surname> <given-names>J</given-names></string-name>, <string-name><surname>Bates</surname> <given-names>D</given-names></string-name>, <string-name>R Core Team</string-name> (<year>2024</year>). nlme: Linear and Nonlinear Mixed Effects Models. R package version 3.1-166.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_014">
<mixed-citation publication-type="book"> <string-name><surname>Pinheiro</surname> <given-names>JC</given-names></string-name>, <string-name><surname>Bates</surname> <given-names>DM</given-names></string-name> (<year>2000</year>). <source><italic>Mixed-Effects Models in S and S-PLUS</italic></source>. <publisher-name>Springer</publisher-name>, <publisher-loc>New York</publisher-loc>.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_015">
<mixed-citation publication-type="book"> <string-name>R Core Team</string-name> (<year>2024</year>). <source><italic>R: A Language and Environment for Statistical Computing</italic></source>. <publisher-name>R Foundation for Statistical Computing</publisher-name>, <publisher-loc>Vienna, Austria</publisher-loc>.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_016">
<mixed-citation publication-type="book"> <string-name><surname>Ramsey</surname> <given-names>FL</given-names></string-name>, <string-name><surname>Schafer</surname> <given-names>DW</given-names></string-name> (<year>2013</year>). <source><italic>The Statistical Sleuth: A Course in Methods of Data Analysis</italic></source>. <publisher-name>Brooks/Cole, Cengage Learning</publisher-name>, <publisher-loc>Boston</publisher-loc>, <edition>3rd</edition> edition. <comment>OCLC: 794592462</comment>.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_017">
<mixed-citation publication-type="other"> <string-name><surname>Shönbrodt</surname> <given-names>F</given-names></string-name> (<year>2014</year>). Mixed Models in R. Ludwig-Maximilians-Universität München. <uri>https://www.personality-project.org/r/tutorials/summerschool.14/MLM_Schoenbrodt.pdf</uri>.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_018">
<mixed-citation publication-type="other"> <string-name><surname>Tennekes</surname> <given-names>M</given-names></string-name>, <string-name><surname>Jonge</surname> <given-names>ED</given-names></string-name>, <string-name><surname>Daas</surname> <given-names>PJH</given-names></string-name> (<year>2021</year>). <article-title>Visualizing and Inspecting Large Datasets with Tableplots</article-title>. <source><italic>Journal of Data Science</italic></source> <volume>11</volume>(<issue>1</issue>): <fpage>43</fpage>–<lpage>58</lpage>. Publisher: <publisher-name>School of Statistics</publisher-name>, <publisher-loc>Renmin University of China</publisher-loc>.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_019">
<mixed-citation publication-type="other"> <string-name><surname>Warnes</surname> <given-names>GR</given-names></string-name>, <string-name><surname>Bolker</surname> <given-names>B</given-names></string-name>, <string-name><surname>Lumley</surname> <given-names>T</given-names></string-name>, <string-name><surname>Magnusson</surname> <given-names>A</given-names></string-name>, <string-name><surname>Venables</surname> <given-names>B</given-names></string-name>, ..., <string-name><surname>Moeller</surname> <given-names>S</given-names></string-name> (<year>2023</year>). gtools: Various R Programming Tools. R package version 3.9.5.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_020">
<mixed-citation publication-type="other"> <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name> (<year>2023</year>a). forcats: Tools for Working with Categorical Variables (Factors). R package version 1.0.0.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_021">
<mixed-citation publication-type="other"> <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name> (<year>2023</year>b). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.5.1.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_022">
<mixed-citation publication-type="other"> <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name>, <string-name><surname>François</surname> <given-names>R</given-names></string-name>, <string-name><surname>Henry</surname> <given-names>L</given-names></string-name>, <string-name><surname>Müller</surname> <given-names>K</given-names></string-name>, <string-name><surname>Vaughan</surname> <given-names>D</given-names></string-name> (<year>2023</year>). dplyr: A Grammar of Data Manipulation. R package version 1.1.4.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_023">
<mixed-citation publication-type="other"> <string-name><surname>Wickham</surname> <given-names>H</given-names></string-name>, <string-name><surname>Vaughan</surname> <given-names>D</given-names></string-name>, <string-name><surname>Girlich</surname> <given-names>M</given-names></string-name> (<year>2024</year>). tidyr: Tidy Messy Data. R package version 1.3.1.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_024">
<mixed-citation publication-type="other"> <string-name><surname>Zavez</surname> <given-names>K</given-names></string-name>, <string-name><surname>Harel</surname> <given-names>O</given-names></string-name> (<year>2024</year>). LearnVizLMM: Learning and Communicating Linear Mixed Models Without Data. R package version 1.0.0.</mixed-citation>
</ref>
<ref id="j_jds1222_ref_025">
<mixed-citation publication-type="book"> <string-name><surname>Zuur</surname> <given-names>AF</given-names></string-name>, <string-name><surname>Ieno</surname> <given-names>EN</given-names></string-name>, <string-name><surname>Walker</surname> <given-names>N</given-names></string-name>, <string-name><surname>Saveliev</surname> <given-names>AA</given-names></string-name>, <string-name><surname>Smith</surname> <given-names>GM</given-names></string-name> (<year>2009</year>). <source><italic>Mixed Effects Models and Extensions in Ecology with R</italic></source>. <series><italic>Statistics for Biology and Health</italic></series>. <publisher-name>Springer</publisher-name>, <publisher-loc>New York</publisher-loc>.</mixed-citation>
</ref>
</ref-list>
</back>
</article>
