Skip to contents

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:

For a longer discussion, see:

vignette("supported-models", package = "mlmr")
  1. Open the app.
  2. Keep the example dataset selected on the Data tab.
  3. Review grouping factors and variable roles.
  4. Move to Model and inspect the preset outcome, predictors, centering, and random-effects choices.
  5. Click Fit Example Model from Data > Overview, or move to Estimate and click Fit Example Model.
  6. Open Results to review the dashboard, APA tables, equations, interpretation, diagnostics, and model comparison panels.
  7. 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.

Current Status

mlmr is in early development. The current version is suitable for testing, teaching, and feedback, but it should not yet be treated as a final statistical package for production research without independent verification of the fitted model and diagnostics.