UK-based online statistics and data analysis support for USA, UK, and international clients. No exams, no impersonation, no fabricated data.
Regression Tests and Models

Moderated Mediation: Formula, Interpretation, SPSS, Python, R and Excel Guide

Conditional indirect effects across studytime Moderated Mediation: Formula, Interpretation, SPSS, Python, R and Excel Guide Moderated Mediation asks whether an indirect pathway changes across levels of...

Statistics guide Ethical learning support SPSS/R/Python/Excel friendly
Moderated Mediation: Formula, Interpretation, SPSS, Python, R and Excel Guide
Conditional indirect effects across studytime

Moderated Mediation: Formula, Interpretation, SPSS, Python, R and Excel Guide

Moderated Mediation asks whether an indirect pathway changes across levels of a moderator. This worked analysis follows G1 through G2 to G3 and tests whether studytime changes the G2-to-G3 path.

649 studentsG1 → G2 → G3Index = −0.03908 Python + 8 R charts

Model Overview

What this model is and when it is used: Moderated Mediation combines mediation and moderation in one conditional-process model. It is used when a predictor affects an outcome through a mediator and the strength of one path depends on a moderator. Here, G1 is X, G2 is M, G3 is Y and studytime is W. The mediator model estimates G2 from G1 and covariates. The outcome model estimates G3 from G1, G2, studytime, the G2 × studytime interaction and covariates. The central quantity is the bootstrap index of Moderated Mediation. For broader foundations, see Generalized Linear Model, Main Effects vs Interaction Effects and Simple Effects Analysis.

AdvertisementGoogle AdSense top placement reserved here

Quick Answer

Sample size649
Outcome-model R²0.8518
Moderated-mediation index−0.0390
Bootstrap interval−0.0750 to −0.0065

Mediation pathway

  • G1 → G2: 0.8860, p < .001
  • G2 → G3 at mean W: 0.8840, p < .001
  • Direct G1 → G3: 0.1473, p < .001

Conditional indirect effect

  • Low studytime: 0.8156
  • Mean studytime: 0.7832
  • High studytime: 0.7508
Overall interpretation: G1 strongly predicts G2, and G2 strongly predicts G3. The indirect pathway remains positive at every studytime level but becomes slightly weaker as studytime rises.
Magnitude warning: the moderated-mediation index is statistically supported but small. The three conditional indirect effects remain close and all are strongly positive.

Table of Contents

  1. Why this analysis needs Moderated Mediation
  2. How the conditional process works
  3. Variables used
  4. Results at a glance
  5. Eight chart stories
  6. R charts and explanations
  7. Complete path results
  8. Conditional indirect effects
  9. Diagnostics and model choice
  10. SPSS, Python, R and Excel
  11. Code
  12. Advanced interpretation
  13. APA-style reporting
  14. Publication checklist
  15. Downloads
  16. Related guides
  17. FAQs

Why This Analysis Needs Moderated Mediation

Strong mediation pathG1 predicts G2 with a = 0.8860.
Conditional b pathG2 × studytime = −0.0441.
Bootstrap supportThe index interval excludes zero.

A standard mediation model would assume that the G2-to-G3 path is constant for all students. The interaction term tests that assumption directly. Because the interaction is negative and significant, the indirect effect is evaluated conditionally rather than represented by one universal number. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

A standard moderation model would test only whether one direct slope changes. Moderated Mediation instead connects that interaction to the indirect G1 → G2 → G3 mechanism. This distinction is related to main effects and interaction effects and the difference between correlation and regression.

Best-use situation: use Moderated Mediation when theory predicts both a mediating process and a boundary condition that changes one path in that process.

How the Moderated Mediation Model Works

Step 1a path

Estimate G2 from G1 and covariates.

Step 2Conditional b path

Estimate G3 from G2, studytime and G2 × studytime.

Step 3Conditional indirect effect

Multiply a by the moderator-specific b path.

M = iₘ + aX + ΣγC + eₘ
Y = iᵧ + c′X + bM + dW + q(M × W) + ΣδC + eᵧ
Conditional indirect effect = a × (b + qW)

The index of Moderated Mediation equals a × q. Here, 0.8860 × −0.0441 ≈ −0.0390. The negative value means the mediated effect becomes smaller as centered studytime increases.

Centering changes the interpretation of the lower-order coefficients but does not change fitted values. The mean moderator level is studytime = 1.9307, with ±1 SD values of approximately 1.1012 and 2.7602. See Simple Effects Analysis for conditional-slope logic.

Variables Used and Coding

VariableRoleDefinitionModel use
G1Predictor XFirst-period gradePredicts G2 and directly predicts G3
G2Mediator MSecond-period gradeTransmits the G1 effect to G3
G3Outcome YFinal gradeDependent variable
studytimeModerator WWeekly study-time category, 1–4Moderates the G2-to-G3 path
G2 × studytimeInteractionProduct of centered G2 and centered studytimeTests second-stage moderation
failuresCovariatePrior class failuresIncluded in both equations
absencesCovariateSchool absencesIncluded in both equations
ageCovariateAge in yearsIncluded in both equations
Medu, FeduCovariatesParental educationIncluded in both equations
Coding rule: G1, G2 and studytime are mean-centered before the interaction is calculated. The conditional effects must be interpreted at stated studytime values.

Results at a Glance

Mediator-model R²0.7573

F(6,642)=333.81

Outcome-model R²0.8518

F(9,639)=408.05

Total-effect R²0.6953

RMSE=1.7818

Interaction coefficient−0.0441

p=.0370

Index−0.0390

95% CI excludes zero

Outcome RMSE1.2428

Adjusted R²=.8497

Cross-software conclusion: Python and R agree that G1 strongly predicts G2, G2 strongly predicts G3, and studytime slightly weakens the mediator-to-outcome path.

Download the PDF Outputs

Open the complete software reports for coefficient tables, bootstrap results and diagnostics. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Model fit should be interpreted with adjusted R-squared, effect size and the distinction between statistical and practical importance.

Eight Chart Stories: What Each Figure Actually Means

Each chart is interpreted in four stages: what is visible, the exact values, what is actually happening in the data, and the practical conclusion. This avoids merely repeating labels, coefficients or percentages. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Chart 1: Outcome Distribution for G3

Moderated Mediation outcome distribution for G3
G3 values concentrate around the middle-to-upper grade range, with a small group of zero scores.
What the chart shows

The histogram displays the frequency distribution of final grade G3 before the path models are fitted. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Exact values

Across 649 students, G3 has mean 11.9060, SD 3.2307, and range 0–19. The largest concentration lies approximately between 10 and 16. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

What Is Actually Happening

Most students finish with moderate or high final grades, but a small separate group receives zero. The central mass is fairly compact, while the zero-grade cases create an unusually long lower tail that the linear outcome model must handle. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Practical Conclusion

Interpret model fit for the majority grade range and separately inspect the zero-grade cases, because they can create large negative residuals and influence the estimated paths. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 2: Mediator Path from G1 to G2

Moderated Mediation mediator path from G1 to G2
G2 rises strongly as G1 rises, forming the a path of the indirect effect.
What the chart shows

The scatterplot shows G1 on the horizontal axis and mediator G2 on the vertical axis, with the fitted mediator-model line. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Exact values

The adjusted a path is 0.8860, SE 0.0231, p < .001, 95% CI [0.8407, 0.9313]. The mediator model explains 75.73% of G2 variance. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

What Is Actually Happening

Students who perform one point better in the first period usually perform almost one point better in the second period, even after failures, absences, age and parental education are controlled. This strong continuity in grades creates a large mediation pathway. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Practical Conclusion

The indirect effect is driven first by this very strong G1-to-G2 link. Check whether G1 and G2 measure sufficiently distinct time points and report their strong overlap when interpreting mediation. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 3: Outcome-Model Path Coefficients

Moderated Mediation outcome model path coefficients
The mediator coefficient dominates the outcome model, while the interaction is small and negative.
What the chart shows

The bars compare the direct G1 effect, the G2 mediator effect, the studytime main effect and the G2-by-studytime interaction. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Exact values

Direct G1 = 0.1473, G2 = 0.8840, studytime = 0.1084, and G2 × studytime = −0.0441.

What Is Actually Happening

Second-period grade is by far the strongest immediate predictor of final grade. G1 still contributes directly, but most of its relationship with G3 operates through G2. The negative interaction means the G2-to-G3 slope becomes slightly weaker as studytime increases. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Practical Conclusion

Describe G2 as the dominant pathway, the direct G1 path as smaller but still present, and the moderation as statistically detectable but modest in size. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 4: Moderation of the G2-to-G3 Path

Moderated Mediation interaction lines for G2 and studytime
The mediator-to-outcome lines are all positive but become slightly flatter at higher studytime.
What the chart shows

Three fitted lines show the relationship between centered G2 and predicted G3 at low, mean and high studytime. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Exact values

The conditional G2 slopes are 0.9205 at low studytime, 0.8840 at mean studytime and 0.8474 at high studytime. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

What Is Actually Happening

Higher G2 predicts higher G3 at every studytime level. The lines are close together, so studytime does not reverse the relationship; it slightly compresses it. At lower G2 values, higher studytime partly offsets weaker grades, whereas at higher G2 values the low-studytime line becomes marginally steeper. This Moderated Mediation interpretation applies to the stated variables, coding and covariate adjustment.

Practical Conclusion

Report a small weakening of the mediator-to-outcome path as studytime rises, not a disappearance of mediation. Avoid presenting the interaction as a large educational difference.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 5: Conditional Indirect Effects

Moderated Mediation conditional indirect effects with bootstrap confidence intervals
The indirect effect remains positive at low, mean and high studytime, but gradually declines.
What the chart shows

The forest plot shows the estimated G1 → G2 → G3 indirect effect at three studytime levels with bootstrap 95% confidence intervals.

Exact values

Indirect effects are 0.8156 at low studytime, 0.7832 at the mean and 0.7508 at high studytime. All intervals remain above zero.

What Is Actually Happening

G1 affects G3 through G2 for students at every studytime level. The mediated pathway is strongest at lower studytime and weakest at higher studytime, but the decline is gradual and the indirect effect remains substantial throughout.

Practical Conclusion

State that mediation is present across the observed moderator range and that studytime changes its magnitude rather than determining whether mediation exists.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 6: Bootstrap Distribution of the Moderated-Mediation Index

Bootstrap distribution of Moderated Mediation index
The bootstrap distribution is concentrated below zero, supporting a negative moderated-mediation index.
What the chart shows

The histogram shows 1,000 bootstrap estimates of the index of moderated mediation, with zero marked as the null value.

Exact values

The index is −0.0390. The Python percentile 95% CI is [−0.0750, −0.0065]; the R interval is approximately [−0.0740, −0.0049].

What Is Actually Happening

Across repeated resamples, the estimated change in the indirect effect is usually negative. The distribution does not merely fluctuate around zero; it consistently indicates that the G1-to-G3 indirect pathway becomes smaller as studytime increases.

Practical Conclusion

Use the bootstrap interval, not only the interaction p-value, as the primary evidence for moderated mediation. The effect is supported statistically but is small in magnitude.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 7: Observed Versus Predicted G3

Observed versus predicted G3 for Moderated Mediation
Most observations follow the agreement line, while zero-grade cases fall far below it.
What the chart shows

The scatterplot compares observed G3 with values predicted by the full outcome model.

Exact values

The outcome model has R² = 0.8518, adjusted R² 0.8497 and RMSE 1.2428. Most predictions lie within the 5–19 grade range.

What Is Actually Happening

The model reproduces the central and upper grade pattern very closely, which reflects the strong G1 and G2 information. Its largest failures occur for students with observed G3 = 0, because their predictor profiles often resemble students with mid-range predicted grades.

Practical Conclusion

The model is accurate for most students but not for the special zero-grade subgroup. Investigate whether zero grades represent dropout, missing assessment or a distinct process requiring separate modelling.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

Chart 8: Outcome-Model Residuals

Moderated Mediation outcome model residuals
Residuals form discrete diagonal bands and contain several large negative outliers.
What the chart shows

Residuals are plotted against predicted G3 to examine linear-model error patterns.

Exact values

SPSS residuals range from approximately −8.954 to 5.740, with SD about 1.240. Several residuals below −6 occur around predicted grades 6–10.

What Is Actually Happening

Most prediction errors cluster near zero, but the zero-grade students create severe overprediction and a long negative tail. The diagonal bands arise because observed grades are discrete integers, not because the model necessarily has a curved mean relationship.

Practical Conclusion

Inspect influential zero-grade cases, use robust sensitivity analyses and report that residual normality is imperfect even though overall prediction is strong.

Cross-software check: Python and R reproduce the same substantive pattern, coefficient direction and inferential conclusion.

R Charts: Two Charts Followed by Two Matching Explanation Boxes

Each R pair is followed by explanation boxes that describe the substantive process represented by the chart rather than simply repeating its values.

R validation: The index remains negative, all three conditional indirect effects remain positive, and the outcome model explains about 85.18% of G3 variance.
R chart pair 1
R Moderated Mediation outcome distribution for G3
R validation of outcome distribution for g3.
R Moderated Mediation mediator path from G1 to G2
R validation of mediator path from g1 to g2.
What Is Actually Happening

R Chart 1: Outcome Distribution for G3

Most students finish with moderate or high final grades, but a small separate group receives zero. The central mass is fairly compact, while the zero-grade cases create an unusually long lower tail that the linear outcome model must handle.

Practical conclusion: Interpret model fit for the majority grade range and separately inspect the zero-grade cases, because they can create large negative residuals and influence the estimated paths.
What Is Actually Happening

R Chart 2: Mediator Path from G1 to G2

Students who perform one point better in the first period usually perform almost one point better in the second period, even after failures, absences, age and parental education are controlled. This strong continuity in grades creates a large mediation pathway.

Practical conclusion: The indirect effect is driven first by this very strong G1-to-G2 link. Check whether G1 and G2 measure sufficiently distinct time points and report their strong overlap when interpreting mediation.
R chart pair 2
R Moderated Mediation outcome model path coefficients
R validation of outcome-model path coefficients.
R Moderated Mediation interaction lines for G2 and studytime
R validation of moderation of the g2-to-g3 path.
What Is Actually Happening

R Chart 3: Outcome-Model Path Coefficients

Second-period grade is by far the strongest immediate predictor of final grade. G1 still contributes directly, but most of its relationship with G3 operates through G2. The negative interaction means the G2-to-G3 slope becomes slightly weaker as studytime increases.

Practical conclusion: Describe G2 as the dominant pathway, the direct G1 path as smaller but still present, and the moderation as statistically detectable but modest in size.
What Is Actually Happening

R Chart 4: Moderation of the G2-to-G3 Path

Higher G2 predicts higher G3 at every studytime level. The lines are close together, so studytime does not reverse the relationship; it slightly compresses it. At lower G2 values, higher studytime partly offsets weaker grades, whereas at higher G2 values the low-studytime line becomes marginally steeper.

Practical conclusion: Report a small weakening of the mediator-to-outcome path as studytime rises, not a disappearance of mediation. Avoid presenting the interaction as a large educational difference.
R chart pair 3
R Moderated Mediation conditional indirect effects with bootstrap confidence intervals
R validation of conditional indirect effects.
R Bootstrap distribution of Moderated Mediation index
R validation of bootstrap distribution of the moderated-mediation index.
What Is Actually Happening

R Chart 5: Conditional Indirect Effects

G1 affects G3 through G2 for students at every studytime level. The mediated pathway is strongest at lower studytime and weakest at higher studytime, but the decline is gradual and the indirect effect remains substantial throughout.

Practical conclusion: State that mediation is present across the observed moderator range and that studytime changes its magnitude rather than determining whether mediation exists.
What Is Actually Happening

R Chart 6: Bootstrap Distribution of the Moderated-Mediation Index

Across repeated resamples, the estimated change in the indirect effect is usually negative. The distribution does not merely fluctuate around zero; it consistently indicates that the G1-to-G3 indirect pathway becomes smaller as studytime increases.

Practical conclusion: Use the bootstrap interval, not only the interaction p-value, as the primary evidence for moderated mediation. The effect is supported statistically but is small in magnitude.
R chart pair 4
R Observed versus predicted G3 for Moderated Mediation
R validation of observed versus predicted g3.
R Moderated Mediation outcome model residuals
R validation of outcome-model residuals.
What Is Actually Happening

R Chart 7: Observed Versus Predicted G3

The model reproduces the central and upper grade pattern very closely, which reflects the strong G1 and G2 information. Its largest failures occur for students with observed G3 = 0, because their predictor profiles often resemble students with mid-range predicted grades.

Practical conclusion: The model is accurate for most students but not for the special zero-grade subgroup. Investigate whether zero grades represent dropout, missing assessment or a distinct process requiring separate modelling.
What Is Actually Happening

R Chart 8: Outcome-Model Residuals

Most prediction errors cluster near zero, but the zero-grade students create severe overprediction and a long negative tail. The diagonal bands arise because observed grades are discrete integers, not because the model necessarily has a curved mean relationship.

Practical conclusion: Inspect influential zero-grade cases, use robust sensitivity analyses and report that residual normality is imperfect even though overall prediction is strong.

Open the complete Moderated Mediation R report PDF

Complete Moderated Mediation Path Results

Mediator model: G2 from G1 and covariates

TermBSEp95% CIInterpretation
G1 centered0.88600.0231<.0010.8407–0.9313Strong positive a path
failures−0.38680.1081.0004−0.5991 to −0.1745More failures predict lower G2
absences−0.00200.0125.8760−0.0265–0.0226Not significant
age0.16640.0496.00080.0689–0.2638Positive adjusted association
Medu0.06740.0664.3105−0.0630–0.1979Not significant
Fedu0.05830.0681.3916−0.0753–0.1920Not significant

Outcome model: G3 from G1, G2, studytime and interaction

TermBSEp95% CIInterpretation
G1 centered0.14730.0366.00010.0753–0.2192Positive direct effect
G2 centered0.88400.0343<.0010.8167–0.9513Strong mediator-to-outcome path
studytime centered0.10840.0622.0819−0.0137–0.2305Main effect not significant
G2 × studytime−0.04410.0211.0370−0.0855 to −0.0027G2 slope weakens as studytime rises
failures−0.22300.0952.0194−0.4099 to −0.0361Negative adjusted association
absences0.02150.0109.04860.0001–0.0430Small positive coefficient
Interpretation rule: the interaction changes the G2 slope. The studytime main effect is the effect of studytime when centered G2 equals zero, not a universal studytime effect.

Use the P-Value and Confidence Interval guides when explaining uncertainty.

Conditional Indirect Effects and Practical Prediction

Indirect(W) = 0.8860 × [0.8840 − 0.0441W]

What remains stable

  • G1 strongly predicts G2.
  • G2 strongly predicts G3.
  • The indirect effect remains positive across studytime.

What changes

  • The G2-to-G3 slope declines slightly.
  • The indirect effect falls from 0.8156 to 0.7508.
  • The change is statistically supported but modest.

For two students who differ by one G1 point but have comparable covariates, the expected G3 difference transmitted through G2 is about 0.816 at low studytime and 0.751 at high studytime. This is a model-based conditional association, not a guaranteed individual change.

Prediction warning: conditional indirect effects are not individual predicted grades. They describe how an expected pathway changes across moderator values.

Diagnostics and Model Choice

Path-model diagnostics

  • Review linearity in both equations
  • Check G1–G2 collinearity
  • Inspect residual and influence diagnostics
  • Verify bootstrap stability

Observed limitations

  • Zero-grade cases create large negative residuals
  • Condition index reaches 52.52 in the expanded SPSS model
  • The interaction effect is small
  • Cross-sectional causality remains limited

Use Variance Inflation Factor, Tolerance Statistic, Cook’s Distance, Studentized Residuals and Influence Diagnostics to assess model stability. This Moderated Mediation interpretation should be evaluated with the complete model specification and reported uncertainty.

Residual plots should be interpreted with the discrete 0–19 grade scale. The visible diagonal bands are expected when integer outcomes are regressed on continuous fitted values, but the extreme zero-grade residuals require separate investigation.

Model choice: retain Moderated Mediation when the conditional indirect effect is the research target. Use ordinary mediation when no path is moderated and moderated regression when only a direct predictor slope is conditional.

SPSS, Python, R and Excel Workflows

Python

Fits the mediator and outcome OLS equations, calculates conditional indirect effects and bootstraps the index.

  • 1,000 completed bootstrap samples
  • Eight diagnostic charts
  • Path and model-fit tables

Open the Python report PDF

R

Reproduces the same centered equations and percentile-bootstrap conditional effects.

  • Index CI approximately −0.0740 to −0.0049
  • Outcome R²=0.8518
  • Independent chart validation

Open the R report PDF

SPSS

Uses centered variables, product terms and multiple regression equations with saved predictions and residuals.

  • Expanded covariate diagnostics
  • Outcome R²≈.853
  • Observed versus predicted and residual plots

Open the SPSS output PDF

Excel

Can calculate centered variables, path-based conditional effects and a bootstrap-results summary after coefficients are estimated.

  • Center X, M and W
  • Calculate M × W
  • Evaluate a × (b + qW)

Code: Expand Only the Software You Need

Python Moderated Mediation code
import numpy as np
import pandas as pd
import statsmodels.api as sm

df = pd.read_csv("dataset.csv")
for v in ["G1", "G2", "studytime"]:
    df[v + "_c"] = df[v] - df[v].mean()

df["M_x_W"] = df["G2_c"] * df["studytime_c"]

covars = ["failures", "absences", "age", "Medu", "Fedu"]
X_m = sm.add_constant(df[["G1_c"] + covars])
model_m = sm.OLS(df["G2"], X_m).fit()

X_y = sm.add_constant(
    df[["G1_c", "G2_c", "studytime_c", "M_x_W"] + covars]
)
model_y = sm.OLS(df["G3"], X_y).fit()

a = model_m.params["G1_c"]
b = model_y.params["G2_c"]
q = model_y.params["M_x_W"]
index = a * q

for w in [-df["studytime"].std(), 0, df["studytime"].std()]:
    print(w, a * (b + q * w))
R Moderated Mediation code
df <- read.csv("dataset.csv")
df$G1_c <- df$G1 - mean(df$G1)
df$G2_c <- df$G2 - mean(df$G2)
df$studytime_c <- df$studytime - mean(df$studytime)
df$M_x_W <- df$G2_c * df$studytime_c

m_model <- lm(
  G2 ~ G1_c + failures + absences + age + Medu + Fedu,
  data = df
)

y_model <- lm(
  G3 ~ G1_c + G2_c + studytime_c + M_x_W +
    failures + absences + age + Medu + Fedu,
  data = df
)

a <- coef(m_model)["G1_c"]
b <- coef(y_model)["G2_c"]
q <- coef(y_model)["M_x_W"]
index <- a * q
SPSS Moderated Mediation syntax
DESCRIPTIVES VARIABLES=G1 G2 studytime /SAVE.
COMPUTE G1_c = G1 - 11.3990755.
COMPUTE G2_c = G2 - 11.5701079.
COMPUTE studytime_c = studytime - 1.9306626.
COMPUTE M_x_W = G2_c * studytime_c.
EXECUTE.

REGRESSION
 /DEPENDENT G2
 /METHOD=ENTER G1_c failures absences age Medu Fedu
 /STATISTICS COEFF OUTS CI(95).

REGRESSION
 /DEPENDENT G3
 /METHOD=ENTER G1_c G2_c studytime_c M_x_W
               failures absences age Medu Fedu
 /STATISTICS COEFF OUTS CI(95) COLLIN
 /SAVE PRED RESID.
Excel Moderated Mediation formulas
Centered G1       = G1 - AVERAGE(G1_range)
Centered G2       = G2 - AVERAGE(G2_range)
Centered W        = studytime - AVERAGE(studytime_range)
Interaction       = Centered_G2 * Centered_W
Conditional b     = b_G2 + b_interaction * Centered_W
Indirect effect   = a_path * Conditional_b
Index             = a_path * b_interaction

Advanced Interpretation and Extensions

First-stage versus second-stage moderated mediation

In this model, studytime moderates the second-stage M-to-Y path rather than the G1-to-G2 path. A first-stage model would instead include an X-by-W term in the mediator equation. Compare structures before estimation and justify the moderated path theoretically. See main effects versus interaction effects. This Moderated Mediation interpretation should be evaluated with the complete model specification and reported uncertainty.

Index of moderated mediation

The index equals the a path multiplied by the interaction coefficient. Its bootstrap interval directly tests whether the indirect effect changes with the moderator. The estimated index is −0.0390, indicating a small decline per one-unit increase in centered studytime. Interpret the interval using the confidence interval guide.

Conditional indirect effects

Conditional indirect effects are not separate mediation models. They are evaluations of the same fitted equations at selected moderator values. Low, mean and high studytime produce 0.8156, 0.7832 and 0.7508.

Mean centering

Centering changes the zero point of G1, G2 and studytime, making lower-order coefficients meaningful at the sample mean. Centering does not remove multicollinearity caused by substantive overlap.

Product-term interpretation

The interaction coefficient is the change in the G2 slope for a one-unit increase in centered studytime. Because the coefficient is negative, the mediator-to-outcome slope becomes slightly flatter.

Direct, indirect and total effects

The total effect of G1 on G3 is 0.9339. The direct effect after G2 enters is 0.1473. The difference is represented by the conditional indirect pathway, whose size varies by studytime.

Partial versus complete mediation

The direct effect remains significant, so the model shows partial mediation rather than complete mediation. Complete mediation should never be declared solely because one p-value crosses .05.

Bootstrap percentile intervals

Percentile bootstrap intervals use empirical quantiles of resampled effects. They are especially useful because indirect-effect distributions are often asymmetric and poorly approximated by a normal distribution.

Bias-corrected bootstrap intervals

Bias-corrected intervals adjust for median bias and skewness. They may differ from simple percentile intervals, especially with small samples or highly asymmetric effects.

Number of bootstrap samples

One thousand bootstrap samples provide a usable estimate, but 5,000 or more are commonly preferred for publication when computationally feasible because tail quantiles become more stable.

Johnson-Neyman analysis

A Johnson-Neyman analysis can identify moderator regions where the M-to-Y slope or indirect effect is statistically distinguishable from zero. This extends the three-point evaluation used in simple effects analysis.

Categorical moderators

A categorical moderator requires dummy or effect coding. Conditional indirect effects are then compared across meaningful groups rather than at ±1 SD.

Multiple moderators

Multiple moderators create additional interaction terms and more complex conditional effects. Theory should determine which path each moderator changes.

Multiple mediators

Multiple mediators can be modelled in parallel when each transmits a distinct mechanism. Shared variance among mediators must be interpreted carefully.

Serial mediation

Serial mediation represents a chain such as G1 → study behaviour → G2 → G3. Temporal and causal ordering must be justified before such a model is interpreted.

Parallel mediation

Parallel mediation estimates several indirect pathways simultaneously without imposing an order among mediators.

Moderated direct effects

A moderator can also alter the direct X-to-Y effect. That requires an X-by-W term in the outcome equation in addition to any moderated mediator path.

Covariate selection

Covariates should be chosen because they address a defined confounding or precision question, not because they happen to be available. Unnecessary controls can change the estimand and reduce interpretability.

Temporal ordering

Mediation implies a process over time, yet cross-sectional data do not establish temporal precedence. The grade sequence G1, G2 and G3 provides some ordering, but causal claims still require stronger assumptions.

Measurement error

Measurement error in G1, G2 or studytime can attenuate paths and distort interaction estimates. Latent-variable moderated mediation can address measurement models directly.

Multicollinearity

G1 and G2 are strongly related, so review variance inflation factor and tolerance statistics. A high condition index in SPSS may partly reflect the intercept and centered grade structure.

Heteroskedasticity

Use the Breusch-Pagan test and residual plots to evaluate unequal variance. Bootstrap inference protects the indirect effect more than it protects every coefficient estimate.

Influential observations

Large negative residuals from zero-grade cases may influence the outcome equation. Review Cook’s distance and influence diagnostics before deleting any case.

Power for conditional indirect effects

Power depends on the product of the a path and the moderated b-path change. Small interaction effects often require large samples. Plan simulations and consult statistical power rather than relying on a simple events-per-variable rule.

Causal interpretation

Moderated mediation estimates conditional associations unless treatment assignment, temporal order, no-unmeasured-confounding assumptions and correct model specification support causal interpretation.

Cross-validation and replication

Replication should evaluate the index, conditional indirect effects and calibration of the outcome equation in another cohort. Resampling within one dataset cannot establish transportability.

APA-Style Reporting

APA example: A second-stage Moderated Mediation analysis tested whether G1 predicted G3 indirectly through G2 and whether studytime moderated the G2-to-G3 path. G1 significantly predicted G2, B = 0.886, SE = 0.023, p < .001. In the outcome model, G2 predicted G3, B = 0.884, SE = 0.034, p < .001, and the G2 × studytime interaction was significant, B = −0.044, SE = 0.021, p = .037. The index of Moderated Mediation was −0.039, bootstrap 95% CI [−0.075, −0.007].

The conditional indirect effects were 0.816 at low studytime, 0.783 at mean studytime and 0.751 at high studytime; all bootstrap intervals excluded zero. The direct G1 effect remained significant, B = 0.147, SE = 0.037, p < .001. The outcome model explained 85.18% of G3 variance. This Moderated Mediation interpretation should be evaluated with the complete model specification and reported uncertainty.

Report exact p-values, confidence intervals, the moderator values and the bootstrap method. Avoid saying that studytime causes the indirect effect to weaken unless the causal assumptions are defensible.

Publication Checklist and Common Mistakes

Include in the final report

  • X, M, W and Y definitions
  • Centered-variable method
  • Mediator and outcome equations
  • a, b, c′ and interaction paths
  • Conditional indirect effects
  • Bootstrap index and CI
  • Model fit and residual diagnostics

Avoid these errors

  • Calling one interaction a complete conditional process
  • Reporting only low, mean and high effects without the index
  • Interpreting the moderator main effect as moderation
  • Claiming causation from cross-sectional regressions
  • Ignoring influential zero-grade cases
  • Equating significance with a large effect

Review the Null and Alternative Hypothesis, Type I and Type II Error and Statistical Power guides when planning replication.

Downloads

Frequently Asked Questions

What is Moderated Mediation?
Moderated Mediation occurs when the size of an indirect effect changes across levels of a moderator.
What is the index of moderated mediation?
It is a single coefficient that quantifies how the indirect effect changes with the moderator. A bootstrap interval excluding zero supports moderation of the indirect pathway.
Which path is moderated here?
Studytime moderates the G2-to-G3 path, so this is a second-stage Moderated Mediation model.
What are X, M, W and Y?
X is G1, M is G2, W is studytime and Y is G3.
Is the indirect effect significant at all studytime levels?
Yes. The low, mean and high bootstrap intervals all remain above zero.
Does higher studytime eliminate mediation?
No. The indirect effect declines from about 0.816 to 0.751 but remains substantial.
Why is the interaction negative?
The positive G2-to-G3 slope becomes slightly weaker as studytime rises.
Is the moderator main effect significant?
The studytime main effect is not significant at .05, but the interaction is. A main effect is not required for moderation.
What does the direct effect mean?
It is the adjusted G1-to-G3 relationship after G2, studytime, the interaction and covariates are controlled.
Why use bootstrap confidence intervals?
Indirect effects are products of coefficients and often have asymmetric sampling distributions.
How many bootstrap samples were used?
The Python and R analyses completed 1,000 bootstrap samples.
Can Moderated Mediation prove causation?
No. Causal claims require temporal ordering and strong no-confounding assumptions beyond regression adjustment.
What is the difference from moderated regression?
Moderated regression tests whether one direct slope changes. Moderated Mediation tests whether an indirect pathway changes.
Why center the variables?
Centering makes lower-order coefficients interpretable at average moderator values and simplifies interaction plots.
How should the zero-grade cases be handled?
They should be checked for substantive meaning and influence; they should not be removed automatically.
How is Moderated Mediation reported?
Report all path coefficients, the interaction, conditional indirect effects, the bootstrap index and confidence intervals.

Final Moderated Mediation Conclusion

The analysis supports a strong G1 → G2 → G3 indirect pathway and a small negative moderation of the G2-to-G3 segment by studytime. The indirect effect remains positive and statistically supported at low, mean and high studytime.

The practical message is not that studytime removes the value of prior achievement. Instead, the transmission of G1 through G2 is slightly less steep at higher studytime. The index is statistically reliable, but the conditional effects remain close in magnitude.

Final decision: Moderated Mediation is supported because the bootstrap interval for the index excludes zero, while the substantive size of the moderation should be described as modest.
AdvertisementGoogle AdSense bottom placement reserved here

Back to top

Need help applying this to your own data?

Salar Cafe can help interpret output, clean datasets, review assumptions, build dashboards and explain statistical results ethically.

Need help interpreting your data analysis results?

Contact Salar Cafe
Engr. Muhammad Yar Saqib author profile photo

Engr. Muhammad Yar Saqib

WhatsApp Get Data Analysis Help