Overview
mlmr is an open-source Shiny app and R toolkit for
fitting, understanding, and reporting mixed-effects and multilevel
models in R. It is designed for researchers who want a guided modeling
workflow while keeping the underlying R code visible and
reproducible.
The app is built around four practical goals:
- specify a model without hiding the formula;
- make centering and random-effects choices explicit;
- show equations, variance components, and Tau matrix structure;
- export tables, code, LaTeX, and Quarto-ready reports.
Install the Development Version
install.packages("remotes")
remotes::install_github("MarcusHarrisUConn/mlmr")Then load the package:
Launch the App
mlmr::run_mlmr()The app opens with a built-in HSB-style example so users can test the full workflow before uploading their own data.
Uploaded data can be provided as CSV, TSV/TXT, Excel, SPSS, SAS, or
Stata files. Excel support uses the optional readxl
package, and SPSS/SAS/Stata support uses the optional haven
package.
How the Interface Is Organized
The app uses a small number of main tabs so users can move from data to model results without losing the thread of the analysis.
- Data is for selecting the built-in example, uploading files, checking missingness, and reviewing variable roles.
- Model is for declaring the outcome, grouping factors, predictor levels, centering choices, interactions, and random-effects structure.
- Estimate is for fitting or refitting the model and reviewing model readiness before estimation.
- Results is for model summaries, APA-style tables, equations, diagnostics, and comparison tools.
- Report & Code is for reproducible R code, raw LaTeX, and report exports.
The public documentation site includes screenshots of these screens:
https://marcusharrisphd.com/mlmr/
The current supported-models scope is documented in:
mlmr::mlm_supported_models()For a longer discussion, see:
vignette("supported-models", package = "mlmr")Recommended First Workflow
- Open the app.
- Keep the example dataset selected on the Data tab.
- Review grouping factors and variable roles.
- Move to Model and inspect the preset outcome, predictors, centering, and random-effects choices.
- Click Fit Example Model from Data > Overview, or move to Estimate and click Fit Example Model.
- Open Results to review the dashboard, APA tables, equations, interpretation, diagnostics, and model comparison panels.
- Open Report & Code to export reproducible R code, raw LaTeX, APA tables, or a Quarto-ready report.
What the Example Demonstrates
The built-in example includes a student outcome, student-level predictors, school-level predictors, categorical predictors, interactions, and random effects. It is intentionally more complex than a minimal random-intercept model so users can see why mixed-effects and multilevel models are useful.
The example currently demonstrates:
- cluster-mean centering for lower-level predictors;
- grand-mean centering for contextual predictors;
- dummy coding for categorical predictors;
- random intercepts and random slopes;
- fixed interactions and cross-level interaction-style terms;
- APA-style tables;
- level-by-level equations and combined equations;
- Tau variance-covariance matrix display.
Reproducibility
Every model fit in mlmr is paired with reproducible
code. The Report & Code tab exports the analysis
code and the raw LaTeX used for tables and equations.
The long-term goal is that users can move from the graphical workflow to a scripted R workflow without losing any modeling decisions.
PDF Manual and Help Pages
Like other R packages, mlmr has function help pages that
can be viewed with:
?run_mlmr
help(package = "mlmr")CRAN automatically creates a PDF reference manual from those help pages after a package is accepted. During beta development, the pkgdown website and vignettes are the main user-facing manuals because they explain the workflow in context.