Tutorials › Marginal Structural Models › d-Separation in Longitudinal DAGs

Causal Diagrams for Longitudinal Data · Tutorial 70 of 501

d-Separation in Longitudinal DAGs

Use the active-path criterion to determine whether specified treatment and outcome nodes are d-separated given a covariate history, and identify what the graph does—and does not—establish.

Intermediate 12 min read

What You'll Learn

  • Define d-separation for treatment and outcome nodes conditional on a specified history.
  • Distinguish blocking at a noncollider from blocking at a collider.
  • Check every simple path between two nodes rather than only the shortest or most familiar path.
  • Apply the chain, fork, and collider rules to longitudinal DAG examples.
  • Derive conditional covariances for Gaussian chain, fork, and collider models.
  • Recognize why d-separation is not, by itself, proof of a causal effect or an observed association.

From Longitudinal Histories to Active Paths

A longitudinal DAG encodes which variables may directly cause which others, while respecting time order. To ask whether a treatment node and an outcome node are d-separated given a covariate history, the task is graphical: enumerate the paths connecting the two nodes and check whether the conditioning set blocks each one. This is different from asking whether the treatment has a causal effect. A directed path from treatment to outcome can remain open even when all backdoor paths have been blocked.

For notation, let \(A_t\) denote treatment at time \(t\), \(L_t\) a covariate measured at time \(t\), \(\bar A_t=(A_0,\ldots,A_t)\), and \(\bar L_t=(L_0,\ldots,L_t)\). A conditioning set \(S\) may consist of some or all of these covariate and treatment-history nodes. D-separation is a property of the specified graph and \(S\), not of a particular fitted regression model.

Definition: A path between two nodes in a DAG is a sequence of distinct adjacent nodes connecting them; the arrows along the path may point in either direction. An internal node on a path is a collider on that path if the two arrows on the path both point into it (\(\rightarrow C \leftarrow\)). Every other internal node is a noncollider. A path is active given \(S\) if (1) none of its noncolliders is in \(S\), and (2) every collider on it either belongs to \(S\) or has a descendant in \(S\). The two endpoints are d-separated given \(S\) if there is no active path between them.

The condition on colliders is deliberately different from the condition on noncolliders. Conditioning on a noncollider blocks a path through it; conditioning on a collider, or on one of its descendants, can make a path through it active. The familiar chain and fork patterns have a noncollider in the middle; the collider pattern has two arrowheads meeting there.

Pattern along a pathMiddle nodePath given \(S\)
\(X \rightarrow M \rightarrow Y\) (chain)NoncolliderBlocked if \(M\) is in \(S\)
\(X \leftarrow M \rightarrow Y\) (fork)NoncolliderBlocked if \(M\) is in \(S\)
\(X \rightarrow C \leftarrow Y\) (collider)ColliderBlocked unless \(C\) or a descendant of \(C\) is in \(S\)

A Path-by-Path Check

The definition gives a direct procedure. First fix the two endpoint nodes and the conditioning set. Then list the distinct paths between the endpoints, marking the direction of each arrow on each path. For each internal node, decide whether it is a collider on that particular path. A node can be a collider on one path and a noncollider on another. Finally, determine whether each path is active. D-separation holds only if every path is blocked.

1
Specify endpoints and conditioning set.
Write the treatment node, outcome node, and exactly which history nodes are conditioned on.
2
Enumerate paths.
Follow edges in either direction, without repeating a node within a path. A path need not follow the direction of causal arrows.
3
Mark colliders and noncolliders.
Use the arrowheads as they appear along each path; do not classify a node only by its general role in the graph.
4
Decide whether each path is active.
A conditioned noncollider blocks it; an unconditioned collider with no conditioned descendant blocks it. If neither rule blocks the path, it is active.
5
Give the conclusion.
All paths blocked means d-separated. One active path is enough to conclude not d-separated.

Worked Example: A Treatment and Outcome Separated by Measured History

Consider a DAG with edges \(A_0\rightarrow A_1\), \(A_0\rightarrow L_1\), \(L_1\rightarrow A_1\), and \(L_1\rightarrow Y\). Is \(A_1\) d-separated from \(Y\) given \(S=\{A_0,L_1\}\)?

There are two paths between the endpoints. The first is \(A_1\leftarrow L_1\rightarrow Y\), a fork with noncollider \(L_1\). Since \(L_1\in S\), this path is blocked.

The second is \(A_1\leftarrow A_0\rightarrow L_1\rightarrow Y\). Its internal nodes \(A_0\) and \(L_1\) are both noncolliders. Both are in \(S\), so this path is also blocked. There are no other paths in the stated graph. Therefore every path is blocked and \(A_1\) and \(Y\) are d-separated given \(\{A_0,L_1\}\).

This conclusion concerns only this graph and this conditioning set. It is not a general claim that adjusting for those variables is sufficient in every longitudinal study.

Why the Three Local Rules Work: A Gaussian Derivation

The path rules are graphical definitions, not formulas for a particular regression coefficient. A simple linear Gaussian calculation nevertheless makes the different roles of chains, forks, and colliders concrete. The following derivation requires independent Gaussian errors with positive variances. In these models, zero conditional covariance implies conditional independence because the variables are jointly Gaussian.

Result: For jointly Gaussian \(X,Y,Z\) with \(\operatorname{Var}(Z)>0\), $$ \operatorname{Cov}(X,Y\mid Z) = \operatorname{Cov}(X,Y) - \frac{\operatorname{Cov}(X,Z)\operatorname{Cov}(Z,Y)} {\operatorname{Var}(Z)}. $$

To derive the formula, subtract from each variable its linear projection on \(Z\): \(X^*=X-\operatorname{Cov}(X,Z)Z/\operatorname{Var}(Z)\) and \(Y^*=Y-\operatorname{Cov}(Y,Z)Z/\operatorname{Var}(Z)\), assuming variables have been centered. For jointly Gaussian variables, these residuals are independent of \(Z\). Their covariance is therefore the conditional covariance of \(X\) and \(Y\) given \(Z\). Expanding gives $$ \operatorname{Cov}(X^*,Y^*) =\operatorname{Cov}(X,Y) -\frac{\operatorname{Cov}(X,Z)\operatorname{Cov}(Z,Y)}{\operatorname{Var}(Z)}, $$ as claimed. This identity will be used to compare the three patterns.

Worked Example: Conditioning Blocks a Gaussian Chain

Let \(X\sim N(0,1)\), \(M=\alpha X+\varepsilon_M\), and \(Y=\beta M+\varepsilon_Y\), where \(X,\varepsilon_M,\varepsilon_Y\) are mutually independent, mean-zero Gaussian variables, and \(\operatorname{Var}(\varepsilon_M)=v_M>0\). Take \(\alpha=\beta=1\) and \(\operatorname{Var}(\varepsilon_Y)=1\). The graph is \(X\rightarrow M\rightarrow Y\).

Here \(\operatorname{Var}(M)=1+v_M\), \(\operatorname{Cov}(X,M)=1\), \(\operatorname{Cov}(M,Y)=\operatorname{Var}(M)=1+v_M\), and \(\operatorname{Cov}(X,Y)=1\). Applying the identity, $$ \operatorname{Cov}(X,Y\mid M) =1-\frac{1(1+v_M)}{1+v_M}=0. $$

More directly, conditional on \(M\), \(Y=M+\varepsilon_Y\), and \(\varepsilon_Y\) is independent of \(X\) and \(M\). Thus \(X\) and \(Y\) are conditionally independent given \(M\) in this model, matching the chain rule: conditioning on the middle noncollider blocks the path.

Worked Example: Conditioning Blocks a Gaussian Fork

Let \(M\sim N(0,2)\), \(X=M+\varepsilon_X\), and \(Y=2M+\varepsilon_Y\), where the independent errors have variances \(1\) and \(3\), respectively, and are independent of \(M\). The graph is \(X\leftarrow M\rightarrow Y\). We check the effect of conditioning on \(M\).

The covariances are \(\operatorname{Var}(M)=2\), \(\operatorname{Cov}(X,M)=2\), \(\operatorname{Cov}(M,Y)=4\), and \(\operatorname{Cov}(X,Y)=\operatorname{Cov}(M+\varepsilon_X,2M+\varepsilon_Y)=4\). Hence $$ \operatorname{Cov}(X,Y\mid M) =4-\frac{2(4)}{2}=0. $$

Given \(M\), the remaining variation in \(X\) is \(\varepsilon_X\) and the remaining variation in \(Y\) is \(\varepsilon_Y\); these errors are independent. Conditioning on the common cause therefore blocks this fork in the stated model.

Worked Example: Conditioning Opens a Gaussian Collider

Let \(X,Y,\varepsilon_C\) be mutually independent, mean-zero Gaussian variables with variances \(1,1,1\), and set \(C=X+Y+\varepsilon_C\). The graph is \(X\rightarrow C\leftarrow Y\). Without conditioning, \(\operatorname{Cov}(X,Y)=0\), so the endpoints are independent in this model.

We have \(\operatorname{Var}(C)=3\), \(\operatorname{Cov}(X,C)=1\), and \(\operatorname{Cov}(C,Y)=1\). Thus $$ \operatorname{Cov}(X,Y\mid C) =0-\frac{1\cdot1}{3}=-\frac{1}{3}. $$

The conditional covariance is nonzero, so the jointly Gaussian variables \(X\) and \(Y\) are conditionally dependent given \(C\). The negative sign has a simple interpretation in this example: at a fixed value of \(C\), a larger value of \(X\) tends to be accompanied by a smaller value of \(Y\). Conditioning on the collider has made the path active.

The calculations prove these claims for the specified Gaussian models; the d-separation rules themselves are not restricted to Gaussian distributions. The examples also make an important limitation clear: an active path permits dependence but does not guarantee it in every distribution. A parameter may be zero, distinct pathways may cancel, or special distributional features may create independence despite an active path.

Worked Longitudinal Path Audits

Worked Example: A Collider Makes the Treatment and Outcome Not D-Separated

Suppose the graph has edges \(L_0\rightarrow A_0\), \(L_0\rightarrow U\), \(A_0\rightarrow L_1\), \(U\rightarrow L_1\), and \(U\rightarrow Y\). Here \(U\) is an unmeasured common cause. Are \(A_0\) and \(Y\) d-separated given \(S=\{L_0,L_1\}\)?

One path is \(A_0\leftarrow L_0\rightarrow U\rightarrow Y\). Both internal nodes are noncolliders, and \(L_0\in S\), so this path is blocked. Another path is \(A_0\rightarrow L_1\leftarrow U\rightarrow Y\). The node \(L_1\) is a collider, and \(L_1\in S\), so this path is active. Because at least one path is active, \(A_0\) and \(Y\) are not d-separated given the stated history.

It would be incorrect to conclude that conditioning on more measured history must always block more paths. On this second path, conditioning on the collider has the opposite effect.

Worked Example: Blocking Backdoor Paths Does Not Block a Direct Path

Let the graph have edges \(L_0\rightarrow A_1\), \(L_0\rightarrow Y\), \(A_0\rightarrow A_1\), \(A_0\rightarrow Y\), and \(A_1\rightarrow Y\). Consider \(A_1\) and \(Y\) given \(S=\{L_0,A_0\}\).

The fork \(A_1\leftarrow L_0\rightarrow Y\) is blocked by conditioning on \(L_0\), and the fork \(A_1\leftarrow A_0\rightarrow Y\) is blocked by conditioning on \(A_0\). But the direct path \(A_1\rightarrow Y\) has no internal node, so neither conditioning variable blocks it. The endpoints are therefore not d-separated given \(S\).

This is not a failure of the path criterion. D-separation assesses all paths, including directed causal paths. If the question is specifically about noncausal paths, those paths must be distinguished from the causal path rather than silently omitted from the d-separation check.

Assumptions, Diagnostics, and Limitations

D-separation requires a specified DAG and a specified conditioning set. It does not tell us whether the graph accurately represents the study’s causal structure. In particular, omitted common causes, incorrectly oriented arrows, or a mistaken temporal order can change which paths are present and whether they are active. The graph’s time indexing matters: an arrow from a future variable to a past variable would generally conflict with the longitudinal ordering used to construct the DAG.

Under the global Markov property, a distribution that factorizes according to a DAG has conditional independences implied by d-separation. That implication depends on the graph being an appropriate model for the distribution. The converse requires additional conditions such as faithfulness; it is not true for every distribution compatible with a graph. Therefore:

  • D-separation is a graphical statement, not an empirical test that establishes the graph is correct.
  • An active path means the graph does not imply conditional independence; it does not prove a nonzero association in every possible model.
  • D-separation of treatment and outcome is not, on its own, proof of a causal effect, identification, or the assumptions needed for an estimator.
  • A regression adjustment set and a d-separation query are not interchangeable descriptions unless the target question and graph have been specified.

A useful diagnostic is to record every path and its blocking reason. If a conclusion relies on saying “the history blocks confounding,” check that every relevant path is actually blocked and that a collider has not been conditioned on. If two analysts disagree, compare their graphs and conditioning sets before comparing their path classifications. Often the disagreement is about an edge or a node’s temporal role, not the rules for reading a fixed graph.

Common Mistakes and the Main Alternatives

  • Checking only the direct edge. A direct treatment-to-outcome arrow may exist, but there may also be other paths. Enumerate all paths before deciding d-separation.
  • Assuming any conditioning blocks a path. Conditioning on a noncollider blocks that path; conditioning on a collider can activate it. Apply the local rule to the node’s role on that path.
  • Following arrows only forward. A path may traverse an arrow against its direction. Path enumeration is about adjacency, while collider classification uses arrow direction.
  • Treating a blocked backdoor route as d-separation of treatment and outcome. A remaining directed path still makes the endpoints not d-separated. State whether the question concerns all paths or a particular class of paths.

Path-by-path d-separation is the most transparent approach when the graph is small or when a particular history is being audited. For a large DAG, graphical algorithms can automate the same criterion, but they do not repair a misspecified graph. Regression conditioning is a different approach: it estimates associations under a model and does not, by itself, certify that the chosen variables block the intended paths. The backdoor criterion is a related causal-graph criterion aimed at identifying adjustment sets; it is not a substitute for carefully stating the d-separation query.

Key takeaway: Given a longitudinal DAG and conditioning set \(S\), a treatment node and outcome node are d-separated exactly when every path between them is blocked. Noncolliders in \(S\) block paths; colliders in \(S\), or with descendants in \(S\), can open paths.

Check Your Understanding

For each question, decide whether the endpoints are d-separated and identify the decisive path rule.

  1. In \(A\rightarrow L\rightarrow Y\), are \(A\) and \(Y\) d-separated given \(L\)?
  2. In \(A\leftarrow L\rightarrow Y\), are \(A\) and \(Y\) d-separated given the empty set?
  3. In \(A\rightarrow C\leftarrow U\rightarrow Y\), are \(A\) and \(Y\) d-separated given the empty set? What changes if \(C\) is added to the conditioning set?
  4. In a graph with both \(A\leftarrow L\rightarrow Y\) and \(A\rightarrow Y\), are \(A\) and \(Y\) d-separated given \(\{L\}\)? Explain why blocking one path is not enough.

Solutions. (1) Yes. \(L\) is a noncollider on the only path and is conditioned on. (2) No. The fork has an unconditioned noncollider, so its path is active. (3) Yes: the collider \(C\) is unconditioned and has no conditioned descendant, so that path is blocked. Adding \(C\) opens the path, so the endpoints are then not d-separated. (4) No. Conditioning on \(L\) blocks the fork, but the direct path \(A\rightarrow Y\) remains active.

Clinical Biostats