Tutorials › Causal Inference › Structural Nested Models Versus Marginal Structural Models

Structural Nested Models and G-Estimation · Tutorial 774 of 972

Structural Nested Models Versus Marginal Structural Models

Compare the causal quantities targeted by structural nested and marginal structural models, and see how their estimation strategies use treatment and outcome models differently.

Advanced 11 min read

What You'll Learn

  • Distinguish conditional blip parameters from marginal regime-mean parameters.
  • Define a structural nested model and a marginal structural model for longitudinal treatment.
  • Explain the role of treatment-assignment models in g-estimation and inverse-probability weighting.
  • Identify when an outcome model is required, optional, or part of the model’s target.
  • Relate sequential blips to regime contrasts under a stated model.
  • Recognize why blip and marginal-model coefficients are not generally interchangeable.

Two Models, Two Causal Targets

Structural nested models and marginal structural models can both address time-varying treatment and confounding affected by earlier treatment. Their central difference is not simply the estimation algorithm: they parameterize different causal quantities. A structural nested model describes the effect of changing treatment at a particular decision time, conditional on the history at that time. A marginal structural model describes the mean outcome under a treatment regime in a specified population.

That distinction matters when treatment effects vary across histories. A conditional blip can describe that variation directly, while a marginal regime mean averages over a population distribution. Even when both models are correctly specified, their coefficients need not be numerically equal or answer the same question.

Definition: Let \(A_t\) be treatment at time \(t\), \(L_t\) the measured covariates available before that treatment, and \(H_t=(V,\bar L_t,\bar A_{t-1})\) the observed history immediately before \(A_t\), including baseline covariates \(V\). Write \(\bar a=(a_1,\ldots,a_K)\) for a treatment regime and \(Y^{\bar a}\) for the outcome that would be observed under that regime. A marginal structural model (MSM) specifies a model for a marginal counterfactual quantity such as \(E[Y^{\bar a}]\). A structural nested model (SNM) specifies a model for sequential treatment blips: conditional causal contrasts for changing treatment at a decision time, after accounting for later treatment effects through a blipping-down construction.

The counterfactual quantities require a well-defined treatment regime and outcome. For identification from observed data, standard conditions include consistency, no interference between individuals, sequential exchangeability given measured history, and positivity: each treatment level under consideration must have positive probability at histories to which the target applies. These conditions do not make the two model targets identical; they support identification of the causal quantities each model parameterizes.

What a Blip Parameter Represents

A blip is a contrast attached to a treatment decision. In a simple one-time setting with binary treatment \(A\), history \(H\), and outcome \(Y\), a conditional mean blip can be written as \(E[Y^{1}-Y^{0}\mid H]\). An SNM might model this as \(\gamma(H,A;\psi)=A\{\psi_0+\psi_1 H\}\), where \(\psi\) indexes the conditional effect. In a longitudinal setting, blips are defined sequentially: later treatment effects are removed from the outcome before isolating the contrast at an earlier decision. The treatment history in a blip model is therefore part of its interpretation, not just a convenient set of predictors.

G-estimation uses a model for treatment assignment given history and searches for blip parameters that make a suitable blipped-down outcome satisfy conditional moment restrictions. In a one-time binary-treatment illustration, let \(\pi(H)=P(A=1\mid H)\), and let \(U(\psi)=Y-\gamma(H,A;\psi)\) be the outcome after removing the modeled treatment blip. A moment condition has the form \(E[(A-\pi(H))U(\psi)q(H)]=0\), where \(q(H)\) is a chosen function of history. The treatment model supplies \(\pi(H)\); the blip model supplies \(U(\psi)\). This does not require fitting a conventional regression of the observed outcome on treatment and history as the primary estimator of the blip.

Worked Example: A Conditional Blip From G-Estimation

Suppose, hypothetically, treatment is randomized with probability 0.5 in each history stratum, and the mean outcome is 11 among controls and 15 among treated individuals within a given stratum. Consider the additive blip model \(\gamma(A;\psi)=\psi A\). Here the treatment model is known: \(\pi(H)=0.5\). The blipped-down outcome is \(U(\psi)=Y-\psi A\).

Using the moment \(E[(A-\pi(H))U(\psi)]=0\), replace the expectations by the stated group means:

$$ \begin{aligned} E[(A-0.5)(Y-\psi A)] &=0.5(0.5)(15-\psi)+0.5(-0.5)(11)\\ &=0.25(15-\psi)-0.25(11)\\ &=0.25(4-\psi). \end{aligned} $$

The moment is zero at \(\hat\psi=4\). In this hypothetical stratum, the estimated conditional mean blip is 4 outcome units. The calculation depends on the specified randomized treatment probability and the additive blip model; it does not by itself establish that a constant blip applies in other strata.

In longitudinal applications, the treatment model is sequential: it describes \(P(A_t\mid H_t)\) at each decision time. Under a correctly specified blip model and the identification conditions, g-estimation uses treatment residuals such as \(A_t-E[A_t\mid H_t]\) in conditional moment equations. The sequential construction removes later treatment effects when estimating earlier blips. The exact moment equations depend on the treatment type and chosen blip functions; the key requirement is that the modeled blipped-down outcome obey the stipulated conditional restrictions.

What a Marginal Structural Model Represents

An MSM instead places a model directly on the mean outcome under regimes. For example, a two-time additive MSM might specify \(E[Y^{a_1,a_2}]=\beta_0+\beta_1a_1+\beta_2a_2\). Here \(\beta_1\) and \(\beta_2\) describe changes in the population marginal mean when a regime component changes, under the model’s assumptions. They are not automatically history-specific effects. An MSM can include regime interactions or baseline effect modifiers, but its defining target remains marginal over the covariate distribution unless a different target population is explicitly specified.

A common estimation strategy is inverse-probability weighting. The treatment model estimates the probability of each observed treatment given history; the resulting weights create a pseudo-population in which measured history is balanced across treatment choices, under correct specification and positivity. One then fits the marginal outcome model in that weighted population. The MSM itself is an outcome model for counterfactual regime means; the weighted estimator need not also fit a conditional outcome regression. Other strategies, such as g-computation, do require an outcome regression, and augmented estimators may use both treatment and outcome models.

Worked Example: A Weighted Marginal Regime Contrast

Consider a hypothetical one-time study with a binary baseline covariate \(L\), where \(P(L=1)=P(L=0)=0.5\). Treatment probabilities are \(P(A=1\mid L=1)=0.8\) and \(P(A=1\mid L=0)=0.2\). Suppose the conditional mean outcomes under treatment and control are respectively 14 and 10 when \(L=1\), and 8 and 6 when \(L=0\). Assume consistency, exchangeability given \(L\), positivity, and a correctly specified treatment model.

The stratum-specific mean contrasts are \(14-10=4\) and \(8-6=2\). The marginal contrast in this population averages them using the baseline proportions:

$$ E[Y^1]-E[Y^0] =0.5(14)+0.5(8)-\{0.5(10)+0.5(6)\} =11-8=3. $$

Without adjustment, the observed treated mean would be \(0.8(14)+0.2(8)=12.8\), because treated individuals are more often in the \(L=1\) stratum. The observed control mean would be \(0.2(10)+0.8(6)=6.8\). Their difference, 6.0, is not the marginal causal contrast.

Weighting by the inverse treatment probability recovers the target marginal means in expectation. For treated individuals, the unnormalized weighted contribution to the mean is \(0.5(0.8)(14)/0.8+0.5(0.2)(8)/0.2=7+4=11\); the corresponding denominator is \(0.5+0.5=1\). For controls, the weighted numerator is \(0.5(0.2)(10)/0.2+0.5(0.8)(6)/0.8=5+3=8\), again with denominator 1. The weighted contrast is \(11-8=3\) outcome units. A fitted MSM describes this marginal regime contrast, whereas a model retaining the two stratum-specific effects describes conditional contrasts.

How the Targets Relate—and Why They Differ

Under a compatible SNM, regime contrasts can be assembled from sequential blips. The basic justification is telescoping: compare two regimes by changing one treatment decision at a time, and sum the resulting sequential contrasts. For a two-time regime, for example, the contrast between \((1,1)\) and \((0,0)\) can be decomposed as the change from \((0,0)\) to \((1,0)\), followed by the change from \((1,0)\) to \((1,1)\). Taking expectations gives the marginal regime contrast, with each conditional blip averaged over the appropriate history distribution.

The averaging distribution is important. A blip conditional on \(H_t\) is not generally equal to a marginal MSM coefficient. The history distribution at a later time may itself depend on earlier treatment, so a later blip averaged under different earlier regimes can produce different marginal contrasts. Equality of a blip parameter and an MSM coefficient requires additional structure, such as a simple additive model with no relevant effect modification and a matching scale and target population.

Justification: For any three regime means, the identity \(E[Y^{1,1}]-E[Y^{0,0}]=\{E[Y^{1,0}]-E[Y^{0,0}]\}+\{E[Y^{1,1}]-E[Y^{1,0}]\}\) holds by adding and subtracting \(E[Y^{1,0}]\). A correctly specified sequential blip model represents the component contrasts conditional on the histories relevant to each decision. Averaging those conditional contrasts over their corresponding histories yields the component marginal contrasts; their sum gives the overall regime contrast. This identity does not say that each conditional blip is itself a marginal MSM coefficient.

Worked Example: From Constant Blips to a Regime Mean

Suppose, hypothetically, a two-time additive SNM has constant blips of 2 outcome units for treatment at time 1 and 3 outcome units for treatment at time 2. Suppose the mean outcome under the all-zero regime is 10, and the additive blips apply across histories without treatment interactions or effect modification. Under regime \((1,1)\), the predicted mean is the reference mean plus both blips:

$$ E[Y^{1,1}]=E[Y^{0,0}]+2+3=10+2+3=15. $$

The marginal contrast between regimes \((1,1)\) and \((0,0)\) is \(15-10=5\) outcome units. In this special case, the blips sum directly to the marginal contrast because they are constant and additive. If the time-1 blip instead varied with history, its contribution would have to be averaged over the relevant history distribution; reporting the conditional blip itself as the population contrast would then be incorrect.

Modeling Requirements in Practice

Both approaches need a credible account of treatment assignment when treatment is not randomized. Their requirements differ in what that model is used to do and what outcome model is specified.

FeatureStructural nested modelMarginal structural model
Primary targetSequential, often history-conditional treatment blipsMarginal mean outcome under treatment regimes
Outcome specificationA blip function and its parameterization; g-estimation can avoid a conventional conditional outcome regressionA marginal structural mean model for regime outcomes
Treatment specificationConditional treatment probabilities or means used in g-estimation momentsConditional treatment probabilities used to construct inverse-probability weights
Alternative estimation routeOther estimators may add outcome modeling, but that is not intrinsic to basic g-estimationG-computation uses an outcome regression; augmented methods may use both treatment and outcome models

In either approach, misspecification can undermine the result. A poor treatment model can invalidate g-estimation moments or produce inappropriate weights; extreme weights also signal limited information and can make weighted estimates unstable. A poorly chosen blip function may fail to represent conditional treatment effects, while a misspecified MSM may fail to represent the marginal regime means of interest. Diagnostics and sensitivity analyses should therefore be tied to the particular model and estimator rather than treated as interchangeable checks.

Common Mistake

Common mistake: “The coefficient for treatment is 3, so both the SNM and MSM estimate a treatment effect of 3.” This conclusion is unwarranted unless the models use the same scale, target population, and effect structure. An SNM coefficient may describe a conditional blip; an MSM coefficient may describe a population-average regime contrast. State the model, conditioning history, and target population before interpreting either coefficient.

Check Your Understanding

Answer each question by identifying the model’s target and the assumptions or modeling choices involved.

  1. In your own words, distinguish a treatment blip conditional on history from a marginal regime mean.
  2. In g-estimation, what role does \(P(A_t\mid H_t)\) play, and what does the blip model contribute?
  3. Why can the observed treated-control difference in the weighted example fail to equal the marginal causal contrast?
  4. When can constant sequential blips be summed directly to obtain a regime contrast?
  5. Does estimation of an MSM by inverse-probability weighting necessarily require a conditional outcome regression? Explain.
Clinical Biostats