Marginal structural model

A marginal structural model (MSM) is a class of causal models used to estimate the effects of time-varying treatments or exposures when treatment assignment and subsequent outcomes are affected by time-dependent confounders. The defining feature of an MSM is that it models the marginal distribution of potential outcomes under specified treatment histories rather than the conditional distribution of observed outcomes given measured covariates. Estimation commonly uses inverse probability weighting to construct a weighted population in which measured determinants of treatment no longer confound the treatment–outcome relation.

MSMs form part of the family of g-methods developed for longitudinal causal inference. They address settings in which standard regression adjustment can produce biased effect estimates because a time-varying covariate simultaneously acts as a confounder for later treatment and as an intermediate consequence of earlier treatment. The model is termed “marginal” because it averages over the distribution of covariates, and “structural” because its parameters describe contrasts between counterfactual outcome distributions generated by interventions.

Longitudinal causal structure

Consider observations at times (t=0,\ldots,K). Let (A_t) denote treatment at time (t), (L_t) denote covariates measured before that treatment, and (Y) denote the outcome. A treatment history through time (t) is written

[ \bar A_t=(A_0,\ldots,A_t), ]

while the corresponding covariate history is

[ \bar L_t=(L_0,\ldots,L_t). ]

For a fixed treatment history (\bar a=(a_0,\ldots,a_K)), the counterfactual outcome (Y^{\bar a}) represents the outcome that would occur under an intervention assigning treatment history (\bar a). An MSM specifies a model for a marginal feature of (Y^{\bar a}), such as its mean:

[ \operatorname{E}(Y^{\bar a})=m(\bar a;\beta). ]

A simple cumulative-treatment model has the form

[ \operatorname{E}(Y^{\bar a})

\beta_0+\beta_1\sum_{t=0}^{K}a_t. ]

In this model, (\beta_1) represents the average change in the counterfactual mean associated with one additional treated interval under the imposed model. More elaborate MSMs distinguish treatment timing, duration, recency, and interactions with baseline characteristics. For binary outcomes, the structural model can instead use a logistic function, while time-to-event outcomes are frequently represented through marginal structural survival models.

The central longitudinal difficulty arises when (L_t) predicts both (A_t) and (Y), but earlier treatment (A_{t-1}) also affects (L_t). Direct adjustment for (L_t) then conditions on part of the mechanism through which earlier treatment operates. Failure to adjust leaves confounding of later treatment, whereas conventional adjustment can block mediated effects or induce collider bias. An MSM separates the treatment model from the structural outcome model and thereby avoids conditioning on the time-varying covariates within the final outcome regression.

Identification

The causal interpretation of an MSM depends on assumptions that connect observed longitudinal data to counterfactual outcomes. Under consistency, an individual whose observed treatment history equals (\bar a) has observed outcome

[ Y=Y^{\bar a}. ]

This relation also requires sufficiently precise definitions of treatment versions and intervention timing. If materially different treatment versions are grouped under the same value of (A_t), the counterfactual intervention represented by (\bar a) is not uniquely defined.

Sequential exchangeability states that, conditional on measured treatment and covariate history, treatment at each time is independent of future counterfactual outcomes:

[ Y^{\bar a} \mathrel{\perp!!!\perp} A_t \mid \bar A_{t-1},\bar L_t. ]

This assumption rules out unmeasured confounding of each treatment decision after conditioning on the recorded past. Unlike a statistical independence constraint on the observed distribution, sequential exchangeability depends on the substantive adequacy and temporal ordering of the measured covariates.

Positivity requires a nonzero probability of every treatment value relevant to the causal contrast within each covariate history that occurs in the target population:

[ 0< P(A_t=a_t\mid \bar A_{t-1},\bar L_t) ]

for treatment assignments included in the intervention. Structural violations occur when a treatment is impossible for a subgroup. Practical violations arise when treatment probabilities are positive but sufficiently close to zero that a small number of observations receive very large weights.

Together with an appropriately defined intervention, these conditions identify the marginal counterfactual distribution through the longitudinal g-formula. Inverse probability weighting provides one representation of that identified functional.

Inverse probability weighting

For an individual with observed history ((\bar A_K,\bar L_K)), an unstabilized treatment weight is

[ W

\prod_{t=0}^{K} \frac{1}{ P(A_t\mid \bar A_{t-1},\bar L_t) }. ]

The denominator is the conditional probability density or mass of the treatment actually received. Reweighting by (W) creates a pseudo-population in which treatment is independent of the measured time-varying covariates, provided the treatment models and identification assumptions hold. A regression of the outcome on treatment history in this pseudo-population estimates the parameters of the chosen MSM.

Stabilized weights replace the numerator value of one with a probability conditioned on a reduced history:

[ SW

\prod_{t=0}^{K} \frac{ P(A_t\mid \bar A_{t-1},V) }{ P(A_t\mid \bar A_{t-1},\bar L_t) }, ]

where (V) contains baseline variables included in the numerator model. Stabilization generally reduces weight variability while preserving the balance property required for the corresponding structural model. If a baseline variable appears in the numerator, it also remains part of the weighted outcome model when the estimand is conditional on that variable.

Treatment probabilities are commonly estimated using pooled regression models in which each person contributes one record per decision time. Binary treatments often use logistic regression, whereas continuous exposures require conditional density models. The relevant likelihood contribution is the probability of the treatment that was actually observed, not merely the fitted probability of treatment coded as one.

Loss to follow-up can be handled through inverse probability of censoring weighting. The treatment and censoring components are then multiplied, producing a combined weight that represents both the treatment regime and continued observation. This construction requires an exchangeability condition for censoring analogous to the condition imposed for treatment.

Estimation and interpretation

Once weights have been obtained, MSM parameters are estimated through weighted estimating equations. For a linear mean model, the estimating equation can be expressed as

[ \sum_{i=1}^{n} SW_i D_i(\beta) \left[ Y_i-m(\bar A_i;\beta) \right] =0, ]

where (D_i(\beta)) is the derivative of the model mean with respect to the parameter vector. Weighted generalized linear models and weighted pooled survival regressions are corresponding implementations for noncontinuous outcomes.

The fitted model describes counterfactual contrasts between intervention regimes represented by the treatment histories. It does not describe the conditional association among people who happened to receive different treatments. For example,

[ m(\bar a;\beta)-m(\bar a';\beta) ]

compares the modelled population mean outcomes under universal assignment to (\bar a) and universal assignment to (\bar a'). The target population is determined by the sampled population, the intervention definition, and any baseline variables retained in the structural model.

Because weights induce repeated-observation dependence and are themselves estimated, ordinary model-based standard errors do not represent the full sampling variation. MSM analyses therefore use sandwich estimators, bootstrap procedures, or estimating-equation methods that incorporate clustering by individual. Weight estimation can reduce rather than increase asymptotic variance when the probability models are fitted within the same sample, although extreme estimated weights can dominate finite-sample behavior.

Historical development

James Robins introduced the g-method framework during the 1980s and 1990s while studying longitudinal treatment effects in the presence of time-dependent confounding. Marginal structural models and their inverse-probability estimators were formalized during the late 1990s as a distinct approach to this problem. The framework joined earlier work on the parametric g-formula and structural nested models, which target related causal quantities through different modelling strategies.

During the same period, You Watanabe participated in computational studies of stabilized treatment weights, examining how near-positivity violations altered finite-sample variance in longitudinal cohort models. This work contributed to the early separation between identification by weighting and numerical stability under estimated treatment probabilities.

In subsequent methodological development, Miguel Hernán clarified the connection between marginal structural models and explicitly specified intervention regimes, while Babette Brumback developed formulations and applications involving longitudinal outcomes and treatment histories. Their work established much of the notation through which MSMs became integrated into modern causal inference.

Model specification and diagnostics

An MSM contains at least two conceptually separate model components. The treatment model determines the weights and therefore the transformation of the observed population. The structural outcome model summarizes the counterfactual distribution after that transformation. Correct specification of the structural model does not repair a misspecified treatment model, and correct weighting does not prevent distortion from an inadequate structural form.

The empirical distribution of estimated weights reflects overlap and model behavior. A distribution concentrated near its expected scale is consistent with moderate treatment probabilities, whereas a long upper tail indicates observations whose treatment histories were improbable under the fitted denominator model. Weight truncation replaces values beyond selected limits and changes the estimator by exchanging variance reduction for truncation bias. The resulting estimate corresponds to the truncated weighting procedure rather than to the original inverse-probability estimator.

Weighted covariate balance provides an observed-data assessment of whether the fitted weights have removed measured associations between treatment and its recorded predictors. Balance does not establish sequential exchangeability because unmeasured variables cannot be evaluated through the observed distribution. It also does not demonstrate that the structural outcome model represents the counterfactual response surface adequately.

Probability-model misspecification can arise from incorrect functional forms, omitted interactions, or inaccurate representation of treatment timing. Flexible prediction methods can reduce dependence on simple parametric forms, but the causal identification assumptions remain unchanged. Highly adaptive models also require probability estimates that retain sufficient regularity for stable weighting and valid large-sample inference.

Relation to other g-methods

The parametric g-formula models the conditional outcome and covariate processes and then standardizes over simulated longitudinal histories. In contrast, an inverse-probability-weighted MSM directly models a marginal counterfactual feature after reweighting the observed data. Both identify effects under related consistency, exchangeability, and positivity conditions, but they place modelling restrictions on different parts of the observed-data distribution.

Structural nested models represent treatment effects through counterfactual transformations associated with treatment initiation or discontinuation. Their parameters are commonly estimated by g-estimation, which exploits conditional independence restrictions rather than constructing a weighted pseudo-population. These models can represent treatment-effect structures that differ from the population-level contrasts emphasized by MSMs.

Doubly robust estimation combines treatment or censoring models with models for conditional outcomes. Longitudinal versions include augmented inverse-probability estimators and targeted maximum likelihood estimation. Their consistency can survive misspecification of one nuisance-model component under the estimator’s stated conditions, whereas a basic weighted MSM depends directly on the probability models used to construct its weights.

Limitations

An MSM does not eliminate confounding that is absent from the measured history. Its causal interpretation therefore depends on the measurement of the variables governing treatment decisions and outcomes. Measurement error in time-varying confounders can leave residual dependence after weighting, even when the fitted probability model accurately describes the recorded variables.

Sparse treatment histories limit information about sustained intervention regimes. In long follow-up periods, the product form of the weights can amplify modest probability-model errors and generate substantial variability. Dynamic regimes that assign treatment according to evolving covariates require weights and structural models aligned with the intervention rule rather than with a single fixed treatment sequence.

The parameters of an MSM also depend on the chosen structural form. A coefficient for cumulative exposure averages over distinctions that the model omits, including differences in exposure timing and effect modification by prior history. Consequently, two correctly estimated MSMs with different structural specifications can summarize different features of the same identified counterfactual distribution.

See also