Tutorials › Regression Analysis (Undergraduate) › How Adjusting for a Mediator Changes the Association

Adjusted Associations and Confounding · Tutorial 183 of 991

How Adjusting for a Mediator Changes the Association

Compare regressions with and without a mediator to see how conditioning changes the association being described, and when that difference can support a causal interpretation.

Intermediate 10 min read

What You'll Learn

  • Define a mediator in an exposure-to-outcome pathway.
  • Distinguish an unadjusted exposure coefficient from one conditional on a mediator.
  • Derive the total-slope relationship in a simple linear mediation model.
  • Interpret the units and meaning of coefficients in both regressions.
  • Identify assumptions needed before describing coefficient changes causally.
  • Avoid treating a smaller adjusted coefficient as proof of mediation.

Why the Exposure Coefficient Can Change

Suppose an exposure is related to an outcome partly because it changes another variable that is itself related to the outcome. That intermediate variable is a mediator. A regression that leaves the mediator out describes the exposure–outcome association without conditioning on that intermediate variable. A regression that includes it describes the exposure–outcome association among observations with the same modeled mediator value. These are different questions, so their exposure coefficients need not be the same.

For example, exercise may be associated with blood pressure partly through its relationship with resting heart rate. Comparing a regression of blood pressure on exercise with a regression that also includes resting heart rate can help describe how the association differs when heart rate is held fixed in the model. The comparison alone, however, does not establish that exercise caused the outcome or that the coefficient difference is a causal mediated effect.

Definition: A mediator is a variable that lies on a proposed pathway from an exposure \(X\) to an outcome \(Y\): the exposure is related to the mediator \(M\), and the mediator is related to the outcome. In a causal diagram, this pathway is represented as \(X \to M \to Y\). A regression coefficient for \(X\) that includes \(M\) describes the association between \(X\) and \(Y\) conditional on \(M\); one that omits \(M\) does not condition on it.

Two Regression Models, Two Associations

Consider a quantitative exposure \(X\), mediator \(M\), and outcome \(Y\). A simple linear model without the mediator is

$$ Y = \beta_0 + cX + \varepsilon. $$

Here \(c\) is the modeled change in the mean outcome for a one-unit increase in \(X\), without holding \(M\) fixed. The corresponding model that includes the mediator is

$$ Y = \gamma_0 + c'X + bM + \varepsilon'. $$

In this second model, \(c'\) is the modeled change in the mean outcome for a one-unit increase in \(X\), holding \(M\) fixed. The coefficient \(b\) describes the modeled outcome difference associated with a one-unit difference in \(M\), holding \(X\) fixed. The coefficients have units determined by the variables: for example, outcome points per exposure unit for \(c\), and outcome points per mediator unit for \(b\).

These interpretations assume the linear models adequately represent the conditional means: the mean outcome changes linearly with the predictors, and the model does not omit an interaction that is needed to describe how the association varies across values of \(M\). For standard regression-based inference, further conditions such as independent observations, appropriate error behavior, and constant variance also matter. A coefficient comparison does not itself verify these conditions; they need to be considered using the study design, subject-matter knowledge, and relevant model checks.

If \(M\) lies on a pathway from \(X\) to \(Y\), including it changes the target association by conditioning on a variable that is related to the exposure pathway. The coefficient \(c'\) is not automatically a causal “direct effect.” Causal interpretation additionally requires suitable causal assumptions, including adequate control of confounding for the relationships involved, correct temporal ordering, and a suitable model. Without those assumptions, the coefficients should be reported as conditional and non-conditional associations.

Worked Example: Comparing Two Exposure Coefficients

In a hypothetical sample, researchers model a quiz score (points) using weekly study-group sessions as the exposure and weekly independent-practice hours as a proposed mediator. Suppose the fitted model without the mediator gives an exposure coefficient of 2.5 points per session. The model including the mediator gives an exposure coefficient of 1.0 point per session and a mediator coefficient of 3.0 points per practice hour.

Without the mediator: the modeled mean quiz score is 2.5 points higher per additional weekly study-group session. This is an association that does not hold practice hours fixed.

With the mediator: the modeled mean quiz score is 1.0 point higher per additional weekly study-group session for students with the same modeled number of practice hours. The mediator coefficient says that, at a fixed number of study-group sessions, one additional practice hour is associated with 3.0 more quiz points.

The exposure coefficient is 1.5 points smaller after including practice hours: \(2.5 - 1.0 = 1.5\). This is a numerical difference between two fitted associations, not by itself proof that 1.5 points of a causal effect was mediated. A causal account would require, among other things, that the proposed pathway is correctly specified and that relevant confounding is adequately addressed. The regression summaries alone cannot establish those conditions.

A Linear Decomposition Under Specific Conditions

A useful relationship between the two coefficients can be derived for a simple additive linear model. First model the mediator as a function of the exposure:

$$ M = \alpha_0 + aX + u. $$

Here \(a\) is the modeled change in the mean mediator per one-unit increase in the exposure. Suppose the outcome model including the mediator is

$$ Y = \gamma_0 + c'X + bM + \varepsilon'. $$

Assume these conditional mean relationships are linear and additive, with no \(X\)-by-\(M\) interaction. Also assume \(E(u\mid X)=0\) and \(E(\varepsilon'\mid X,M)=0\). Substituting the mediator equation into the outcome equation gives

$$ \begin{aligned} Y &= \gamma_0 + c'X + b(\alpha_0 + aX + u) + \varepsilon' \\ &= (\gamma_0 + b\alpha_0) + (c' + ab)X + (bu + \varepsilon'). \end{aligned} $$

Because \(E(u\mid X)=0\) and \(E(\varepsilon'\mid X,M)=0\), the combined error term has conditional mean zero given \(X\). Therefore, in this specified population model, the slope in the regression of \(Y\) on \(X\) alone is

$$ c = c' + ab. $$

The product \(ab\) is the part of the linear association represented by the route through \(M\) under these model conditions; \(c'\) is the conditional exposure slope in the model including \(M\). This algebraic decomposition is not a general guarantee that a regression coefficient difference is causal. If the linear/additive models or the stated error conditions do not hold, the relationship need not describe the observed coefficients. Causal interpretations require additional assumptions beyond this algebra.

Worked Example: Calculating the Mediator-Path Component

Consider a hypothetical setting where \(X\) is weekly exercise in hours, \(M\) is resting heart rate in beats per minute, and \(Y\) is systolic blood pressure in mmHg. Suppose the mediator model is \(M = 78 - 1.5X + u\), and the outcome model is \(Y = 90 + 0.8X + 0.6M + \varepsilon'\). Thus \(a=-1.5\) beats per minute per exercise hour, \(c'=0.8\) mmHg per exercise hour, and \(b=0.6\) mmHg per beat per minute.

The product representing the pathway through the mediator is

$$ ab = (-1.5)(0.6) = -0.9 \text{ mmHg per exercise hour}. $$

The total slope implied by the substituted model is

$$ c = c' + ab = 0.8 + (-0.9) = -0.1 \text{ mmHg per exercise hour}. $$

For this model, the conditional association at a fixed resting heart rate is an increase of 0.8 mmHg per additional exercise hour, while the association without conditioning on heart rate is a decrease of 0.1 mmHg per additional exercise hour. Substitution verifies the arithmetic: \(Y=90+0.8X+0.6(78-1.5X)+\varepsilon' = 136.8-0.1X+0.6u+\varepsilon'\). The negative product and positive conditional slope combine to give the negative total slope. These are model-based associations; they have a causal interpretation only if the relevant causal assumptions are also justified.

Interpreting the Conditioning in Practice

The conditional coefficient is not simply the same association with a more complete description. It compares observations differing in exposure while holding the modeled mediator value fixed. That comparison may have a different substantive meaning from the overall exposure association, especially when the mediator itself changes with exposure.

Worked Example: A Conditional Comparison Versus an Overall Comparison

Suppose a hypothetical linear model relates weekly study-group sessions \(X\), independent-practice hours \(M\), and quiz score \(Y\). Let the mediator and outcome models be \(M=2+0.5X\) and \(Y=62+1.0X+3.0M\), respectively. Treat these equations as the specified conditional mean models, with linearity, additivity, and the required mean-zero error conditions assumed.

Compare two and four weekly study-group sessions. The mediator model predicts 3 practice hours at \(X=2\), and 4 practice hours at \(X=4\). Allowing the mediator to take those respective predicted values, the outcome predictions are

$$ \begin{aligned} \widehat{Y}(X=2,M=3) &= 62 + 1.0(2) + 3.0(3) = 73 \text{ points},\\ \widehat{Y}(X=4,M=4) &= 62 + 1.0(4) + 3.0(4) = 78 \text{ points}. \end{aligned} $$

The overall modeled difference is \(78-73=5\) points across two additional sessions, or \(5/2=2.5\) points per session. This agrees with \(c=c'+ab=1.0+(0.5)(3.0)=2.5\) points per session.

Now hold practice hours at 3 for both exposure values. The predictions are \(62+1.0(2)+3.0(3)=73\) points at \(X=2\), and \(62+1.0(4)+3.0(3)=75\) points at \(X=4\). The difference is 2 points across two sessions, or 1.0 point per session, which is the conditional coefficient \(c'\). The two comparisons differ because only the first lets practice hours change with study-group sessions. The example demonstrates model interpretation, not a causal conclusion about actual students.

Common Mistake and Key Takeaway

A common mistake is to say, “The exposure coefficient became smaller after adjustment, so the mediator explains exactly the difference and the remaining coefficient is the direct causal effect.” The first part may describe the fitted coefficients, but the causal conclusion does not follow from that comparison alone. The product \(ab\) has the stated decomposition under specific linear-model conditions; treating it as a causal pathway effect requires additional assumptions. The conditional coefficient \(c'\) is an association at a fixed mediator value unless a causal interpretation has been justified.

Also report the coefficients in context, with units, and state which variables the model conditions on. A change in coefficient is meaningful only in relation to the two distinct comparisons being made. In particular, do not describe a smaller coefficient as evidence of mediation without considering the model, the design, and the assumptions needed for that claim.

Key takeaway: Omitting a mediator gives an exposure association that does not condition on that mediator; including it gives an exposure association conditional on the mediator. In a simple linear additive model, the slopes satisfy \(c=c'+ab\) under stated conditions. That relationship explains a model-based decomposition, but it does not by itself establish causal mediation.

Check Your Understanding

Use the definitions and model relationships above to answer the following questions.

  1. In a regression of an outcome on an exposure and mediator, what does the exposure coefficient describe that differs from the coefficient in a model omitting the mediator?
  2. Suppose \(a=2\) mediator units per exposure unit, \(b=1.5\) outcome units per mediator unit, and \(c'=3\) outcome units per exposure unit. Under the stated linear decomposition, calculate \(ab\) and \(c\), including units.
  3. Why does observing a smaller exposure coefficient after including a mediator not, by itself, prove a causal mediated effect?
  4. In the exercise and heart-rate example, explain why the product \(ab\) is negative.
  5. For a causal interpretation of a conditional exposure coefficient, name one kind of assumption needed beyond fitting the regression models.