Tutorials › Causal Inference › Path Decomposition Under Time-Varying Covariate Adjustment

Time-Varying Treatments and Confounding · Tutorial 690 of 972

Path Decomposition Under Time-Varying Covariate Adjustment

Learn to decompose a first treatment’s total effect into directed paths and identify which components are excluded by conditioning on an intermediate covariate.

Intermediate 9 min read

What You'll Learn

  • Identify direct and mediated directed paths in a two-treatment longitudinal DAG.
  • Distinguish a total effect from a contrast conditioned on an intermediate covariate.
  • Trace which paths contain the covariate and are blocked by conditioning on it.
  • Derive linear-model expressions for total and adjusted effects.
  • Recognize the assumptions needed to interpret regression coefficients causally.

Why Path Decomposition Matters

In a longitudinal study, a first treatment can change a covariate measured later, and that covariate can influence both a subsequent treatment and the outcome. The covariate is then both a possible mediator of the first treatment’s effect and a confounder of the later treatment–outcome relationship. A regression that conditions on it may help control confounding for the later treatment, while also excluding some pathways by which the first treatment affects the outcome.

The key question in this tutorial is specific: which directed effects of the first treatment are no longer included when a regression conditions on an intermediate covariate? A directed acyclic graph (DAG) makes the possible routes visible. A simple linear model then shows how their contributions add up. Neither the graph nor a regression coefficient, by itself, guarantees that a causal effect has been identified; the assumptions behind that interpretation must also be stated.

A Two-Treatment DAG and Its Paths

Let \(A_1\) be treatment at the first decision, \(L\) an intermediate covariate measured after \(A_1\) but before the next decision, \(A_2\) treatment at the second decision, and \(Y\) the outcome. For now, consider the following arrows: \(A_1\) points to \(L\), \(A_2\), and \(Y\); \(L\) points to \(A_2\) and \(Y\); and \(A_2\) points to \(Y\). Baseline covariates may also affect these variables; imagine that they have been appropriately controlled throughout.

A directed path is a sequence of arrows that all point from an earlier variable toward a later one. In this DAG, the directed paths from \(A_1\) to \(Y\) are:

  • \(A_1 \rightarrow Y\), a direct path;
  • \(A_1 \rightarrow L \rightarrow Y\), mediated through \(L\);
  • \(A_1 \rightarrow A_2 \rightarrow Y\), mediated through \(A_2\);
  • \(A_1 \rightarrow L \rightarrow A_2 \rightarrow Y\), mediated through both \(L\) and \(A_2\).

A path is “direct” here only in the sense that it contains no intermediate variable between \(A_1\) and \(Y\). The other paths describe ways an intervention on \(A_1\) can affect the outcome by changing later variables. Conditioning on \(L\) removes from a conditional comparison the contribution transmitted along paths that pass through \(L\). It does not remove a path that bypasses \(L\), such as \(A_1 \rightarrow A_2 \rightarrow Y\).

Definition: The total causal effect of \(A_1\) compares the outcome under two interventions on \(A_1\), allowing downstream variables such as \(L\) and \(A_2\) to take the values they would naturally take under each intervention. An adjusted conditional contrast compares outcomes at the same value of a conditioned covariate. If that covariate is affected by \(A_1\), this contrast need not include the total effect of \(A_1\).

Worked Example: Listing Paths Before Adjusting

Suppose a hypothetical study follows patients through two treatment decisions. Let \(A_1\) indicate whether a patient receives an initial intervention, \(L\) be a symptom score measured later, \(A_2\) indicate a subsequent treatment, and \(Y\) be a later health score. The proposed DAG has the arrows just described.

Start at \(A_1\) and trace each directed route that ends at \(Y\). One route goes directly from \(A_1\) to \(Y\). A second goes through symptoms, \(A_1 \rightarrow L \rightarrow Y\). A third goes through the second treatment, \(A_1 \rightarrow A_2 \rightarrow Y\). The fourth goes through both, \(A_1 \rightarrow L \rightarrow A_2 \rightarrow Y\).

If a regression conditions on \(L\), the second and fourth paths contain the conditioned variable. In the graph, conditioning on this non-collider blocks those paths as routes connecting \(A_1\) to \(Y\). The direct path and the path through \(A_2\) do not contain \(L\), so conditioning on \(L\) does not block them. This is a path map, not yet proof that a particular regression coefficient equals the sum of the unblocked causal effects.

What the Linear Model Makes Explicit

To calculate the path contributions, consider an additive structural model. The equations below describe \(L\), \(A_2\), and \(Y\) as functions of their direct causes. Suppose the temporal ordering is correct, the equations are correctly specified and have no treatment interactions, and the error terms have conditional mean zero and are independent of the causes in their respective equations, given baseline covariates. These conditions rule out unmeasured confounding for the relationships represented in this model. Also assume consistency and positivity: the observed outcome under a received treatment history agrees with the corresponding potential outcome, and the treatment histories being compared have support in the relevant covariate groups.

For a one-unit change in \(A_1\), the model can be written as:

$$ L = \alpha_0 + \alpha_1 A_1 + \varepsilon_L, \qquad A_2 = \beta_0 + \beta_1 A_1 + \beta_2 L + \varepsilon_2, \qquad Y = \gamma_0 + \tau_1 A_1 + \gamma_1 L + \tau_2 A_2 + \varepsilon_Y. $$

Here, \(\alpha_1\) is the change in \(L\) per unit increase in \(A_1\); \(\beta_1\) is the change in \(A_2\) per unit increase in \(A_1\) at fixed \(L\); and \(\beta_2\) is the change in \(A_2\) per unit increase in \(L\) at fixed \(A_1\). The outcome-equation coefficients describe corresponding conditional changes in \(Y\). The coefficients have units determined by their variables; for example, \(\tau_1\) is measured in outcome units per unit of \(A_1\).

Under this model, increase \(A_1\) by one unit and allow \(L\) and \(A_2\) to respond. The change in \(L\) is \(\alpha_1\). The change in \(A_2\) is \(\beta_1+\beta_2\alpha_1\): \(\beta_1\) is the change not transmitted through \(L\), and \(\beta_2\alpha_1\) is the change transmitted through \(L\). Substituting those changes into the outcome equation gives the total effect.

$$ \begin{aligned} \text{Total effect of a one-unit increase in } A_1 &= \tau_1 + \gamma_1\alpha_1 + \tau_2(\beta_1+\beta_2\alpha_1)\\ &= \underbrace{\tau_1}_{A_1\rightarrow Y} + \underbrace{\gamma_1\alpha_1}_{A_1\rightarrow L\rightarrow Y} + \underbrace{\tau_2\beta_1}_{A_1\rightarrow A_2\rightarrow Y} + \underbrace{\tau_2\beta_2\alpha_1}_{A_1\rightarrow L\rightarrow A_2\rightarrow Y}. \end{aligned} $$

This is a path decomposition for this specified linear, additive model. It is not a universal formula for nonlinear models, models with interactions, or arbitrary regression specifications. The derivation follows by replacing \(L\) and \(A_2\) in the outcome equation with their structural equations and collecting the terms multiplied by \(A_1\).

Worked Example: Calculating Each Path Contribution

Consider hypothetical values \(\alpha_1=1.2\), \(\beta_1=0.5\), \(\beta_2=0.8\), \(\gamma_1=2\), \(\tau_1=1\), and \(\tau_2=3\). Suppose \(A_1\) is measured in treatment units, \(L\) in symptom-score points, \(A_2\) in treatment units, and \(Y\) in health-score points. The model assumptions stated above are taken to hold for this illustration.

The direct path contributes \(\tau_1=1\) health-score point per unit increase in \(A_1\). The path through \(L\) to \(Y\) contributes \(\gamma_1\alpha_1=2(1.2)=2.4\) points. The path through \(A_2\) but not \(L\) contributes \(\tau_2\beta_1=3(0.5)=1.5\) points. Finally, the path through both \(L\) and \(A_2\) contributes \(\tau_2\beta_2\alpha_1=3(0.8)(1.2)=2.88\) points.

Adding the four contributions gives the total effect:

$$ 1 + 2.4 + 1.5 + 2.88 = 7.78 \quad\text{health-score points per unit increase in } A_1. $$

Conditioning on \(L\) blocks the two paths that contain \(L\), whose contributions sum to \(2.4+2.88=5.28\) points in this example. The paths that bypass \(L\) contribute \(1+1.5=2.5\) points. This arithmetic illustrates which components are excluded from the conditional comparison; it does not imply that every regression adjusted for \(L\) estimates 2.5. The regression must also have an appropriate form and satisfy the causal assumptions.

Which Regression Coefficient Represents Which Routes?

The model makes the distinction particularly clear. If the outcome regression includes \(A_1\) and \(L\), but not \(A_2\), substitute the \(A_2\) equation into the outcome equation. The result is:

$$ Y = (\gamma_0+\tau_2\beta_0) +(\tau_1+\tau_2\beta_1)A_1 +(\gamma_1+\tau_2\beta_2)L +\tau_2\varepsilon_2+\varepsilon_Y. $$

Under the stated assumptions, the coefficient of \(A_1\) in a regression of \(Y\) on \(A_1\) and \(L\) is \(\tau_1+\tau_2\beta_1\). Its two terms correspond to the direct route \(A_1 \rightarrow Y\) and the route \(A_1 \rightarrow A_2 \rightarrow Y\). The paths through \(L\) are absent because the comparison holds \(L\) fixed. Thus, adjusting for \(L\) alone does not necessarily eliminate every mediated effect of \(A_1\): it leaves mediation through \(A_2\) along the route that does not pass through \(L\).

If the outcome regression also includes \(A_2\), the coefficient of \(A_1\) in the stated additive model is \(\tau_1\). This is the direct effect represented by the arrow \(A_1 \rightarrow Y\), holding both \(L\) and \(A_2\) fixed. It excludes all three mediated paths. Whether this conditional coefficient is a causal direct effect requires the model and identification assumptions to hold; the coefficient is not automatically a total or mediated effect simply because it comes from a regression.

Worked Example: Comparing Two Adjusted Coefficients

Use a second hypothetical parameter set: \(\alpha_1=2\), \(\beta_1=1.5\), \(\beta_2=0.5\), \(\gamma_1=3\), \(\tau_1=4\), and \(\tau_2=2\). Let \(A_1\) be measured in treatment units, \(L\) in covariate units, \(A_2\) in treatment units, and \(Y\) in outcome units. Assume the linear model and causal conditions already stated.

The total effect per unit increase in \(A_1\) is:

$$ \tau_1+\gamma_1\alpha_1+\tau_2\beta_1+\tau_2\beta_2\alpha_1 =4+3(2)+2(1.5)+2(0.5)(2)=15 $$

So the total effect is 15 outcome units per unit increase in \(A_1\). A regression of \(Y\) on \(A_1\) and \(L\), but not \(A_2\), has an \(A_1\) coefficient of \(\tau_1+\tau_2\beta_1=4+2(1.5)=7\) outcome units per treatment unit. This retains the direct path and the path through \(A_2\) that bypasses \(L\), while excluding the two paths through \(L\).

A regression of \(Y\) on \(A_1\), \(L\), and \(A_2\) has an \(A_1\) coefficient of \(\tau_1=4\) under this model. Holding \(A_2\) fixed removes the remaining route through \(A_2\). The difference between the total effect and this coefficient is \(15-4=11\) outcome units per treatment unit, equal to the sum of all three mediated-path contributions, \(3(2)+2(1.5)+2(0.5)(2)=11\).

Interpretation and Common Pitfall

These calculations separate two questions that are easily conflated: whether an intermediate covariate should be included to control confounding for a later treatment, and whether the resulting coefficient still represents the total effect of an earlier treatment. A covariate can be necessary for the first purpose and problematic for the second. The appropriate interpretation depends on which treatment is being compared, which variables are conditioned on, and what causal effect is the target.

A common mistake is to say, “\(L\) predicts \(Y\), so adjusting for \(L\) gives a better estimate of the total effect of \(A_1\).” That reasoning ignores that \(A_1\) changes \(L\). In the DAG, conditioning on \(L\) excludes the paths \(A_1 \rightarrow L \rightarrow Y\) and \(A_1 \rightarrow L \rightarrow A_2 \rightarrow Y\). The correction is to trace the paths before interpreting the coefficient, then distinguish a conditional contrast from the total effect.

A second caution is that the path accounting above concerns the directed causal routes in a specified DAG. In real data, conditioning can also affect noncausal associations, and ordinary regression may fail to identify even the conditional causal contrast if confounding remains or the model is wrong. The path decomposition is therefore a guide to what is excluded under the stated assumptions, not a substitute for checking those assumptions.

Key takeaway: In the two-treatment DAG, conditioning on the intermediate covariate \(L\) blocks the directed paths from \(A_1\) to \(Y\) that pass through \(L\). It does not block a route that bypasses \(L\), such as \(A_1 \rightarrow A_2 \rightarrow Y\). Conditioning additionally on \(A_2\) blocks that remaining mediated route in the stated additive model.

Check Your Understanding

Use the DAG and linear-model assumptions described above.

  1. List all directed paths from \(A_1\) to \(Y\) that contain \(L\).
  2. Which directed path remains unblocked by conditioning on \(L\) but is mediated through a later variable?
  3. If \(\alpha_1=1\), \(\beta_1=2\), \(\beta_2=1\), \(\gamma_1=3\), \(\tau_1=2\), and \(\tau_2=4\), calculate the total effect per unit increase in \(A_1\).
  4. Under the stated model, what coefficient does an outcome regression on \(A_1\) and \(L\), but not \(A_2\), assign to \(A_1\)? Which paths contribute to it?
  5. Why is the coefficient of \(A_1\) after conditioning on \(L\) not automatically an estimate of the total causal effect?
Clinical Biostats