Tutorials › Marginal Structural Models › Latent Causes and Unmeasured Confounding in Longitudinal Graphs

Causal Diagrams for Longitudinal Data · Tutorial 75 of 501

Latent Causes and Unmeasured Confounding in Longitudinal Graphs

Trace open paths from repeated treatments to outcomes when common causes are unmeasured, and see why observed-history adjustment cannot guarantee sequential exchangeability.

Intermediate 12 min read

What You'll Learn

  • Distinguish a latent common cause from an observed time-varying confounder in a longitudinal DAG.
  • Identify open backdoor paths from treatment nodes and treatment histories to an outcome.
  • See why conditioning on observed history does not necessarily block a path through an unmeasured cause.
  • Work through numerical examples of baseline and time-varying unmeasured confounding.
  • Separate what a graph establishes from what requires additional assumptions or sensitivity analysis.

Why Add Latent Causes to a Longitudinal Graph?

A longitudinal DAG represents assumptions about how causes precede treatments and outcomes. If a relevant common cause is not measured, leaving it out of the diagram can make the treatment process appear more isolated than it is. A treatment may then seem unrelated to the outcome except through causal effects, even though an unblocked common-cause path connects them.

Use \(L_0\) for measured baseline covariates, \(A_0\) and \(A_1\) for treatments at two successive times, \(L_1\) for a measured post-\(A_0\) covariate, and \(Y\) for the outcome. A latent variable \(U\) is a variable in the causal system that is not observed in the data. It can be a baseline common cause, such as underlying disease severity, or a time-varying cause, such as an unrecorded change in health between treatment decisions.

Definition: In a longitudinal DAG, unmeasured confounding at time \(t\) is represented when a latent variable is a cause of \(A_t\) and is also a cause of \(Y\), or of a later variable that causes \(Y\). A path from \(A_t\) to \(Y\) that enters \(A_t\) through an arrowhead is a backdoor path. It is open given a conditioning set if none of its noncolliders is conditioned on and none of its colliders, or their descendants, is conditioned on.

The temporal order still matters. A baseline \(U\) can cause \(A_0\), \(L_1\), \(A_1\), and \(Y\). A time-varying \(U_1\), arising after \(A_0\) but before \(A_1\), can be caused by \(A_0\) and then cause both \(A_1\) and \(Y\). These are different graph structures, but each can leave a treatment–outcome path open.

How Latent Causes Open Paths

A simple baseline structure is the fork \(A_0 \leftarrow U \rightarrow Y\). The path is open unless it is blocked by conditioning on a noncollider on that path. If \(U\) is unobserved, it cannot be included in an ordinary adjustment set formed from measured variables. A measured descendant of \(U\) is not, merely by being a descendant, a blocker of this fork.

For a later treatment, the corresponding structure may be \(A_1 \leftarrow U_1 \rightarrow Y\). If \(U_1\) is also affected by \(A_0\), the graph contains \(A_0 \rightarrow U_1 \rightarrow A_1\) and the backdoor path \(A_1 \leftarrow U_1 \rightarrow Y\). Thus \(U_1\) can be a confounder of the later treatment–outcome relationship while also being affected by earlier treatment. Measuring only the earlier treatment does not block the fork through \(U_1\).

Result: If a DAG contains \(A_t \leftarrow U \rightarrow Y\), and the conditioning set contains neither \(U\) nor another noncollider on that path, then the path is open given that set. In particular, adjusting for other measured history variables does not close this path solely because they predict \(U\).

Justification. The path has two edges, \(A_t \leftarrow U\) and \(U \rightarrow Y\). At \(U\), both edges have tails, so \(U\) is a noncollider. By the definition of d-separation, a path through a noncollider is blocked only if that noncollider is conditioned on. If \(U\) is not conditioned on, the path remains open. Variables not on this path cannot block it. A descendant of \(U\) is not the noncollider \(U\) itself, so conditioning on that descendant does not block this path. \(\square\)

An open path means the graph does not d-separate the treatment and outcome given the chosen history. It does not prove that they are statistically dependent in every possible probability distribution: effects can cancel by special parameter choices. The graph identifies a route by which association can arise and therefore a threat to causal identification absent further assumptions.

Worked Example: A Baseline Latent Cause Creates a Spurious Treatment Difference

Let \(U\) indicate severe underlying illness, with \(P(U=1)=0.5\). Suppose \(P(A_0=1\mid U=1)=0.8\), \(P(A_0=1\mid U=0)=0.2\), and the potential outcome under either treatment is \(Y^a=U\). Thus treatment has no causal effect: for each person, \(Y^1=Y^0\).

The graph contains \(U\rightarrow A_0\) and \(U\rightarrow Y\). Among treated people, \(P(U=1,A_0=1)=0.5(0.8)=0.4\) and \(P(A_0=1)=0.4+0.5(0.2)=0.5\). Hence \(P(U=1\mid A_0=1)=0.4/0.5=0.8\), so \(E[Y\mid A_0=1]=0.8\).

Among untreated people, \(P(U=1,A_0=0)=0.5(0.2)=0.1\) and \(P(A_0=0)=0.1+0.5(0.8)=0.5\). Therefore \(P(U=1\mid A_0=0)=0.1/0.5=0.2\), and \(E[Y\mid A_0=0]=0.2\). The observed difference is \(0.8-0.2=0.6\), although the causal effect is \(E[Y^1-Y^0]=0\). The open fork through \(U\) explains why the observed contrast is not, by itself, a causal contrast.

Repeated Treatments: A Latent Cause Across the History

A single baseline cause can influence more than one treatment decision. Consider \(U\rightarrow A_0\), \(U\rightarrow A_1\), and \(U\rightarrow Y\), with no arrows from either treatment to \(Y\). The graph includes the backdoor paths \(A_0\leftarrow U\rightarrow Y\) and \(A_1\leftarrow U\rightarrow Y\). The second path is still open after conditioning on \(A_0\): \(A_0\) is not on the path from \(A_1\) through \(U\) to \(Y\).

Worked Example: Comparing Two Treatment Histories Under Persistent Confounding

Let \(P(U=1)=0.5\). Given \(U\), let \(A_0\) and \(A_1\) be independent, with \(P(A_t=1\mid U=1)=0.8\) and \(P(A_t=1\mid U=0)=0.2\) for \(t=0,1\). Set \(Y=U\), so neither treatment causes the outcome.

For history \((A_0,A_1)=(1,1)\), the joint probabilities with \(U=1\) and \(U=0\) are \(0.5(0.8)(0.8)=0.32\) and \(0.5(0.2)(0.2)=0.02\). Thus \(P(U=1\mid A_0=1,A_1=1)=0.32/(0.32+0.02)=16/17\), and the outcome mean in this history is \(16/17\).

For history \((0,1)\), the corresponding probabilities are \(0.5(0.2)(0.8)=0.08\) and \(0.5(0.8)(0.2)=0.08\). Therefore \(P(U=1\mid A_0=0,A_1=1)=0.5\), and the outcome mean is \(0.5\). The difference between the history-specific means is \(16/17-1/2=15/34\), despite there being no treatment effect. These histories select different distributions of \(U\); adjusting for the observed treatment history does not reveal or remove that latent imbalance.

A different pattern occurs when the latent cause is time-varying and affected by earlier treatment. The path \(A_0\rightarrow U_1\rightarrow A_1\) makes \(U_1\) part of the evolving treatment process, while \(A_1\leftarrow U_1\rightarrow Y\) confounds the later treatment–outcome relationship. This distinction matters when auditing a longitudinal exchangeability assumption: a history can include prior treatment and measured covariates and still omit a cause of the next treatment and outcome.

Worked Example: An Unmeasured Time-Varying Cause of Later Treatment

Suppose \(A_0\) is randomized. For individuals with \(A_0=0\), let \(P(U_1=1\mid A_0=0)=0.2\); for those with \(A_0=1\), let it be \(0.8\). Given \(U_1\), assign \(A_1\) with probability \(0.8\) when \(U_1=1\) and \(0.2\) when \(U_1=0\). Let \(Y=U_1\), so \(A_1\) has no effect on \(Y\). The relevant arrows are \(A_0\rightarrow U_1\), \(U_1\rightarrow A_1\), and \(U_1\rightarrow Y\).

Within the stratum \(A_0=0\), \(P(U_1=1,A_1=1)=0.2(0.8)=0.16\) and \(P(U_1=0,A_1=1)=0.8(0.2)=0.16\). Hence \(P(Y=1\mid A_0=0,A_1=1)=P(U_1=1\mid A_0=0,A_1=1)=0.5\).

For \(A_1=0\), the corresponding joint probabilities are \(0.2(0.2)=0.04\) and \(0.8(0.8)=0.64\). Thus \(P(Y=1\mid A_0=0,A_1=0)=0.04/(0.04+0.64)=1/17\). The within-\(A_0=0\) difference is \(0.5-1/17=15/34\), again with no causal effect of \(A_1\). Randomization of \(A_0\) does not make the later treatment randomized: the open fork through \(U_1\) remains.

What the Graph Says About Exchangeability

For a treatment at time \(t\), sequential exchangeability is commonly expressed as independence of the relevant potential outcomes from \(A_t\), conditional on the observed covariate and treatment history available just before that decision. A graph with a latent fork into \(A_t\) and \(Y\) warns that this independence is not secured by the measured history alone. In the time-varying example, conditioning on \(A_0\) still leaves \(A_1\leftarrow U_1\rightarrow Y\) open.

Result: If the observed adjustment history does not block an open backdoor path from \(A_t\) to \(Y\) because that path passes through an unmeasured common cause, then the DAG does not justify conditional exchangeability from that history alone. A causal analysis that relies on exchangeability must obtain that assumption from additional design or substantive knowledge, or use an approach that addresses the unmeasured cause.

This is a statement about what the graph can justify, not a universal claim that every open path produces nonzero association. For example, a path can have a zero-strength arrow or its contributions can cancel. Conversely, finding no obvious association after adjustment does not establish that all such paths are blocked. In potential-outcome notation, a graphical concern is especially relevant when the omitted cause predicts both treatment assignment and outcomes under at least some treatment regimes.

The distinction between a measured and a latent cause is also important for interpreting the earlier material on baseline versus time-varying confounding. A measured time-varying confounder can be drawn and its role assessed using the graph. A latent one is still part of the causal structure, but standard adjustment using recorded variables cannot condition on it. Its presence can therefore invalidate the exchangeability claim that would otherwise support identification.

Diagnostics, Alternatives, and Limits

No diagnostic based only on the observed data can generally certify that a relevant latent common cause is absent. A sensible audit combines the study timeline with subject-matter knowledge: ask what determines each treatment decision, what can change between decisions, and which of those causes also predict the outcome. The following warning signs are useful, but none is a proof of unmeasured confounding:

  • A clinically important factor plausibly affects treatment choice and prognosis but was not recorded.
  • Treatment decisions respond to informal clinical judgments or symptoms not represented in the data.
  • Measured-history balance is used as if it demonstrated balance on variables that were never measured.
  • A model assumes sequential exchangeability even though the stated causal diagram contains an unblocked latent fork.

The main alternatives make different commitments. A DAG containing only observed variables can describe the measured structure but hides any omitted common causes. A DAG that includes latent nodes makes the threat visible, but does not identify the latent variable’s distribution or the size of its effect. An assumption of sequential randomization rules out relevant common causes by design or stipulation; it is stronger than merely observing that measured history was adjusted for. Sensitivity analysis can examine how conclusions change under specified unmeasured-confounding strengths, but it does not make the latent cause observed.

ApproachWhat it contributesWhat it does not establish
Observed-variable DAGDisplays causal assumptions among recorded variablesThat unrecorded common causes do not exist
DAG with latent nodesShows open paths involving unmeasured causesThe numerical magnitude of resulting bias
Sequential randomization assumptionProvides an assumption under which measured history suffices for treatment assignmentThat the assumption is true because covariates were measured
Sensitivity analysisAssesses robustness to specified levels of unmeasured confoundingDirect empirical verification of the latent cause’s strength

A common mistake is to reason, “I adjusted for all measured covariates, so the treatment and outcome are unconfounded.” That conclusion does not follow. Adjustment can block paths through conditioned measured noncolliders; it cannot block a fork through an unobserved \(U\) that is not on the measured adjustment set. The correction is to state the exchangeability assumption explicitly, draw plausible latent causes, and distinguish the assumption from what the observed data can verify.

These graphs are not a test for whether confounding exists, nor do they quantify bias. They organize assumptions and reveal threats. Even a carefully specified latent-variable graph may not tell which of several unmeasured causes is present, and a measured proxy does not automatically block a path through its latent cause. Any claim that a proxy, design feature, or sensitivity model resolves the problem requires its own assumptions.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. In \(A_1\leftarrow U\rightarrow Y\), is the path open after conditioning on \(A_0\), if \(A_0\) is not on the path?
  2. Suppose \(U_1\) is caused by \(A_0\) and causes both \(A_1\) and \(Y\). What backdoor path connects \(A_1\) to \(Y\)?
  3. In the baseline example, why does the observed treatment-group difference fail to equal the causal effect?
  4. Does an open path prove that the treatment and outcome must be statistically dependent? Explain.
  5. Why does balance on recorded covariates not establish balance on a latent cause?

Solutions. (1) Yes. \(A_0\) is not on the path, so conditioning on it does not block the noncollider \(U\). (2) The path is \(A_1\leftarrow U_1\rightarrow Y\), which is open unless \(U_1\) or another noncollider on the path is conditioned on. (3) \(U\) affects both treatment assignment and outcome; the treated and untreated groups have \(P(U=1\mid A_0=1)=0.8\) and \(P(U=1\mid A_0=0)=0.2\), while \(Y^1=Y^0=U\). The difference of 0.6 reflects different compositions, not a treatment effect. (4) No. An open path means the graph does not d-separate the variables; special parameter values can still yield independence. The path is a possible source of association and a causal identification threat. (5) Recorded balance concerns measured variables only. It does not show that the distributions of an unobserved variable agree across treatment groups, so it cannot rule out a latent fork.

Clinical Biostats