moderation
Test whether an effect depends on a moderator by fitting a mean-centered interaction model, reporting R² change from the interaction, and giving simple slopes at -1 SD/mean/+1 SD.
Instructions
Moderation analysis: does the effect of X on Y depend on W? Fits the interaction model with mean-centred predictors, reports the R-squared change contributed by the interaction, and gives simple slopes at -1 SD / mean / +1 SD of a continuous moderator (or within each level of a categorical one), plus an interaction plot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Predictor column. | |
| y | Yes | Outcome column. | |
| data | Yes | Dataset name in the session. | |
| plots | No | Include an interaction plot. | |
| center | No | Mean-centre the continuous predictors before fitting. | |
| digits | No | Decimal places. | |
| save_as | No | Name for the fitted model in the session. | |
| moderator | Yes | Moderator column. | |
| covariates | No | Columns to control for. | |
| simple_slopes | No | Report simple slopes. |