Tutorials › Marginal Structural Models › Diabetes Treatment Intensification With Changing HbA1c

Case Studies · Tutorial 471 of 501

Diabetes Treatment Intensification With Changing HbA1c

Learn how to compare diabetes intensification strategies when changing HbA1c and renal function affect later treatment decisions.

Advanced 13 min read

What You'll Learn

  • Represent repeated intensification decisions and the clinical history available at each visit
  • Define dynamic diabetes treatment strategies using HbA1c and renal-function thresholds
  • State the assumptions needed to identify marginal complication risks under a strategy
  • Derive inverse-probability weights for adherence to a longitudinal strategy
  • Calculate and interpret weighted marginal risks, and recognize poor overlap

Why Changing HbA1c Creates a Longitudinal Problem

At a diabetes follow-up visit, a clinician may intensify treatment because HbA1c remains high. Renal function can affect which drugs are appropriate, at what dose, or whether a planned intensification is feasible. Both measurements also predict diabetic complications. After treatment changes, HbA1c and renal function may themselves change, influencing the next decision and the patient's later complication risk.

Thus, a measurement taken at one visit can be both a consequence of earlier treatment and a confounder of the next treatment decision. A conventional regression that adjusts for every observed HbA1c value may block part of treatment's effect through HbA1c; omitting HbA1c may leave later treatment decisions confounded. The longitudinal inverse-probability approach instead reweights treatment histories to compare specified strategies while preserving the distribution of intermediate clinical measurements those strategies would produce.

The analysis begins by fixing the visit schedule and temporal order. Let \(t=0,\ldots,K\) index treatment decisions, and let \(A_t\) equal 1 if treatment is intensified at visit \(t\), and 0 otherwise. Let \(L_t\) contain the measurements recorded before that decision, including HbA1c and renal function, and let \(V\) denote baseline covariates. The observed history just before decision \(t\) is \(H_t=(V,L_0,A_0,L_1,\ldots,A_{t-1},L_t)\). Let \(Y\) be the indicator of a diabetic complication by the prespecified end of follow-up.

An intensification is an action at a visit; it need not mean that previously added treatment is stopped at the next visit. The protocol must define what continued treatment means clinically. The outcome must also be defined over a fixed horizon. If death precludes observing the complication, the estimand should specify how that competing event is handled; it must not be silently treated as ordinary loss to follow-up.

Strategies and Identification Assumptions

Definition: A treatment strategy \(g\) specifies the action \(g_t(H_t)\) to take at each decision time, as a function of the history available before that decision. \(Y^g\) is the potential complication outcome if, at every visit, treatment followed strategy \(g\). The marginal risk under \(g\) is \(P(Y^g=1)=E[Y^g]\).

For example, a dynamic rule could intensify at a visit when HbA1c is at least 8% and estimated glomerular filtration rate (eGFR) is at least 30 mL/min/1.73 m², and not intensify otherwise. A comparison rule might defer new intensification throughout the horizon. These rules are illustrative, not universal clinical recommendations: a real protocol must define measurement timing, allowable drugs, contraindications, and what happens after a previous intensification.

Identification from observational data requires the following conditions. First, consistency: for a participant whose observed treatment decisions follow \(g\), the observed outcome equals \(Y^g\), with the treatment version sufficiently well-defined for this equality to be meaningful. Second, sequential exchangeability: at each visit, conditional on \(H_t\), the observed treatment decision is independent of the potential outcomes under the strategies being compared. In words, the recorded history must capture the common causes of that visit's intensification and later outcomes. Third, positivity: at histories that can occur under \(g\), the probability of taking the strategy's prescribed action is positive. There must be comparable observed patients who actually follow the rule. No interference between participants is also assumed.

These assumptions are substantive. HbA1c and renal function are central, but may not be sufficient: symptoms, medication adherence, clinician judgment, frailty, and access to care could influence both treatment and complications. If these are not adequately measured, weighting does not remove their confounding.

Deriving the Regime Weight

Write \(p_t(a\mid h)=P(A_t=a\mid H_t=h)\) for the observed treatment probability. For a deterministic strategy \(g\), define the indicator that a participant follows it through all decisions as \(I_g=\prod_{t=0}^{K} I\{A_t=g_t(H_t)\}\). The inverse-probability weight for that adherent history is

$$ W^g=\prod_{t=0}^{K} \frac{I\{A_t=g_t(H_t)\}} {p_t(g_t(H_t)\mid H_t)}. $$

A non-adherent participant has weight zero for this strategy. An adherent participant receives more weight when the observed treatment sequence was less likely given the measured history. With loss to follow-up, one also needs appropriately defined inverse-probability-of-censoring factors, conditional on the measured past, for remaining observed. The formula above is for complete outcome ascertainment.

Theorem: Suppose consistency, no interference, sequential exchangeability, positivity, and complete outcome ascertainment hold. Then for any deterministic strategy \(g\), $$ E[Y^g]=E[W^gY]. $$ For binary \(Y\), this identifies the marginal complication risk under \(g\).

Proof. For each history \(h_t\), let \(q_t(l_{t+1}\mid h_t,a_t)\) denote the observed conditional distribution of the next measurement, and let \(m(h_K,a_K)=E[Y\mid H_K=h_K,A_K=a_K]\). Under sequential exchangeability and consistency, these observed conditional distributions and outcome means equal the corresponding counterfactual mechanisms when the specified treatment actions are used. The distribution of histories under strategy \(g\) therefore starts with the observed baseline distribution and, at each visit, uses \(q_t(l_{t+1}\mid h_t,g_t(h_t))\); its expected outcome is obtained by integrating the final conditional mean \(m\) over those histories.

Now expand \(E[W^gY]\) over observed treatment and covariate histories. The observed-data factor for each treatment decision is \(p_t(a_t\mid h_t)\). The indicator in \(W^g\) restricts the sum to \(a_t=g_t(h_t)\), and division by \(p_t(g_t(h_t)\mid h_t)\) cancels that treatment factor. The remaining factors are the baseline distribution and the conditional measurement distributions \(q_t\) along the strategy, followed by the conditional outcome mean \(m\). This is exactly the integral defining \(E[Y^g]\). Positivity ensures the denominators are nonzero on histories with positive probability under \(g\). Hence \(E[W^gY]=E[Y^g]\). \(\square\)

Worked Examples

Worked Example: HbA1c and Renal Function Define a Dynamic Rule

Suppose visits occur at months 0 and 6. At each visit, the clinician may add or intensify medication (\(A_t=1\)) or not do so (\(A_t=0\)). Define a rule \(g_T\): intensify if HbA1c is at least 8% and eGFR is at least 30; otherwise do not intensify. A patient has HbA1c 9.1% and eGFR 52 at month 0, so the rule prescribes \(A_0=1\). At month 6, after that decision, the patient's HbA1c is 7.7% and eGFR is 48, so it prescribes \(A_1=0\).

The order matters. Month-0 measurements belong to \(H_0\) and determine the first action. Month-6 measurements are \(L_1\), recorded after \(A_0\) but before \(A_1\); they can be affected by the first action and still confound the second. The strategy uses each measurement only for the decision made after that measurement. It does not use the month-6 value to redefine the month-0 treatment.

This rule is a complete treatment policy only if the protocol also clarifies whether a prior addition remains in place when \(A_1=0\), and how contraindications or unavailable measurements are handled. Without these details, the same sequence \(A_0=1,A_1=0\) could correspond to different treatment versions and consistency would be questionable.

Worked Example: Calculate Weight for an Adherent History

For a patient following the month-0 and month-6 actions just described, suppose the fitted probabilities of the prescribed actions, conditional on the patient's histories, are \(p_0(1\mid H_0)=0.60\) and \(p_1(0\mid H_1)=0.25\). The patient follows both decisions, so

$$ W^{g_T}=\frac{1}{0.60}\times\frac{1}{0.25} =\frac{1}{0.15}=6.67. $$

The patient represents about 6.67 weighted copies of this observed adherent history in the regime-specific calculation. If the patient instead took \(A_1=1\), then \(I\{A_1=g_T(H_1)\}=0\), making the weight zero for this strategy. A large weight is not extra clinical benefit; it indicates that this adherent sequence was relatively uncommon among patients with that measured history.

For comparison, a strategy prescribing no intensification at both visits would assign this patient's observed sequence weight zero, since the patient intensified at month 0. A different patient with both actions equal to 0 would have weight \(1/[p_0(0\mid H_0)p_1(0\mid H_1)]\), using that patient's own history-specific probabilities.

Worked Example: Estimate a Marginal Risk From Weighted Outcomes

Consider a small illustrative sample with complete follow-up. Among participants whose observed histories adhere to strategy \(g_1\), suppose the weights and complication outcomes are \((2,1),(4,0),(2.5,1)\). The normalized weighted risk estimate is

$$ \widehat R(g_1)= \frac{2(1)+4(0)+2.5(1)}{2+4+2.5} =\frac{4.5}{8.5}=0.529. $$

For a comparison strategy \(g_0\), suppose its adherent histories have pairs \((1.25,0),(2,0),(1,1)\). Then

$$ \widehat R(g_0)= \frac{1.25(0)+2(0)+1(1)}{1.25+2+1} =\frac{1}{4.25}=0.235. $$

The estimated risk difference \(g_1-g_0\) is \(0.529-0.235=0.294\), or about 29.4 percentage points in this tiny illustration. These numbers are not clinical evidence: the sample is far too small for reliable inference. The calculation shows how each strategy has its own adherent histories and weights. In a large sample, the normalized weighted mean estimates a marginal risk; uncertainty estimation must also account for estimated treatment probabilities.

From Identification to an Estimate

In data, treatment probabilities are usually estimated from models for \(P(A_t=1\mid H_t)\), with the history including prior treatment and pre-decision HbA1c, renal function, and other confounders. The model must respect the visit ordering and allow the treatment probability to vary with clinically relevant history. For a deterministic strategy, calculate each participant's adherence indicator and weight, then estimate the strategy-specific risk by the normalized weighted mean:

$$ \widehat R(g)= \frac{\sum_{i=1}^{n} W_i^gY_i} {\sum_{i=1}^{n} W_i^g}. $$

The population identity in the theorem uses \(E[W^g]=1\); in a finite sample, estimated weights need not sum to \(n\). The normalized estimate above is often used to reduce finite-sample instability. It does not repair a misspecified treatment model or a violation of positivity. If censoring occurs, include the corresponding censoring weights and define clearly which participants contribute outcome information.

The treatment model is a tool for constructing a pseudo-population, not a model for the causal outcome contrast. Under the assumptions, within that weighted population treatment adherence to the strategy is no longer associated with measured prior history in the way it was in the original data. Marginal weighted risks can then be contrasted directly. The interpretation remains conditional on the strategy definitions, follow-up horizon, outcome definition, and assumptions.

Why the Weighting Works—and Where It Can Fail

Key takeaway: A later HbA1c or renal-function measurement can be affected by earlier treatment and confound the next treatment decision. Weighting by the probability of the observed strategy-following history accounts for this feedback without simply conditioning the final outcome comparison on those intermediate measurements.

A common mistake is to fit a single logistic regression for complications containing treatment, baseline covariates, and all follow-up HbA1c and eGFR measurements, then interpret the treatment coefficient as the total effect of sustained intensification. Those later measurements may lie on causal pathways from earlier treatment to complications. Conditioning on them can remove part of the effect being studied, while still failing to handle the treatment-confounding feedback correctly. The correction is not to omit all follow-up measurements: include relevant pre-decision measurements in the treatment-probability models and use the resulting longitudinal weights to estimate risks under explicitly defined strategies.

Diagnostics should focus on whether the weights are credible and the strategies supported by the data. Inspect the distribution of treatment probabilities at each visit, the number of observed histories adhering to each strategy, and the distribution of final weights. Very large weights often indicate that some clinical histories almost never receive the strategy-prescribed action. Compare weighted and unweighted summaries of measured histories at decision times; large remaining imbalances can signal model misspecification. Also verify that HbA1c and renal function were measured before each decision, and that the outcome horizon and censoring process are consistently defined.

If probabilities are near zero, the data contain little information about the relevant strategy in those histories. Truncating extreme weights can improve numerical stability, but changes the estimator and may introduce bias; it does not create missing overlap. A more defensible response may be to restrict the target population or revise the strategy to one that is clinically feasible and supported by observed treatment choices, while being explicit that the estimand has changed.

The marginal structural model approach is not the only option. The parametric g-formula models the evolving covariate and outcome distributions and simulates outcomes under a specified strategy; it avoids inverse treatment weights but relies on correctly specified models for those distributions. A standard outcome regression is simpler but can mishandle treatment-confounder feedback if it conditions directly on intermediate confounders. These approaches address the same longitudinal causal question through different modeling choices; none removes the need for consistency, adequate confounder measurement, and support for the strategies being compared.

Finally, an estimated contrast is not automatically a recommendation. A threshold rule that ignores contraindications may not be a meaningful intervention; unmeasured adherence or clinician judgment may undermine exchangeability; and severe renal impairment may leave no treatment overlap. Report the marginal risks alongside their contrast, uncertainty, strategy definitions, follow-up horizon, weight diagnostics, and the assumptions needed to interpret them causally.

Check Your Understanding

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

  1. At a visit, HbA1c is measured after the previous treatment decision but before the current one. Why can it be a confounder of current treatment and outcome while also being affected by prior treatment?
  2. Under a deterministic strategy, a patient takes a different action at one visit. What is that patient's adherence weight for that strategy, and why?
  3. If the prescribed action has probability 0.5 at each of three visits and a patient follows the rule at all three, calculate the treatment weight.
  4. Name two findings that would warn that positivity may be poor for a proposed diabetes strategy.
  5. Why might adjusting for every follow-up HbA1c measurement in a single outcome regression fail to estimate the total effect of a sustained treatment strategy?

Solutions. (1) Prior treatment may change HbA1c, while the measured HbA1c influences the current treatment decision and predicts later complications. (2) The weight is zero because the adherence indicator is zero for the non-prescribed action. (3) The weight is \(1/(0.5^3)=8\). (4) Examples include treatment probabilities near zero for prescribed actions, very large weights, or very few adherent patients. (5) Follow-up HbA1c may be a mediator of earlier treatment as well as a confounder of later treatment; conditioning on it can block part of the total effect without correctly resolving the longitudinal feedback.

Clinical Biostats