Causal Inference with Time-Varying Confounders

25 concepts20 papers1 proposal

In longitudinal studies, estimating the true causal effect of a treatment is frequently stymied by a classic chicken-and-egg problem: time-varying confounding with feedback loops.

Consider a clinical trial or observational study where a patient's treatment dose is adjusted over time. In a flexible-dose trial, as noted by Lipkovich et al., clinicians naturally increase the dosage for the sickest, non-responsive patients. This creates a "success bias" or confounding by indication: because the highest doses are disproportionately given to those who are doing the worst, a naive analysis might conclude that higher doses are actually less effective or even harmful.

As Severus et al. emphasize, real-world clinical practice is defined by these feedback loops: a patient's deteriorating condition dictates a change in medication, and that medication in turn alters their future condition. When we try to analyze such data using standard statistical methods, we run into a fundamental mathematical barrier.

The Failure of Standard Conditioning

Why can't we just use standard regression and control for the patient's health status over time?

To see why, let's trace the causal pathways over two time steps. Let $A_0$ and $A_1$ be treatments at times 0 and 1, $L_1$ be the patient's health status at time 1, and $Y$ be the final outcome.

  A_0  ------->  L_1  ------->  A_1  ------->  Y
   \              ^              /            ^
    \             |             /            /
     \------------+------------/------------/

In this system, $L_1$ plays a dual role:

  1. It is a confounder for the effect of $A_1$ on $Y$, because $L_1$ influences both the choice of subsequent treatment $A_1$ and the final outcome $Y$.
  2. It is a mediator for the effect of $A_0$ on $Y$, because the initial treatment $A_0$ changes the health status $L_1$, which then affects $Y$.

If we do not control for $L_1$, our estimate of the effect of $A_1$ is biased due to confounding by indication. But if we do control for $L_1$ in a standard regression model, we block the path $A_0 \rightarrow L_1 \rightarrow Y$, effectively erasing the downstream causal impact of the initial treatment $A_0$. Furthermore, conditioning on $L_1$ can introduce collider-stratification bias if there are unmeasured variables affecting both $L_1$ and $Y$.

Standard regression forces an impossible choice: either accept confounding bias or commit over-controlling bias. Sharma et al. describe this exact exposure-confounder feedback loop when analyzing how hospital capacity utilization impacts mortality over time. To untangle it, we need a method that can adjust for the confounding role of $L_1$ without blocking its mediating role.

Marginal Structural Models and Pseudo-Populations

Marginal Structural Models (MSMs) solve this dilemma not by adding variables to a regression equation, but by changing the data itself via Inverse Probability of Treatment Weighting (IPTW).

The intuition behind IPTW is to simulate a hypothetical randomized controlled trial from observational data. In an ideal randomized trial, the probability of receiving a treatment is completely independent of a patient's history. IPTW achieves this independence by reweighting each individual's data.

As explained by Ghosheh et al., we calculate the probability that a patient received their actual treatment sequence given their past treatment and covariate history. We then weight each patient by the inverse of this probability.

$$\text{Weight} = \frac{1}{P(A_t \mid \text{History}_t)}$$

To understand why this works, imagine a scenario where severely ill patients ($L_1 = 1$) have a 90% chance of receiving an aggressive treatment ($A_1 = 1$), while mild patients ($L_1 = 0$) have only a 10% chance.

  • A sick patient who receives the treatment gets a low weight ($1 / 0.90 \approx 1.11$).
  • A rare sick patient who does not receive the treatment gets a massive weight ($1 / 0.10 = 10$).

By applying these weights, we create a pseudo-population. In this reweighted population, the sick patients who did not get the drug are scaled up to perfectly balance the sick patients who did. The correlation between a patient's history and their treatment assignment completely vanishes.

Because treatment assignment in the pseudo-population is statistically independent of patient history, time-varying confounding is eliminated. As Tanaka et al. and Rathbun et al. (2018) demonstrate, researchers can then fit a simple "marginal" model to this pseudo-population to estimate the true, unbiased causal effect of different treatment trajectories over time.

Structural Nested Mean Models

While MSMs look at the population-level effect of an entire treatment sequence, an alternative framework called Structural Nested Mean Models (SNMMs) focuses on the sequential, step-by-step effect of treatments.

Instead of reweighting the population to eliminate confounding, SNMMs use a technique called G-estimation. As outlined by Wang et al., SNMMs directly parameterize how much the final outcome would change if we intervened on a single treatment step $A_t$, conditional on the patient's precise history up to that moment.

This framework is uniquely powerful when researchers want to understand effect modification—how the causal impact of a treatment changes based on a patient's evolving characteristics. For instance, Rathbun et al. (2019) utilized an IPTW regression-with-residuals approach within an SNMM framework to discover that the effectiveness of analgesics on knee osteoarthritis pain is significantly moderated by a patient's depression status over time. To expand this capability, Jaman et al. introduced penalized G-estimation for SNMMs, allowing algorithms to automatically select which time-varying patient characteristics act as true effect modifiers from a large pool of candidates.

Causal Inference in Action

By providing a mathematically rigorous way to handle time-dependent confounding, MSMs and SNMMs allow researchers to extract reliable causal insights from complex, messy observational data across diverse domains:

  • Chronic Disease Management: In treating secondary hyperparathyroidism, lab values like parathyroid hormone, calcium, and phosphate constantly fluctuate and dictate drug dosing. Akizawa et al. and Asada et al. successfully deployed MSMs to isolate the true impact of these therapies on patient mortality despite intense time-varying confounding.
  • Critical Care Decisions: In the ICU, a patient's respiratory status changes minute by minute, directly influencing ventilation strategies. Chevret et al. and Wong et al. applied MSMs to prevent the misattribution of outcomes when mechanical ventilation strategies are dynamically adjusted in response to a patient's worsening condition.
  • Health Policy and Epidemiology: Whether evaluating the long-term impact of integrated Medicaid programs (McGinty et al.), tracking risk factors for co-infections (Xian et al.), or optimizing cancer surveillance intervals using real-world electronic health records (Braithwaite et al.), these models serve as the essential toolkit for transforming longitudinal observations into actionable causal conclusions.

Key Foundational Work

Double-Blind Randomized Placebo-Controlled Trials in the Treatment of Affective Disorders: Problems and Alternatives (2015) — contributed 2 concept elements to this direction.
Evaluating dose response from flexible dose clinical trials (2008) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_marginal_structural_modeling_a074bc98,
  title = {marginal structural modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/marginal-structural-modeling/rdr_a074bc98644a487e93f50274653f8803},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-19},
}

This exact version (version 1, frozen text):

@misc{lacuna_marginal_structural_modeling_a074bc98_v1,
  title = {marginal structural modeling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/marginal-structural-modeling/rdr_a074bc98644a487e93f50274653f8803/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-19},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake