help for mlmoderator

Title

mlmoderator -- Probing, diagnosing, and visualizing cross-level interactions in multilevel models

Description

mlmoderator is a package providing a unified workflow for probing,
plotting, and assessing the robustness of two-way cross-level interaction
effects in mixed-effects models fitted with Stata's mixed command.

The package integrates several post-estimation procedures that are commonly
needed when interpreting cross-level interactions in hierarchical and
longitudinal data settings.

Commands

Command

mlmcenter Grand-mean, group-mean, and within-between centering

mlmprobe Simple slopes at selected moderator values

mlmjn Johnson-Neyman interval (analytical exact solution)

mlmplot Publication-ready interaction plot with confidence bands

mlmsummary Consolidated moderation results report

mlmvdecomp Decompose slope variance into fixed vs. random components

mlmsens ICC-shift robustness and leave-one-cluster-out diagnostics

Typical workflow

Step 1: Center variables before modeling.

. mlmcenter ses, by(school) method(groupmean)

Step 2: Fit the multilevel model using mixed.

. mixed math c.ses_c##c.climate_c gender || school:ses_c, reml cov(un)

Step 3: Probe simple slopes.

. mlmprobe, pred(ses_c) modx(climate_c)

Step 4: Compute the Johnson-Neyman interval.

. mlmjn, pred(ses_c) modx(climate_c)

Step 5: Plot the interaction.

. mlmplot, pred(ses_c) modx(climate_c)

Step 6: Summarize all moderation results.

. mlmsummary, pred(ses_c) modx(climate_c)

Step 7: Decompose variance in the slope.

. mlmvdecomp, pred(ses_c)

Step 8: Assess robustness.

. mlmsens, pred(ses_c) modx(climate_c)

Requirements

Stata 14.1 or later. All commands require mixed to have been run
immediately beforehand; they read the stored estimation results.

Installation

To install from GitHub:

. net install mlmoderator, from("https://raw.githubusercontent.com/causalfragility-lab/mlmoderator-Stata/main/") replace

The package is also available from SSC:

. ssc install mlmoderator, replace

Author

Subir Hait, Department of Counseling, Educational Psychology, and Special Education,
Michigan State University.

ORCID: 0009-0004-9871-9677

Bug reports and suggestions: https://github.com/causalfragility-lab/mlmoderator-Stata/issues

Also see

mixed, mlmcenter, mlmprobe, mlmjn,
mlmplot, mlmsummary, mlmvdecomp, mlmsens