Mediating Variable In Statistics

A mediating variable explains how or why an independent variable causes an outcome variable. It sits in the causal pathway between the independent and outcome variables, transmitting the effect.

mediator variable
Mediating variable explains the process through which an independent variable exerts its effect on a dependent variable.

Mediation analysis

Mediation analysis is a statistical method used to understand the mechanisms by which an independent variable (IV) influences a dependent variable (DV) through a mediator variable (M).

By including the mediator in the analysis, we gain a deeper understanding of the causal chain of events.

Mediation analysis helps researchers understand why or how an effect occurs, moving beyond simply documenting the relationship between variables to explaining the causal pathways involved.

The independent variable causes the mediator, which, in turn, causes the dependent variable.

This creates an indirect effect from the independent variable to the outcome variable that goes through the mediator.

Conditions for Mediation:

  • Significant Relationship between IV and DV: There needs to be a significant direct relationship between the IV and the DV that can be potentially mediated.
  • Significant Relationship between IV and M: The IV must significantly predict the mediator variable.
  • Significant Relationship between M and DV: The mediator variable must significantly predict the DV (when controlling for the IV).
  • Diminished Direct Effect: The strength of the direct effect (relationship between IV and DV) should be reduced when the mediator is included in the model.
    • Full Mediation: The direct effect becomes non-significant after adding the mediator.
    • Partial Mediation: The direct effect remains significant but is weakened after adding the mediator.

When a mediating variable (M) is introduced to explain the relationship between an independent variable (IV) and a dependent variable (DV), there are two possible outcomes: full mediation or partial mediation.

mediation variable
  • Path a: the relationship between the independent variable and the mediator.
  • Path b: the relationship between the mediator and the dependent variable, while controlling for the independent variable.
  • Path c: the total effect of the independent variable on the dependent variable, without considering the mediator.
  • Path c’: the direct effect of the independent variable on the dependent variable, after controlling for the mediator.

Full Mediation

Complete mediation, also referred to as full mediation or total mediation, occurs when the relationship between an independent variable and a dependent variable is fully explained by a mediating variable

full mediation 1

In simpler terms, the IV no longer has a direct effect on the DV; its influence is entirely channeled through the mediator.

Statistically, this is indicated by the direct path (c’) becoming non-significant (p > .05) after the mediator is included in the regression model.

Complete mediation provides strong evidence for a single, dominant mediator in the relationship.

It suggests that the mediator is a crucial component in the causal chain linking the independent variable to the outcome.

Partial Mediation

Partial Mediation occurs when the mediator explains some, but not all, of the relationship.

partial mediation

This means that the independent variable still has a direct effect on the outcome, but this effect is weaker than it was before considering the mediator variable.

Statistically, partial mediation is indicated by a significant direct path (c’) that is smaller in magnitude than the original relationship (c) between the IV and DV .

Partial mediation indicates that other factors, besides the mediator, contribute to the relationship between the IV and DV.

Why are mediating variables important?

  • Improve interventions: Mediation analysis allows researchers to move beyond simply asking “Does this intervention work?” to delve into the “how” and “why” behind its effects.
  • Explain unexpected results: When an intervention or treatment fails to produce a significant effect on the intended outcome, mediation analysis can shed light on why the intervention was unsuccessful.
  • Help build and refine theory: Testing mediation hypotheses can provide support for or against the theories that interventions are based on.

Many health conditions are the result of intricate interactions between multiple factors.

Mediation analysis can disentangle these relationships and help determine the relative contribution of each factor to the outcome.

For example, a researcher might be interested in the relationship between stress (independent variable) and depression (dependent variable).

They hypothesize that negative thoughts might be a mediating variable.

The idea is that stress leads to an increase in negative thoughts, and those negative thoughts lead to an increase in depressive symptoms.

By understanding the mediating mechanisms, interventions can be designed to specifically target those factors that are most critical in the development of a health condition.

This leads to more focused and potentially more effective interventions, rather than taking a one-size-fits-all approach.

For example, research show a link between social support and better outcomes for cancer patients.

Mediation analysis can explore whether this relationship is explained by factors like improved adherence to treatment, reduced stress levels, or better coping strategies.

How do I test for mediating variables?

To test for mediating variables, you need to follow a structured statistical approach using regression analysis.

This process involves demonstrating the mediator’s role in explaining the relationship between the independent variable (IV) and the dependent variable (DV).

Each step in the analysis should be statistically significant:

1. Establish the Baseline Relationship:

  • Goal: Before examining whether an indirect pathway through a mediator exists, you must first establish that there is a direct relationship between the IV and the DV. This step serves as the foundation for your mediation analysis.
  • Method: Regress the DV on the IV alone. This is a simple bivariate regression where the IV is the predictor and the DV is the outcome.
  • Interpretation: If this initial regression shows a statistically significant relationship between the IV and the DV, it confirms that there’s an effect to mediate. Without this initial relationship, there’s no need to proceed with testing for mediation.

In SPSS, go to Analyze > Regression > Linear.

  1. In the “Linear Regression” dialog box, specify your dependent variable in the “Dependent” box and your independent variable in the “Independent(s)” box.
  2. Click “OK” to run the analysis.
  3. The output will show the results of a simple linear regression.
  4. If the significance value (p-value) is less than .05, it indicates a significant relationship, which is necessary to proceed with testing for mediation.

2. Test for IV-Mediator Relationship:

  • Goal: This step aims to confirm that the IV has a causal effect on the proposed mediator. This is a crucial part of establishing the causal chain of mediation.
  • Method: Regress the proposed mediator on the IV. Again, this is a bivariate regression with the IV as the predictor and the mediator as the outcome.
  • Interpretation: A statistically significant relationship in this regression suggests that the IV does indeed influence or predict the mediator, supporting the first part of the proposed mediation pathway.

In SPSS, go to Analyze > Regression > Linear.

  1. In the “Linear Regression” dialog box, specify the proposed mediator in the “Dependent” box and your independent variable in the “Independent(s)” box.
  2. Click “OK” to run the analysis.
  3. Examine the “Coefficients” table in the output.
  4. A statistically significant relationship between the IV and the mediator is indicated by a p-value less than .05 for the independent variable’s coefficient.
  5. This finding supports the first part of the hypothesized mediation pathway, where the IV is expected to influence the mediator.

3. Test for Mediator-DV Relationship, Controlling for IV:

  • Goal: This is the core step in mediation analysis. You examine whether the mediator significantly predicts the DV while accounting for the IV’s influence. This helps determine if the mediator explains the relationship between the IV and the DV.
  • Method: Perform a multiple regression analysis where the DV is regressed on both the IV and the mediator simultaneously. This allows you to isolate the unique effects of each predictor while controlling for the other.
  • Interpretation: Two conditions must be met for mediation to be supported:
    • The mediator should be a significant predictor of the DV. This demonstrates that the mediator has a direct effect on the outcome, fulfilling the second part of the mediation pathway.
    • The direct effect of the IV on the DV should be reduced compared to the direct effect observed in the second step. This reduction in the direct effect suggests that the mediator accounts for some of the IV’s influence on the DV.

In SPSS, go to Analyze > Regression > Linear in SPSS.

  1. Enter the dependent variable in the “Dependent” box.
  2. Place both the independent variable and the mediator in the “Independent(s)” box.
  3. Click “OK” to run the analysis.
  4. The output will contain a “Coefficients” table that requires careful examination:
  5. The p-value for the mediator’s coefficient should be less than .05 to indicate that the mediator significantly predicts the dependent variable even after controlling for the independent variable’s influence. This supports the second part of the mediation pathway, showing a direct effect from the mediator to the DV.
  6. Compare the independent variable’s coefficient in this model to the coefficient obtained in Step 1. If the coefficient is smaller in Step 3 and the p-value is now larger (especially if it’s greater than .05), it suggests that the mediator is explaining part of the relationship between the IV and the DV. This reduction in the direct effect of the IV is key evidence for the presence of mediation.

4. Assess Significance of Mediation:

  • Goal: This final step aims to statistically confirm the significance of the mediated effect, providing a measure of confidence in your findings. The method employed depends on your sample size:
    • Sobel Test (for larger samples, n > 400): The Sobel test directly tests the statistical significance of the mediated effect, calculated as the product of paths ‘a’ and ‘b’. A significant Sobel test result indicates statistically significant mediation.
    • Bootstrapping (for smaller samples): Bootstrapping is a resampling technique that creates a distribution of the mediated effect by repeatedly resampling the data. It’s considered a more robust method for smaller samples, providing confidence intervals for the mediated effect.

In SPSS, go to Analyze > Regression > Linear.

  1. Go to the “Linear Regression” dialog box used in Step 3.
  2. Click the “Bootstrap” button.
  3. Select “Perform bootstrapping.”
  4. Choose a suitable number of bootstrap samples (e.g., 1000 or more).
  5. Under “Confidence Intervals,” select “Bias corrected and accelerated (BCa).
  6. Click “Continue” and then “OK” to run the analysis.
  7. The output will include a table labeled “Bootstrap for Indirect Effects.”
  8. Focus on the confidence interval for the indirect effect of the independent variable on the dependent variable through the mediator. If the confidence interval does not include zero, it indicates that the mediated effect is statistically significant.

Olivia Guy-Evans, MSc

BSc (Hons) Psychology, MSc Psychology of Education

Associate Editor for Simply Psychology

Olivia Guy-Evans is a writer and associate editor for Simply Psychology. She has previously worked in healthcare and educational sectors.


Saul McLeod, PhD

Editor-in-Chief for Simply Psychology

BSc (Hons) Psychology, MRes, PhD, University of Manchester

Saul McLeod, PhD., is a qualified psychology teacher with over 18 years of experience in further and higher education. He has been published in peer-reviewed journals, including the Journal of Clinical Psychology.

h4 { font-weight: bold; } h1 { font-size: 40px; } h5 { font-weight: bold; } .mv-ad-box * { display: none !important; } .content-unmask .mv-ad-box { display:none; } #printfriendly { line-height: 1.7; } #printfriendly #pf-title { font-size: 40px; }