Tutorials › Causal Inference › Worked Path-Specific Effects in a DAG

Mediation and Path-Specific Effects · Tutorial 799 of 972

Worked Path-Specific Effects in a DAG

See how to set treatment values separately along causal pathways, calculate the resulting path-specific contrast, and state the assumptions that justify it.

Advanced 10 min read

What You'll Learn

  • Define a path-specific contrast for a target path through a mediator.
  • Assign treatment values to the edges entering a target mediator and a competing pathway.
  • Calculate edge-intervention means and their contrast from a DAG.
  • Interpret how treatment-mediator interaction changes path-specific effects.
  • Standardize a path-specific contrast over baseline covariates.
  • State the assumptions needed to identify the contrast from observed data.

Why Assign Treatment Separately to Different Paths?

Treatment may affect an outcome through more than one route. For example, a program could change a biological mediator that affects health, while also changing access to care through a different pathway. A total treatment effect combines these routes. A path-specific effect instead asks what would happen if treatment were changed along one selected route while its value along a competing route were held fixed.

The key operation is an edge intervention: treatment values are assigned to particular arrows leaving treatment, rather than assigning one treatment value everywhere. This is a counterfactual contrast, not a comparison of regression coefficients. Its interpretation depends on which paths are selected and which treatment value is assigned to the other paths.

A DAG and Its Edge Assignments

Consider a simple directed acyclic graph with binary treatment \(A\), target mediator \(M\), competing-pathway variable \(L\), and outcome \(Y\). The arrows are \(A\to M\), \(A\to L\), \(M\to Y\), and \(L\to Y\). There is no direct arrow from \(A\) to \(Y\), and there are no arrows between \(M\) and \(L\). The two treatment-to-outcome routes are \(A\to M\to Y\) and \(A\to L\to Y\).

Definition: Let \(M(a)\) denote the value of \(M\) when the treatment input on the edge \(A\to M\) is set to \(a\), and let \(L(b)\) denote the value of \(L\) when the treatment input on \(A\to L\) is set to \(b\). Define \(\psi(a,b)=E[Y\{M(a),L(b)\}]\) as the mean outcome when the treatment value along the edge to \(M\) is \(a\), while the value along the edge to \(L\) is \(b\). The contrast \(\psi(1,b)-\psi(0,b)\) is the effect through the target path \(A\to M\to Y\), evaluated while the competing path is held at \(b\).

For example, \(\psi(1,0)-\psi(0,0)\) changes treatment only along the target path, with the competing path held at its control value. In contrast, \(\psi(1,1)-\psi(0,1)\) changes the target path while the competing path is held at its treated value. These are distinct estimands when the outcome response to \(M\) depends on \(L\).

This definition uses a mixed assignment: the two arrows leaving \(A\) can receive different values. It does not describe a treatment that a person literally received. It defines a counterfactual intervention on the causal mechanisms represented by the DAG.

Identification Formula for the Parallel-Path DAG

Write \(\mu(m,l,c)=E[Y\mid M=m,L=l,C=c]\), where \(C\) denotes measured baseline covariates; the simple graph above is the special case with no \(C\). Under the assumptions below, the edge-intervention mean is identified by

$$ \psi(a,b)=\sum_c\sum_m\sum_l \mu(m,l,c)\,P(M=m\mid A=a,C=c)\,P(L=l\mid A=b,C=c)\,P(C=c). $$

For continuous variables, the corresponding sums are integrals. The formula averages the outcome response over the mediator distribution under treatment value \(a\), the competing-pathway distribution under value \(b\), and the baseline covariate distribution in the target population.

The formula requires more than observing an association between each variable and the outcome. For this graph, sufficient assumptions include consistency; no unmeasured confounding of treatment with the mediators or outcome conditional on \(C\); no unmeasured confounding of either mediator-outcome relation conditional on \(A,C\) and the other mediator; and positivity for the treatment and mediator values used in the formula. The graph also has to represent the causal structure: in particular, there must not be an unaccounted-for common cause of \(M\) and \(L\).

For the mixed counterfactual, the factorization into separate \(M\) and \(L\) distributions also relies on an appropriate cross-world condition. One sufficient structural formulation is that the mediator mechanisms have independent errors conditional on \(C\), with no shared unmeasured causes linking their counterfactual values. This is not guaranteed by an observed-data regression or by randomizing \(A\). If that condition or the other assumptions fail, the displayed expression need not identify the path-specific mean.

Worked Calculation With Two Binary Pathways

Worked Example: The Target Path With the Competing Path Held Treated

Suppose a hypothetical study has no baseline covariates, and its causal structure is the parallel-path DAG just described. The mediator and competing-pathway distributions are:

  • \(P(M=1\mid A=0)=0.20\), and \(P(M=1\mid A=1)=0.70\).
  • \(P(L=1\mid A=0)=0.30\), and \(P(L=1\mid A=1)=0.60\).

Assume the hypothetical outcome response is \(\mu(m,l)=10+4m+6l+3ml\), measured in points. Assume the identification conditions stated above hold, including the condition that permits the separate mediator distributions to be combined under a mixed edge assignment. The outcome model includes an interaction: the change associated with \(M\) can differ according to \(L\).

For binary \(M,L\), averaging this outcome response over independent mediator distributions with \(P(M=1)=p\) and \(P(L=1)=q\) gives \(10+4p+6q+3pq\). To evaluate the target path with the competing path held treated, use \(q=0.60\) for both means. First, with the target-path edge set to 1, \(p=0.70\):

$$ \psi(1,1)=10+4(0.70)+6(0.60)+3(0.70)(0.60) =10+2.80+3.60+1.26=17.66\text{ points}. $$

Next, set the target-path edge to 0, so \(p=0.20\), while still holding the competing-path edge at 1:

$$ \psi(0,1)=10+4(0.20)+6(0.60)+3(0.20)(0.60) =10+0.80+3.60+0.36=14.76\text{ points}. $$

The target path-specific contrast at the treated competing-path value is therefore \(17.66-14.76=2.90\) points. Under the assumptions, this is the mean change in the counterfactual outcome from switching the treatment input to the \(A\to M\) edge from 0 to 1 while leaving the input to \(A\to L\) at 1. It is not the total treatment effect.

Why the Reference Value Matters When Paths Interact

A path-specific contrast is defined relative to the treatment values assigned to the other paths. In the example, the interaction term \(3ml\) means that the effect through \(M\) depends on the value assigned along the \(L\) path. The same formula gives all four edge-intervention means:

Worked Example: Comparing the Two Reference Values

Use the distributions and outcome response from the preceding example. For \(\psi(0,0)\), use \(p=0.20,q=0.30\); for \(\psi(1,0)\), use \(p=0.70,q=0.30\). For the two means with \(b=1\), use \(q=0.60\).

$$ \begin{aligned} \psi(0,0)&=10+4(0.20)+6(0.30)+3(0.20)(0.30)=12.78,\\ \psi(1,0)&=10+4(0.70)+6(0.30)+3(0.70)(0.30)=15.23,\\ \psi(0,1)&=14.76,\qquad \psi(1,1)=17.66. \end{aligned} $$

With the competing path held at 0, the target-path contrast is \(\psi(1,0)-\psi(0,0)=15.23-12.78=2.45\) points. With the competing path held at 1, it is \(\psi(1,1)-\psi(0,1)=17.66-14.76=2.90\) points. The difference arises from the interaction: the higher value of \(L\) changes the outcome response to \(M\).

The corresponding competing-path contrasts are \(14.76-12.78=1.98\) points when the target path is held at 0, and \(17.66-15.23=2.43\) points when it is held at 1. Changing the two paths in sequence gives the total contrast \(17.66-12.78=4.88\) points. For example, changing \(M\) first and then \(L\) gives \(2.45+2.43=4.88\). Changing \(L\) first and then \(M\) gives \(1.98+2.90=4.88\). The total telescopes in either order, but the individual path-specific components depend on the order or reference value when there is interaction.

Standardizing Over Baseline Covariates

When baseline covariates affect the mediator distributions or outcome, calculate the edge-intervention means within covariate strata and then average those means using the covariate distribution in the target population. This standardization is part of the identification formula, not an optional adjustment after calculating an unadjusted contrast.

Worked Example: A Covariate-Standardized Target-Path Contrast

Consider a second hypothetical population with binary baseline covariate \(C\), where \(P(C=0)=0.60\) and \(P(C=1)=0.40\). The mediator probabilities under \(A=0\) and \(A=1\) are 0.10 and 0.50 when \(C=0\), and 0.30 and 0.80 when \(C=1\). The probabilities of \(L=1\) under \(A=1\) are 0.40 when \(C=0\) and 0.70 when \(C=1\).

Suppose the hypothetical outcome mean is \(\mu(m,l,c)=5+2m+3l+ml+2c\), in outcome units. We seek the target-path contrast \(\psi(1,1)-\psi(0,1)\), holding the competing path at 1. Within each \(C\) stratum, averaging over \(L(1)\) makes the outcome difference for changing \(M\) equal to \((p_1-p_0)(2+q)\), where \(p_a=P(M=1\mid A=a,C=c)\) and \(q=P(L=1\mid A=1,C=c)\). The term \(2+q\) follows because the difference in the outcome mean between \(m=1\) and \(m=0\) is \(2+l\), whose mean is \(2+q\).

For \(C=0\), \(p_1-p_0=0.50-0.10=0.40\) and \(q=0.40\), giving a stratum-specific contrast of \(0.40(2+0.40)=0.96\) outcome units. For \(C=1\), \(p_1-p_0=0.80-0.30=0.50\) and \(q=0.70\), giving \(0.50(2+0.70)=1.35\) units. Standardize using the population weights:

$$ \psi(1,1)-\psi(0,1) =0.60(0.96)+0.40(1.35) =0.576+0.540 =1.116\text{ outcome units}. $$

Thus the standardized target-path contrast is 1.116 outcome units for this hypothetical population. The calculation assumes the relevant conditional outcome response and mediator distributions are identified within each covariate stratum, and that both treatment levels and the required mediator values have support in those strata.

Deriving the Edge G-Formula

The formula follows by averaging the outcome response over the variables generated under the specified edge assignment. Under the graph and assumptions, the joint distribution of \(M(a)\) and \(L(b)\), conditional on \(C=c\), factors into their respective conditional distributions under \(A=a\) and \(A=b\). The conditional mean outcome given their values is identified by the observed outcome response, and consistency links observed responses to the corresponding counterfactuals. Therefore:

1
Set the two edge inputs.
Under the mixed assignment, the mediator is generated according to \(P(M=m\mid A=a,C=c)\), while the competing-pathway variable is generated according to \(P(L=l\mid A=b,C=c)\).
2
Average the outcome response.
For each pair \(m,l\), use the conditional mean \(\mu(m,l,c)\), weighted by the two assigned mediator distributions.
3
Average over the target population.
Multiply each stratum-specific mean by \(P(C=c)\) and sum over \(c\), then subtract the two edge-intervention means to form the desired contrast.

This justification depends on the stated causal structure and cross-world condition. In particular, if \(M\) and \(L\) share an unmeasured cause, their mixed counterfactual values may be dependent even after conditioning on \(C\). Multiplying the two observed conditional distributions would then impose a joint distribution that the data do not establish. The formula should not be used merely because the observed DAG has arrows from \(A\) to both variables.

Common Mistake: Treating a Path-Specific Effect as a Regression Coefficient

A common error is to call the coefficient of \(M\) in a regression of \(Y\) on \(A,M,L\) “the effect through \(M\).” That coefficient is a conditional model parameter; it is not generally the contrast \(\psi(1,b)-\psi(0,b)\). The path-specific contrast averages the outcome response over the mediator distributions induced by the assigned treatment values and can depend on the competing-path assignment, as the interaction example showed.

A second error is to set \(A=1\) for one mediator and \(A=0\) for another without stating which counterfactual estimand this defines. The correction is to name the edge assignments explicitly, define the resulting mean, and only then calculate the contrast. Also state the identifying assumptions; a numerical edge-g-formula calculation is not evidence that those assumptions hold.

Key takeaway: A path-specific contrast is determined by the target path, the treatment values assigned to competing paths, and the assumptions that identify the resulting mixed counterfactual mean. With treatment-mediator interaction, changing the reference assignment can change the path-specific contrast.

Check Your Understanding

Use the definitions and calculations above to answer these questions.

  1. In the parallel-path DAG, what does \(\psi(1,0)-\psi(0,0)\) hold fixed, and which path does it vary?
  2. Why can \(\psi(1,1)-\psi(0,1)\) differ from \(\psi(1,0)-\psi(0,0)\) when the outcome includes an \(M\)-by-\(L\) interaction?
  3. Using the first worked example, calculate \(\psi(1,0)\) from its formula and verify the reported value.
  4. Which feature of the causal structure permits the edge-intervention formula to multiply the separate conditional distributions of \(M\) and \(L\)?
  5. Why does randomization of \(A\), by itself, not guarantee identification of the mixed counterfactual mean?
Clinical Biostats