Why Calculate the Risks Directly?
Interventional mediation effects compare outcome risks under interventions that set exposure and draw the mediator from a specified distribution. With a binary mediator, each such risk is a weighted average of two conditional outcome risks: the risk when the mediator is 0 and the risk when it is 1. Writing out those two weights makes the estimand concrete and provides a direct check on the arithmetic.
The calculations below use hypothetical data. They illustrate how to move from a table of conditional risks and mediator probabilities to marginal interventional risks, and then to direct, indirect, and total effects. The effects are risk differences, so their units are absolute differences in risk, often reported in percentage points.
Set Up the Interventional Risks
Let \(A\) be a binary exposure, \(M\) a binary mediator, and \(Y\) a binary outcome. Let \(L\) denote baseline covariates, measured before exposure. For \(a\) equal to 0 or 1, define the mediator probability \(g_a(m\mid l)=P(M=m\mid A=a,L=l)\), and define the conditional outcome risk \(Q(a,m,l)=P(Y=1\mid A=a,M=m,L=l)\).
An interventional outcome mean \(\mu(a,a^*)\) refers to setting exposure to \(a\) and, within each baseline stratum \(L=l\), drawing the mediator from its distribution under exposure level \(a^*\). The mediator draw is stochastic: it uses the distribution \(g_{a^*}(m\mid l)\), rather than setting every person’s mediator to a single value.
A causal interpretation requires that the quantities in this formula are identified from the data. In particular, the analysis must adequately control baseline confounding of exposure and outcome, exposure and mediator, and mediator and outcome; satisfy consistency; and have positivity for the exposure and mediator levels needed in the calculation. These conditions support interpreting the identified conditional risks and mediator distributions causally. The arithmetic itself cannot repair confounding, lack of support, or misspecified estimates.
For a common additive decomposition, use the mediator distribution under \(A=0\) as the reference for the direct effect, then change the mediator distribution to that under \(A=1\) while holding exposure at 1:
Thus the interventional direct effect (IDE) compares exposure levels while keeping the mediator distribution fixed at its level under \(A=0\). The interventional indirect effect (IIE) compares mediator distributions under \(A=1\) and \(A=0\), with exposure fixed at 1. These reference choices define this particular decomposition; the direct and indirect effects need not have the same numerical values under a different reference choice.
Hand Calculation Without Baseline Covariates
When there are no baseline covariates, or when the table already gives quantities standardized to the target population, the expectation over \(L\) disappears. Because \(M\) is binary, the sum has exactly two terms. If \(p_a=P(M=1\mid A=a)\), then \(P(M=0\mid A=a)=1-p_a\), and
Each outcome risk is weighted by the probability of the mediator value used by the intervention. Use the mediator probability indexed by \(a^*\), not automatically the probability indexed by the exposure setting \(a\).
Worked Example: Two Mediator Distributions and Four Outcome Risks
Suppose a hypothetical table gives these mediator probabilities and outcome risks:
| Exposure \(a\) | \(P(M=0\mid A=a)\) | \(P(M=1\mid A=a)\) | \(Q(a,0)\) | \(Q(a,1)\) |
|---|---|---|---|---|
| 0 | 0.80 | 0.20 | 0.10 | 0.30 |
| 1 | 0.40 | 0.60 | 0.20 | 0.50 |
First calculate \(\mu(0,0)\), using the outcome risks at exposure 0 and the mediator distribution under exposure 0:
Next calculate \(\mu(1,0)\). The outcome risks are now those at exposure 1, but the weights remain the mediator distribution under exposure 0:
Finally, use the mediator distribution under exposure 1 to calculate \(\mu(1,1)\):
The direct effect is \(0.260-0.140=0.120\), or 12.0 percentage points. The indirect effect is \(0.380-0.260=0.120\), also 12.0 percentage points. The total effect is \(0.380-0.140=0.240\), or 24.0 percentage points. These are differences in hypothetical interventional risks, not claims that the observed association alone is causal.
Standardizing Across Baseline Strata
With baseline covariates, calculate the two-term weighted risk separately within each stratum, then average those stratum-specific risks using the target population’s stratum proportions. Do not use the mediator distribution marginally if the intervention is defined conditional on \(L\): the conditional mediator distribution can differ across strata.
Worked Example: Calculating and Averaging Within Two Strata
Suppose \(L\) has two strata, with target-population proportions 0.60 for \(L=0\) and 0.40 for \(L=1\). The following hypothetical table gives the mediator probabilities and outcome risks within each stratum. The \(Q\) columns list the risks at mediator values 0 and 1, respectively.
| \(L\) | Weight | \(P(M=1\mid A=0,L)\) | \(P(M=1\mid A=1,L)\) | \(Q(0,0,L)\) | \(Q(0,1,L)\) | \(Q(1,0,L)\) | \(Q(1,1,L)\) |
|---|---|---|---|---|---|---|---|
| 0 | 0.60 | 0.10 | 0.50 | 0.05 | 0.25 | 0.10 | 0.40 |
| 1 | 0.40 | 0.40 | 0.70 | 0.20 | 0.50 | 0.25 | 0.60 |
For \(L=0\), the mediator probabilities under exposure 0 are 0.90 at \(M=0\) and 0.10 at \(M=1\). Therefore,
For \(\mu(1,1\mid L=0)\), use the mediator probabilities under exposure 1, 0.50 at each mediator value:
For \(L=1\), the probabilities of \(M=0\) under exposure 0 and exposure 1 are 0.60 and 0.30, respectively. The corresponding stratum-specific risks are
Now standardize each risk using the target weights. For example,
The direct effect is \(0.234-0.170=0.064\), or 6.4 percentage points. The indirect effect is \(0.348-0.234=0.114\), or 11.4 percentage points. The total effect is \(0.348-0.170=0.178\), or 17.8 percentage points. Each standardized risk uses the same target distribution of \(L\), which is necessary for these contrasts to compare like with like.
Why the Additive Decomposition Holds
The decomposition follows from adding and subtracting the same interventional mean. This is an arithmetic identity, not an additional causal assumption. For any consistently defined \(\mu(a,a^*)\),
The intermediate risk \(\mu(1,0)\) cancels. The same identity holds after standardization over \(L\), because each \(\mu\) is already a scalar average over the same target population. A mismatch in target population, mediator reference distribution, or contrast definition can break the intended interpretation even if subtraction is performed correctly.
Worked Example: A Direct Arithmetic Check
Consider a third hypothetical table with no baseline covariates. Let \(P(M=1\mid A=0)=0.30\), \(P(M=1\mid A=1)=0.70\), and let the outcome risks be \(Q(0,0)=0.10\), \(Q(0,1)=0.20\), \(Q(1,0)=0.15\), and \(Q(1,1)=0.65\).
The mediator distribution under exposure 0 assigns probabilities 0.70 and 0.30 to \(M=0\) and \(M=1\). Thus,
Under exposure 1, the mediator probabilities are 0.30 and 0.70, so
Therefore the IDE is \(0.300-0.130=0.170\), the IIE is \(0.500-0.300=0.200\), and their sum is \(0.370\). The total effect is independently calculated as \(0.500-0.130=0.370\). The equality confirms the decomposition; it does not establish that the table’s inputs are causally identified.
Common Mistakes and Practical Checks
The most frequent error is to use the mediator probabilities from the wrong exposure level. In \(\mu(1,0)\), exposure is set to 1 for the outcome-risk terms, but the mediator is drawn from the distribution under exposure 0. Using \(P(M\mid A=1)\) there would calculate \(\mu(1,1)\), not \(\mu(1,0)\).
A second error is to treat the mediator probability as the outcome risk. The probability \(P(M=1\mid A=a,L=l)\) is a weight; it is not \(P(Y=1\mid A=a,M=1,L=l)\). The latter is a conditional outcome risk. Keep these quantities distinct in the table and in the multiplication.
A third error is to calculate the direct effect as a difference between risks conditional on one mediator value, or the indirect effect as a change in mediator prevalence alone. The defined effects compare marginal interventional outcome risks. Both mediator values contribute to each risk, and the outcome risks at both mediator values determine how changing the mediator distribution affects the outcome.
Useful checks are: confirm that the two mediator probabilities in every stratum sum to 1; confirm that every calculated interventional risk lies between 0 and 1; use the same baseline-stratum weights for all interventional means; and verify that \(\text{IDE}+\text{IIE}=\text{TE}\). These checks catch arithmetic and indexing errors, but they do not replace the identification assumptions.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- If \(P(M=1\mid A=0)=0.25\), what probability weights \(M=0\) and \(M=1\) in \(\mu(1,0)\)? Which exposure level supplies the outcome risks?
- Suppose \(\mu(0,0)=0.12\), \(\mu(1,0)=0.19\), and \(\mu(1,1)=0.31\). Calculate the IDE, IIE, and TE, and check the decomposition.
- Why must the same target-population weights for \(L\) be used when standardizing all three interventional means?
- In a stratum, the mediator probability under exposure 1 is 0.65. What is the probability of mediator value 0 under that exposure?
- Does an exact additive decomposition show that the conditional risks and mediator distributions are free from confounding? Explain briefly.