Structural equation

Moderation Analysis

Tests whether the link between a predictor and an outcome strengthens or weakens across the levels of a third variable, and reports the link separately at those levels.

Method summary

Moderation analysis takes up one question: is the link between two variables the same for everybody, or does it shift with the level of a third variable? The association between workload and burnout, for instance, may be weaker among people who perceive strong support from their manager. The question is answered by adding a term built from the product of the predictor and the moderator; the coefficient on that product says how much the predictor's slope changes for each one-unit rise in the moderator. In the panel, the predictor and the moderator are both brought to a mean of zero before the product is formed, so that the main effects in the table are read at the moderator's average rather than at a scale value of zero. From there the model is an ordinary least squares fit: the intercept, the predictor, the moderator and the interaction are estimated as four rows. The method also works out the predictor's slope at three levels of the moderator separately, because a significant interaction on its own does not say at which level the link is strong.

Which research questions does it answer?

  • Does the association between workload and burnout weaken among employees who perceive strong managerial support?
  • Does the effect of price perception on purchase intention shrink as brand loyalty rises?
  • Does the link between screen time and sleep quality differ by age?
  • Does the contribution of service satisfaction to recommendation intention change with how long the customer has been with us?

When should you use it?

  • When the research question asks for whom the strength of a link changes, that is, when the phrase 'for which people' or 'under which condition' is part of the question.
  • When the variable acting as moderator is measured numerically; for a categorical moderator, group-based approaches answer more directly.
  • When predictor, moderator and outcome all come from the same respondent and the same measurement, so that the three columns are aligned in one dataset.
  • When at least 10 complete cases are present; the engine refuses the run below that. Interaction terms are tested with less power than main effects, so far larger samples are needed in practice.
  • When the outcome is measured continuously; the model is fitted by least squares and does not suit binary or count outcomes.

Required variable types

  • Outcome: a single numeric column measured continuously (a scale score, a duration, an amount, a percentage).
  • Predictor: a single numeric column. This is the variable whose effect is being tested for dependence on the moderator.
  • Moderator: a single numeric column. A two-category variable coded 0 and 1 can be supplied, in which case the simple slopes approximate the slopes within the two groups; a variable with three or more categories does not suit this form.
  • The parameter form accepts exactly one predictor, one moderator and one outcome. There is no field for control variables, so no covariate can enter the model.
  • One row per participant; a row with a missing value on any of the three columns drops out of the analysis.

Key assumptions

The interaction term built correctly
When the product is formed from raw values, the main effects describe slopes at the zero point of each scale. On a five-point item no respondent answers zero, which leaves those figures uninterpretable. Centring removes the problem and makes the main effects readable as slopes at the average.
A continuous outcome and linear associations
The model assumes that at every level of the moderator the link between predictor and outcome can be described by a straight line. A curved pattern can leak into the interaction term and give the impression of moderation where there is none.
Independent residuals with constant spread
The standard errors rest on residuals being independent of one another and spread about equally across predicted values. If the spread widens at one end of the moderator, the p value for the interaction becomes biased.
Enough cases across the range of the moderator
Simple slopes are computed one standard deviation below and above the moderator's mean. Where the moderator is skewed, one of those points can fall in a region barely observed in the data, and the slope there owes more to the model than to the cases.
Interaction term not heavily overlapping its components
Because the product is derived from the two variables that form it, some overlap among the three predictors is unavoidable. Centring reduces it appreciably but does not eliminate it when the moderator is skewed.

How YouReply checks these assumptions

  • The interaction term built correctly: The engine subtracts the mean from both the predictor and the moderator on every run, before the product is formed. The behaviour cannot be switched off, so the coefficients in the table are always reported on the centred scale.
  • A continuous outcome and linear associations: The panel does not inspect the shape of any association, adds no quadratic term and issues no warning about curvature. That judgement is left to the researcher.
  • Independent residuals with constant spread: No residual diagnostics are computed for this method: there is no serial dependence statistic, no heteroscedasticity test, and the residuals themselves are not returned. The check is entirely yours, and no robust standard error option is offered.
  • Enough cases across the range of the moderator: The engine returns the simple slopes together with the standard deviation it used, but it does not report how many cases sit near those points and raises no warning about the moderator's distribution.
  • Interaction term not heavily overlapping its components: No measure of redundancy is returned: VIF, tolerance and condition indices are absent from this method's output. Standard errors larger than expected can be a symptom, but the panel never flags it.

How the analysis is run

  1. 1Drop the CSV or XLSX file holding all three columns onto the upload area, with one participant per row.
  2. 2On the Data tab confirm that the three columns are read as numbers, and declare missing value codes on the Variable tab. An undeclared code shifts both the mean and the standard deviation and so corrupts the simple slopes.
  3. 3If you plan to use a scale total, build it as a derived column on the Variable tab. The method works with existing columns and will not compute a score from a set of items.
  4. 4On the Analysis tab open the structural equation category or type the method name into the search box. The data requirements box shows which of your columns qualify for each of the three roles, and methods that do not fit stay in the list, dimmed, with the reason stated.
  5. 5In the parameter form pick one column each for the outcome, the predictor and the moderator. The significance level field arrives at 0.05, and that value only sets the threshold for the flag reporting whether the interaction counts as significant.
  6. 6Start the run. No chart is drawn for this method; the result arrives as collapsible sections holding the coefficient table, the interaction block and the simple slopes table.
  7. 7Download the tables as Excel. The computation credits card names the library call and its version, and the run stays on the History tab. The free plan allows 50 runs per month.

Statistics and tables produced

Coefficient table
Four rows: the intercept, the centred predictor, the centred moderator and the interaction. Each row carries a coefficient, a standard error, a t value and a p value.
Interaction estimate and p value
The coefficient on the product term and its significance value, repeated in a block of their own. The coefficient states, in the units of the outcome, how much the predictor's slope changes per one-unit rise in the moderator.
Significance flag
A true or false answer to the question of whether the interaction's p value falls below the significance level you entered. Since you set the threshold, the flag is a shortcut for a comparison rather than a finding of its own.
R squared and adjusted R squared
How much of the variance in the outcome the model with the interaction accounts for, and the same quantity penalised for the number of predictors. How much R squared rose when the interaction was added is not returned separately.
Simple slopes
The predictor's slope one standard deviation below the moderator's mean, at the mean, and one standard deviation above. These three figures make the direction of the interaction concrete and are the main material for the write-up.
Standard deviation used
The standard deviation of the moderator on which the three evaluation points rest. Without reporting it, the simple slopes cannot be reproduced.

Effect size and confidence intervals

Interaction coefficient
The change in the predictor's slope per one-unit rise in the moderator, in the units of the outcome. Its sign matters: a negative coefficient says the link weakens as the moderator rises, a positive one says it strengthens. Its magnitude always depends on the scales involved, so it cannot be compared directly across studies.
Explained variance and its increment
The output gives R squared and adjusted R squared for the model that includes the interaction. What the interaction contributes to explained variance, the increment between the two models, is not computed here: to see it, fit linear regression on the same columns without the product term and compare the R squared values yourself. With survey data the increment usually lands between 0.01 and 0.03, and being small does not make a moderation unimportant.
Spread between the simple slopes
The distance between the slopes at the low and high ends of the moderator is the most readable expression of how large the moderation is in practice. A slope approaching zero at one end while staying substantial at the other strengthens the case that the link is conditional. The individual significance of these slopes is not tested; only their values are returned.

Nothing in this output carries a confidence interval. The coefficient table holds an estimate, a standard error, a t value and a p value, with no lower or upper bound. For the simple slopes there is neither a standard error nor a p value nor an interval, which means the output contains no test of whether a given slope differs from zero. The Johnson-Neyman region, which identifies the range of the moderator over which the link is significant, is not computed either, and no bootstrapped estimation option is offered. If you need an interval around the interaction coefficient, derive it from the estimate and its standard error in another tool; intervals for the simple slopes cannot be obtained the same way, because the covariance information they require is not returned.

Example research question and example result

The numbers below are a representative example, not data from a real study or a real user.

Research question
Does the association between workload and burnout depend on perceived managerial support? (Illustrative example, not real data.)
Variables
Outcome: burnout score (continuous, 0-100) · Predictor: workload score (continuous, 0-100) · Moderator: perceived managerial support score (continuous, 0-100)
Example result
The model was fitted on 284 complete cases. Intercept 52.4. Centred workload b = 0.46, SE = 0.07, t = 6.57, p < 0.001. Centred managerial support b = -0.31, SE = 0.08, t = -3.88, p < 0.001. Interaction b = -0.042, SE = 0.015, t = -2.80, p = 0.005, with the flag raised at the 0.05 threshold. R squared = 0.34, adjusted R squared = 0.33. The moderator's standard deviation was reported as 8.6. Simple slopes: 0.82 one standard deviation below the mean, 0.46 at the mean, and 0.10 one standard deviation above.
Interpretation
The negative interaction coefficient says the tie between workload and burnout loosens as perceived support rises, and the simple slopes put numbers on that. At the low end of support, each additional point of workload goes with an average rise of 0.82 points in burnout; at the high end the same rise shrinks to 0.10 points, which is close to nothing. The slope at the mean, 0.46, is the same figure as the main effect in the table, and that is exactly what centring buys. Nothing in this output says how much of the 34% of variance explained is owed to the interaction; obtaining that calls for a separate fit without the product term. Because the individual slopes are never tested, a sentence such as 'the association is non-significant among highly supported employees' cannot rest on these figures; what can be said is that the slope becomes markedly smaller. Finally the data are cross-sectional, so support cannot be said to reduce burnout; what is described is that the association differs by level of support.

Real output on a sample dataset

The results below were produced by the analysis engine from this data file. Changing the variable changes the research question as well; every run was computed in advance, so the page sends no request to the engine.

Variable examined

General customer survey (synthetic)

A wide survey of three hundred respondents: two and three category grouping variables, continuous measures, a five point ordinal scale, a binary purchase outcome, a four category brand choice, three repeated measurements, paired binary questions, three raters, four price questions and deliberately empty cells.

Rows
300
Columns
respondent_id, gender, education, region, age, income, satisfaction, service_score, price_score, quality_score, loyalty, nps_score, purchased, brand_choice, satisfaction_level, pre_score, post_score, measure_1, measure_2, measure_3, use_before, use_after, use_followup, rater_1, rater_2, rater_3, price_too_cheap, price_cheap, price_expensive, price_too_expensive, feedback_score, followup_rating
Download the dataset as CSV

The data is synthetic: it comes from a fixed random seed, not from a real study. The values below were produced by the analysis engine from this file, so uploading the same file to the panel gives the same results.

Research question: Does the effect of the service score on loyalty weaken as income rises?

Independent variable (X)
service_score
Dependent variable (Y)
loyalty
Moderator (W)
income
Significance level (alpha)
0.05
Cases analyzed
300
independent
service_score
dependent
loyalty
moderator
income
Standard deviation of the moderator
17.09

Coefficients

Coefficients
RowEstimateStandard errort statisticp value
const5.390.050107.94< 0.001
x0.1530.0503.060.002
w-0.0850.003-28.19< 0.001
xw-0.0070.003-2.400.017

Interaction effect

Estimate
-0.007
p value
0.017
Significant
Yes
R squared
0.747
Adjusted R squared
0.745

Simple slopes

Simple slopes
Moderator levelCentred moderator valueSlope at this level
-1 SD-17.090.275
Mean00.153
+1 SD17.090.031

Computation credits: scipy 1.18.0 · statsmodels 0.14.6 · scikit-learn 1.9.0 · numpy 2.5.1 · pandas 3.0.5 · semopy 2.3.11 · 89fc29a · Data seed: 20260914

How to report the result

The association between workload and burnout varied with perceived managerial support, b = -0.042, SE = 0.015, t = -2.80, p = .005, and the model including the interaction accounted for 34% of the variance (adjusted R squared = .33, n = 284). Simple slopes showed the workload slope at 0.82 at low support, 0.46 at average support and 0.10 at high support (moderator SD = 8.6).

An example sentence close to APA style; the numbers are representative.

When you should not use it

  • No control variable can enter the model. The parameter form takes exactly one predictor, one moderator and one outcome, so partialling out age, tenure or any similar covariate is not possible here.
  • No standard error, p value or interval is returned for the simple slopes; the three figures arrive as estimates only, so the slope at a given level cannot be tested against zero.
  • The Johnson-Neyman region is not computed. The question of the moderator value beyond which the association becomes significant cannot be answered from this output, since slopes are given at three fixed points only.
  • There is no bootstrapping and no robust standard error option. If residual spread is not constant the p values are biased, and no setting corrects for that.
  • The interaction's contribution to explained variance is not returned; the increment requires fitting and comparing a model without the product term.
  • A moderator with three or more categories does not suit this form; coding categories numerically assumes equal spacing between them and makes the result misleading.
  • Where the outcome is binary, ordinal or a count, a least squares model is inappropriate and moderation cannot be tested this way.

What to use when the assumptions are not met

  • Linear Regression (OLS)Why: When you want to build the product term yourself as a derived column and include control variables alongside it; that route allows covariates but leaves the simple slopes for you to compute.
  • Two-Way ANOVAWhy: When the moderator is categorical; the interaction is tested as the joint effect of two factors and group means are compared directly.
  • Mediation AnalysisWhy: When the question is not for whom a link changes but through what it operates; mediation addresses the mechanism, moderation the condition.
  • Structural Equation Modeling (SEM)Why: When latent variables, several predictors and multiple paths are to be estimated in one model, with measurement error taken into account.

Frequently asked questions

Why does centring matter, and does the panel do it for me?
The panel subtracts the mean from both the predictor and the moderator before forming the product, so centring happens on every run and cannot be turned off. The reason is this: in an interaction model built from raw values, the coefficient on the predictor describes its slope at the point where the moderator equals zero. On a support scale running from 0 to 100, zero is either never observed or an extreme value, which leaves that coefficient uninterpretable and its magnitude misleading. After centring, the same coefficient becomes the slope at the moderator's average, a figure you can read straight off the table. Centring also reduces the overlap between the product term and the variables that form it, which leaves the interaction's p value unchanged but shrinks the standard errors on the main effects and makes their interpretation sturdier.
How should I interpret the simple slopes?
The three figures are the predictor's slope at three levels of the moderator: one standard deviation below the mean, at the mean, and one standard deviation above. Each answers the question of how many units the outcome moves per one-unit rise in the predictor while the moderator sits at that level. What carries the interpretation is the trend across the three: a slope that shrinks steadily from one end to the other makes the conditional nature of the link concrete. Two cautions apply. First, these slopes are not tested, so a slope close to zero is not evidence that it fails to differ from zero. Second, the points one standard deviation out need not fall inside the range actually observed; with a skewed moderator one of them can land in a region the data barely covers.
The interaction was not significant. How do I report the model?
A non-significant interaction is reported as a finding that the link looks similar across levels of the moderator, and that is worth stating. The usual next step is to drop the product term, move to linear regression and report the two main effects from there. When you write it up, keep power in mind: interaction terms are tested with appreciably less power than main effects, so a moderation of moderate size can go undetected even with several hundred cases. Rather than concluding that no moderation exists, the accurate phrasing is that none was detected in this sample.
My moderator is categorical. Can I still use this method?
A two-category moderator coded 0 and 1 can be used, and the interaction coefficient then corresponds to the difference between the slopes in the two groups. The simple slopes, however, are still evaluated one standard deviation either side of the mean rather than within the groups, so those three figures do not line up with the group slopes and reporting them becomes roundabout. For a moderator with three or more categories the method is not appropriate: coding the categories 1, 2 and 3 treats the distances between them as equal. In that situation, examining the predictor separately within the groups or fitting a two-factor analysis of variance gives a more direct answer.

References

  • Aiken, L. S., & West, S. G. (1991). Multiple Regression: Testing and Interpreting Interactions
  • Hayes, A. F. (2022). Introduction to Mediation, Moderation, and Conditional Process Analysis
  • Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences
  • statsmodels OLS documentation

Try it with your own data

The free plan includes 50 analysis runs a month and needs no card.