| mlm_summary | R Documentation |
Returns a consolidated summary of the moderation effect: the focal interaction coefficient, simple slopes at selected moderator values, and (optionally) the Johnson—Neyman interval. Designed for quick reporting and results sections.
mlm_summary(
model,
pred,
modx,
modx.values = c("mean-sd", "quartiles", "tertiles", "custom"),
at = NULL,
conf.level = 0.95,
jn = TRUE,
alpha = 0.05
)
model |
An |
pred |
Character scalar. Focal predictor name. |
modx |
Character scalar. Moderator name. |
modx.values |
Moderator value strategy. See |
at |
Optional numeric vector of custom moderator values. |
conf.level |
Confidence level. Default |
jn |
Logical. Include Johnson-Neyman region? Default |
alpha |
Alpha for JN interval. Default |
An object of class mlm_summary (a list) with components:
interaction: one-row data frame for the interaction term.
simple_slopes: data frame from mlm_probe().
jn: output of mlm_jn() (or NULL if jn = FALSE).
Other metadata.
set.seed(1)
dat <- data.frame(
y = rnorm(200), x = rnorm(200),
m = rep(rnorm(20), each = 10),
grp = factor(rep(1:20, each = 10))
)
dat$y <- dat$y + dat$x * dat$m
mod <- lme4::lmer(y ~ x * m + (1 | grp), data = dat,
control = lme4::lmerControl(optimizer = "bobyqa"))
mlm_summary(mod, pred = "x", modx = "m")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.