Tutorials › Marginal Structural Models › Balance Diagnostics Over Follow-Up

Diagnostics and Sensitivity to Misspecification · Tutorial 266 of 501

Balance Diagnostics Over Follow-Up

Build time-indexed balance diagnostics that show when weighted covariate balance deteriorates during longitudinal treatment assignment.

Advanced 12 min read

What You'll Learn

  • Define which covariates and histories are eligible for balance checks at each treatment time.
  • Distinguish cumulative weights from weights that are appropriate for a particular time-point diagnostic.
  • Derive why inverse-probability weighting targets balance in measured pre-treatment history.
  • Organize time-indexed summaries to reveal when imbalance begins or worsens.
  • Interpret stabilized-weight diagnostics in light of their numerator variables.
  • Recognize failure patterns that a single pooled balance summary can hide.

Why Balance Must Be Followed Over Time

In a longitudinal study, treatment is assigned repeatedly. A weight that looks adequate at the end of follow-up can conceal a problem that arose at an earlier treatment decision, while a pooled summary can hide a temporary but consequential imbalance. The diagnostic question is therefore not only whether covariates are balanced after weighting, but which covariates are balanced at which treatment times.

Let \(A_t\) denote treatment at time \(t\), and let \(L_t\) denote covariates measured before that treatment decision. Write \(\bar A_{t-1}=(A_1,\ldots,A_{t-1})\) and \(\bar L_t=(L_1,\ldots,L_t)\). The measured information available immediately before \(A_t\) is the treatment history and covariate history through that point. A diagnostic at time \(t\) should use only information measured before \(A_t\); outcomes and covariates measured afterward cannot diagnose balance for that decision.

Definition: A time-indexed balance diagnostic is a collection of weighted comparisons, one for each treatment time \(t\), between levels of \(A_t\) on covariates measured before \(A_t\). The summaries are organized by time and covariate so that changes in balance during follow-up remain visible.

The introductory material on covariate balance as a weight diagnostic establishes why post-weighting balance matters. Here the emphasis is its longitudinal organization. At time \(t\), summarize balance for baseline covariates and relevant time-varying covariates \(L_s\), \(s\leq t\), that are part of the measured pre-treatment history. A useful display has one row per time-covariate pair and includes both the unweighted and weighted summaries.

Weights and the Time Point Being Diagnosed

For a discrete treatment, let \(g_s(A_s\mid \bar A_{s-1},\bar L_s)\) be the conditional probability of the observed treatment at time \(s\), given measured history immediately before that assignment. A stabilized treatment weight through time \(t\) has the form

$$ W_t=\prod_{s=1}^{t} \frac{q_s(A_s\mid \bar A_{s-1},V)} {g_s(A_s\mid \bar A_{s-1},\bar L_s)}, $$

where \(V\) denotes selected baseline variables and \(q_s\) is the numerator probability used to stabilize the weight. For an unstabilized weight, take \(q_s=1\). When diagnosing the assignment at time \(t\), use the cumulative weight through \(t\): the factor for \(A_t\) is needed to assess whether weighting has addressed measured history relevant to that decision. For a description of covariate distributions just before \(A_t\), the weight through \(t-1\) describes the population after previous treatment weighting; it does not, by itself, diagnose the current assignment.

The distinction is useful in practice. A report can show the distribution of \(L_t\) in the weighted population before the current assignment, and separately compare that covariate across levels of \(A_t\) using \(W_t\). These answer different questions. The second comparison assesses the current treatment decision; the first describes the population entering it.

The usual interpretation requires consistency, no interference between individuals, sequential exchangeability given the measured history, and positivity: every treatment level under consideration must have positive probability at each relevant history. For the balance identity below, treatment probabilities must be correctly specified and finite, and the relevant weighted expectations must exist. These assumptions make the diagnostic interpretable; balance summaries cannot verify them, especially the absence of unmeasured confounding.

Worked Example: Calculating a Balance Summary at One Time

At time \(t=2\), compare a binary covariate \(X\), measured before \(A_2\), between \(A_2=1\) and \(A_2=0\). Suppose the observed \(X\) values and cumulative weights \(W_2\) are:

Current treatment\(X\) values\(W_2\) values
\(A_2=1\)0, 1, 12, 1, 1
\(A_2=0\)0, 0, 11, 2, 1

The weighted mean of a binary variable is its weighted proportion. For \(A_2=1\), the total weight is \(2+1+1=4\), and the weighted sum of \(X\) is \(2(0)+1(1)+1(1)=2\). Thus the weighted mean is \(2/4=1/2\). For \(A_2=0\), the total weight is \(1+2+1=4\), and the weighted sum is \(1(0)+2(0)+1(1)=1\), giving \(1/4\). The weighted difference, defined as the mean for \(A_2=1\) minus the mean for \(A_2=0\), is \(1/2-1/4=1/4\).

The same calculation without weights gives means \(2/3\) and \(1/3\), a difference of \(1/3\). Weighting reduced this particular difference from \(1/3\) to \(1/4\), but it did not eliminate it. The correct report preserves the time label and covariate label: this is the weighted difference in \(X\) between current treatment groups at time 2, not a general statement that “balance is good.”

A Population Balance Identity

The reason to examine current treatment groups is expressed by a population identity. First consider unstabilized weights. Write \(H_t=(\bar A_{t-1},\bar L_t)\) for the measured history before \(A_t\), and let \(W_{t-1}=\prod_{s=1}^{t-1}1/g_s(A_s\mid\bar A_{s-1},\bar L_s)\), with \(W_0=1\).

Theorem: Suppose \(P(A_t=a\mid H_t=h)=g_t(a\mid h)>0\) for each treatment level \(a\) and relevant history \(h\), and the weighted expectations below are finite. Under the population distribution reweighted by \(W_t=W_{t-1}/g_t(A_t\mid H_t)\), the distribution of \(H_t\) is the same in every current-treatment group \(A_t=a\), after normalization.

Proof. Let \(B\) be any measurable set of histories. Under the original distribution, the weighted mass for \(H_t\in B\) and \(A_t=a\) is

$$ E\!\left[ W_{t-1}\frac{I(A_t=a)}{g_t(A_t\mid H_t)}I(H_t\in B) \right] = E\!\left[ W_{t-1}I(H_t\in B) E\!\left\{\left. \frac{I(A_t=a)}{g_t(A_t\mid H_t)} \right|H_t,\bar A_{t-1},\bar L_{t-1}\right\} \right]. $$

Because \(H_t\) contains the conditioning history and \(P(A_t=a\mid H_t)=g_t(a\mid H_t)\), the inner conditional expectation is \(g_t(a\mid H_t)/g_t(a\mid H_t)=1\). Therefore the weighted mass is \(E[W_{t-1}I(H_t\in B)]\), which does not depend on \(a\). Taking \(B\) to be the full history space shows that each treatment group has the same total weighted mass as well. Dividing the mass for any \(B\) by this common total proves equality of the normalized history distributions across treatment levels. \(\square\)

This is a population result, not a promise that every empirical summary will be exactly equal. Sampling variation, estimated treatment probabilities, and limited overlap can leave residual differences. Further, with stabilized weights the numerator factors matter: if \(q_t\) depends on baseline variables or past treatment, the target is generally balance conditional on those numerator variables, rather than unconditional equality of every history distribution. Diagnostics should state the comparison being made and account for the numerator variables.

Worked Example: A Balance Pattern That Changes Over Follow-Up

Suppose a binary covariate \(X\) is measured before each treatment decision. The weighted differences in its means, treatment 1 minus treatment 0, are \(0.06\) at time 1, \(0.31\) at time 2, and \(0.08\) at time 3. These are already computed using the cumulative weights appropriate to each time.

The maximum absolute difference is \(\max(|0.06|,|0.31|,|0.08|)=0.31\), occurring at time 2. The time-averaged signed difference is \((0.06+0.31+0.08)/3=0.45/3=0.15\). That average is less informative: it does not identify the time-2 deterioration, and signed differences can cancel. A time-indexed report therefore retains the three separate values and flags time 2 for follow-up.

The next diagnostic step is to inspect the relevant treatment probabilities, weights, and weighted covariate distributions at time 2. This pattern alone does not establish why balance worsened, nor does it show whether the treatment model is misspecified. It does locate when the problem is most apparent.

How to Organize and Read the Diagnostics

A compact balance table can include time, covariate, treatment contrast, unweighted summary, weighted summary, and—when stabilization is used—the numerator variables defining the comparison. For a continuous covariate, report a difference in means and a suitable distributional summary; for a binary covariate, report a weighted proportion difference. Standardized differences, higher-moment comparisons, and empirical-cdf comparisons can supplement these summaries, using the same time indexing.

Do not collapse the entire table into one average. A time-specific maximum absolute discrepancy is a useful flag, but it is a screening summary, not a universal pass/fail test. The pattern across time matters: gradual growth, a single sharp departure, and persistent imbalance at all times call for different investigation. Nor should diagnostics include only the most recent covariate. A past covariate can remain part of the history relevant to a later treatment decision.

Worked Example: Why a Pooled Summary Can Conceal Imbalance

Suppose a baseline covariate \(V\) defines two strata, and a weighted mean difference in \(X\) is calculated separately within each stratum at a given follow-up time. In \(V=0\), the weighted mean of \(X\) is 2 for \(A_t=1\) and 1 for \(A_t=0\), so the difference is \(2-1=1\). In \(V=1\), the corresponding means are 4 and 5, giving \(4-5=-1\).

If the two stratum-specific differences are averaged with equal weights, the result is \(\{1+(-1)\}/2=0\). That zero does not mean the covariate is balanced within either stratum: each stratum has an absolute difference of 1. The appropriate report retains the two conditional results, especially when \(V\) is a numerator variable in stabilized weights. This example also explains why the target of the diagnostic must be explicit: a marginal comparison and a comparison conditional on \(V\) are not interchangeable.

Failure Modes, Alternatives, and Limits

  • Using the wrong time’s weight. \(W_{t-1}\) describes weighting through previous assignments; it omits the factor for the current assignment. For current treatment-group balance, use \(W_t\).
  • Including variables measured after treatment. A post-\(A_t\) variable cannot be a pre-treatment balance target for \(A_t\). Doing so changes the question and can condition on a consequence of treatment.
  • Reporting only an overall summary. An average can obscure a sharp time-specific imbalance or let positive and negative differences cancel. Keep the time-by-covariate summaries visible.
  • Expecting stabilized weights to balance everything marginally. The numerator defines retained structure in the weighted target. State its variables and examine balance in the corresponding conditional comparisons.
  • Treating balance as proof of validity. Good measured-covariate balance does not establish exchangeability, correct measurement, or adequate positivity. Poor overlap can also make weighted summaries unstable or unrepresentative.

An alternative is to inspect treatment-probability overlap or weight distributions at each time. These diagnostics can help identify sparse support or extreme weights, but they answer different questions: overlap concerns available support, whereas balance concerns the measured covariate distributions after weighting. Effective sample size and influence diagnostics are also complementary, not substitutes. Finally, truncating weights may reduce instability while changing balance; after any truncation, recompute and report the time-indexed summaries.

The main limitation is that empirical balance is a diagnostic of measured variables in the observed sample. It cannot guarantee balance in unmeasured confounders, and later treatment times may have few observations in some histories. A deterioration may reflect limited support, model error, sampling noise, or some combination. The time-indexed table is valuable because it narrows where to investigate, not because it identifies the cause by itself.

Check Your Understanding

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

  1. At time 3, which cumulative weight is used to compare covariates measured before \(A_3\) across current \(A_3\) groups?
  2. Why can the average of signed balance differences across times be misleading?
  3. For the weighted means 3.4 and 2.9 in treatment groups 1 and 0, respectively, what is the difference under the convention used here?
  4. What does the population balance identity require, and what does it not establish?

Solutions. (1) Use \(W_3\), which includes the inverse-probability factor for the current assignment as well as prior factors. (2) Differences with opposite signs can cancel, and an average can conceal a large discrepancy at one time; inspect each time-specific value and the maximum absolute discrepancy as well. (3) The difference is \(3.4-2.9=0.5\). (4) It requires correctly specified positive treatment probabilities, the stated weighting construction, and finite relevant expectations. It establishes equality of measured-history distributions in the population reweighted by unstabilized weights; it does not prove empirical equality, eliminate unmeasured confounding, or verify positivity and model correctness from the data alone.

Clinical Biostats