Why Estimate a Marginal Glycemic Trajectory?
In a longitudinal diabetes study, HbA1c is measured repeatedly while treatment decisions change over time. A patient’s current HbA1c, symptoms, or other clinical history may influence the next treatment decision, and may itself have been affected by earlier treatment. Simply comparing patients who remain on treatment with those who do not can therefore mix treatment effects with differences in their evolving health.
A marginal structural model (MSM) can target a population-level mean HbA1c trajectory under specified treatment strategies. For example, the strategies might be sustained treatment at every decision or no treatment at every decision. The target is the mean outcome that would be seen if the population followed each strategy, not the mean among the observed patients who happened to follow it.
For clarity, let \(H_s\) be the information available just before decision \(s\): baseline covariates and the observed treatment and covariate history up to that decision. In particular, \(H_s\) can include a time-varying confounder, such as current HbA1c, that was affected by earlier treatment. Write \(q_s(a\mid H_s)=P(A_s=a\mid H_s)\) for the conditional probability of the observed treatment.
The weight is a product over decisions, not a single baseline adjustment. Its purpose is to reweight observed histories so that, under the assumptions below, the weighted outcome mean represents the mean under the specified strategy. The strategy may be static, such as \(A_s=1\) at all decisions, or may prescribe treatment as a function of the history.
Identification and Estimation
The interpretation of the weighted mean depends on assumptions. First, consistency requires that a person whose observed treatment history follows \(g\) has observed outcome \(Y_t=Y_t^g\), with treatment versions sufficiently well defined. Second, sequential exchangeability requires that, at each decision, treatment is independent of the relevant future potential outcomes under the strategy, conditional on \(H_s\). This rules out unmeasured confounding at each treatment decision. Third, positivity requires \(q_s\{g_s(H_s)\mid H_s\}>0\) for histories that can arise under the strategy and contribute to the target population. Also assume independent sampling of participants and well-defined measurements at the times being analyzed.
With the true treatment probabilities, a weighted mean at time \(t\) is estimated by the weighted ratio \(\hat\mu_g(t)=\sum_{i=1}^n W_{it}^gY_{it}/\sum_{i=1}^n W_{it}^g\). The ratio form is useful in finite samples: it normalizes the realized weights. If all participants have complete follow-up and the probabilities are known, its large-sample target is \(E[Y_t^g]\).
To see the identification, factor the observed-data distribution into the baseline distribution, the successive conditional distributions of covariate histories, the treatment probabilities \(q_s\), and the final outcome distribution. In the expectation of \(W_t^gY_t\), the indicator at each decision restricts treatment to the strategy, while its inverse probability cancels the corresponding factor \(q_s\). The resulting integral is over histories generated with treatment set to \(g\) at each decision. Consistency and sequential exchangeability identify the final outcome distribution in that integral with the distribution of \(Y_t^g\). Integrating the covariate histories therefore gives \(E[Y_t^g]\). Positivity ensures the cancellation is defined wherever the strategy’s history distribution has support.
The weight normalization has a direct iterated-expectation proof. Conditional on \(H_s\), the conditional expectation of the treatment factor is \(E[I\{A_s=g_s(H_s)\}/q_s\{g_s(H_s)\mid H_s\}\mid H_s]=1\). Starting with the last decision, integrate this factor conditional on its history. The earlier factors are measurable with respect to that history, so they remain outside the conditional expectation. Repeating this step backward through all decisions leaves the expectation of 1, hence \(E[W_t^g]=1\). This argument does not replace the weighted numerator’s expectation with a ratio of probabilities; it integrates each treatment factor conditional on its own history.
For the convergence claim, the weak law of large numbers gives \(n^{-1}\sum_i W_{it}^gY_{it}\xrightarrow{p}E[W_t^gY_t]=E[Y_t^g]\) and \(n^{-1}\sum_i W_{it}^g\xrightarrow{p}E[W_t^g]=1\). Since the denominator limit is nonzero, the continuous mapping theorem gives \(\hat\mu_g(t)\xrightarrow{p}E[Y_t^g]\). If probabilities are estimated rather than known, consistency of the resulting estimate requires suitable conditions on that estimation as well; the argument here establishes the target for the true weights. \(\square\)
Worked Example: A Two-Decision Weight
Consider the sustained strategy \(A_0=1,A_1=1\). Suppose \(P(A_0=1)=0.5\), and at the second decision the probability of treatment is 0.25 for a high-\(L_1\) history and 0.50 for a low-\(L_1\) history. Two people in a four-person sample follow the strategy through the second decision:
| Person | \(L_1\) | \(A_0,A_1\) | \(Y_2\) | \(W_2^g\) |
|---|---|---|---|---|
| 1 | High | 1, 1 | 8 | \(1/(0.5\times0.25)=8\) |
| 2 | Low | 1, 1 | 7 | \(1/(0.5\times0.50)=4\) |
| 3 | High | 1, 0 | 9 | 0 |
| 4 | Low | 0, 1 | 8 | 0 |
People 3 and 4 have zero contribution because their observed treatment histories do not follow both decisions in \(g\). The weighted mean is \((8\times8+4\times7)/(8+4)=(64+28)/12=92/12\approx7.67\). This is the sample estimate under the stated strategy and probabilities. It is not an assertion that the true population mean is exactly 7.67; with only two contributing people, sampling variation may be substantial.
Building and Reading a Trajectory
A trajectory is obtained by estimating the marginal mean separately at each outcome time, using the treatment history required to reach that time. Thus, the weights can differ across time: a later outcome requires agreement with more treatment decisions and uses more factors in the product. The target remains the same kind of quantity at every time, \(E[Y_t^g]\), but each time-specific estimate has its own observed contributors and precision.
Worked Example: Calculating Two Follow-Up Means
Suppose, for illustration, that the positive weights for people following a strategy are as follows. At the first follow-up, weights are 2, 4, and 2, and their HbA1c values are 9, 8, and 7. At the second follow-up, only two people have followed the strategy through the additional decision; their weights are 4 and 8 and their HbA1c values are 8 and 6.
At the first follow-up, the weighted total is \(2(9)+4(8)+2(7)=18+32+14=64\), and the total weight is \(2+4+2=8\). The weighted mean is \(64/8=8.00\).
At the second follow-up, the weighted total is \(4(8)+8(6)=32+48=80\), and the total weight is \(4+8=12\). The weighted mean is \(80/12\approx6.67\). The two estimates form points on an estimated marginal trajectory. Because the later estimate uses a different set of observed histories and weights, the change from 8.00 to 6.67 is not simply the average within-person change among the same individuals.
Worked Example: Interpreting a Strategy Contrast
Suppose an analysis estimates mean HbA1c at 12 months as 7.4 under sustained treatment and 8.1 under sustained no treatment. The marginal contrast, defined as the first strategy minus the second, is \(7.4-8.1=-0.7\) percentage points.
Under the identification assumptions, this estimates a population-level difference in mean 12-month HbA1c between the two specified strategies. The negative sign means the sustained-treatment strategy has a lower estimated mean. It does not mean every individual’s HbA1c would fall by 0.7 points, nor does it describe the effect among only those who actually stayed on treatment. A clinical interpretation also requires that the strategies, follow-up time, and population are clearly stated.
Diagnostics, Alternatives, and Limitations
Diagnostics cannot prove the assumptions, but they can reveal problems that make the weighted estimate hard to trust. At each time, inspect the distribution of positive weights, the number of people contributing to the strategy, the total weight, and whether a few observations dominate the weighted mean. Check that treatment models use the relevant pre-decision history and that the estimated probabilities are compatible with observed treatment patterns. When follow-up is incomplete, distinguish loss to follow-up from treatment deviation: treatment weights alone do not correct informative censoring. Additional censoring weights require their own assumptions and models.
The weighted approach is especially useful when time-varying confounders are affected by prior treatment: ordinary regression adjustment for those variables can change the causal target or fail to handle the treatment-confounder feedback appropriately. A conventional outcome regression may instead condition on covariates and estimate conditional associations. The parametric g-formula is another alternative: model the covariate and outcome distributions, then simulate outcomes under each strategy. These methods have different modeling requirements; none removes the need for exchangeability, positivity, and consistency. The MSM approach’s key advantage here is that it targets marginal means through treatment weighting, while its limitations include dependence on correct treatment probability models and potentially unstable estimates when support is limited.
A useful interpretation discipline is to name the strategy, outcome time, and scale together: “the estimated marginal mean HbA1c at 12 months under sustained treatment.” This avoids conflating the strategy-specific mean with an observed-group average. It also makes clear that the result applies to the population and treatment options for which the assumptions and support are credible.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- At one treatment decision, the probability of receiving the strategy’s treatment given history is 0.40. What is the weight factor for a person who receives it, and what is the factor for a person who does not?
- Why can a time-varying HbA1c measure be a confounder at a later decision and still be affected by earlier treatment?
- At a follow-up time, two strategy-adherent people have weights 3 and 1 and outcomes 7 and 9. Calculate the weighted mean.
- What assumptions are needed before interpreting a weighted mean as \(E[Y_t^g]\)?
Solutions. (1) The adherent person’s factor is \(1/0.40=2.5\); the nonadherent person’s indicator is zero, so their factor is 0. (2) Earlier treatment may change HbA1c, while current HbA1c may affect the next treatment decision and future HbA1c; this is treatment-confounder feedback. (3) The weighted mean is \(\{3(7)+1(9)\}/(3+1)=30/4=7.5\). (4) The key assumptions are consistency, sequential exchangeability conditional on the measured histories, and positivity for the strategy at histories that contribute to its target population. The treatment probabilities must also be correctly specified for the stated weighted identification argument.