Tutorials › Propensity Score Matching and Instrumental Variables › A Worked Balance-Diagnostic Workflow

Balance Diagnostics · Tutorial 288 of 699

A Worked Balance-Diagnostic Workflow

Learn to move systematically from balance summaries to graphical and joint-distribution checks, then report what the diagnostics do—and do not—establish.

Intermediate 12 min read

What You'll Learn

  • Calculate standardized mean differences for continuous and binary covariates
  • Use quantiles and empirical distribution functions to find differences hidden by means
  • Interpret a multivariate balance summary without treating it as a universal pass/fail test
  • Check interactions, nonlinearities, sparse categories, and missingness in context
  • Report remaining imbalances and distinguish observed balance from exchangeability

Why a Workflow Matters

A single balance statistic cannot summarize every feature of a covariate distribution. Two groups can have similar means but different tails; they can have similar marginal distributions but different interactions; and a single joint-distance statistic can conceal which covariate is responsible for a discrepancy. A useful assessment therefore proceeds in a deliberate sequence: define the comparison, summarize marginal differences, inspect distributional shape, check joint structure, and report any meaningful residual imbalance.

Let \(D_i=1\) denote treatment and \(D_i=0\) denote control for unit \(i\), and let \(X_i\) be the vector of measured pretreatment covariates. The comparison may be between matched groups or between weighted groups. In either case, diagnostics describe the covariate distributions represented by the final analysis sample and its weights. They do not by themselves establish that treated and control units are exchangeable with respect to unmeasured factors.

Definition: A balance diagnostic compares the distributions of measured pretreatment covariates across treatment groups, after the selected matching or weighting procedure. Balance is a property of those observed covariate distributions under the specified comparison and target population; it is not a test of whether treatment assignment was unconfounded.

Before calculating anything, specify the treatment groups, the analysis sample, the target population, and the weights used in each group. Use the same choices throughout the diagnostic sequence. If weights are used, calculate summaries using those weights and state the weight convention. Also verify that covariates are measured before treatment and coded consistently in both groups. Including a post-treatment variable can introduce bias rather than diagnose baseline balance.

Begin With Covariate Summaries

For a continuous covariate, a common summary is the standardized mean difference (SMD). With unweighted groups, define \(\bar{x}_1\) and \(\bar{x}_0\) as the group means and \(s_1\) and \(s_0\) as the group standard deviations. A commonly used denominator is the square root of the average of the two group variances:

$$ \operatorname{SMD} = \frac{\bar{x}_1-\bar{x}_0} {\sqrt{(s_1^2+s_0^2)/2}}. $$

The SMD expresses the mean difference in units of a standard deviation. It is dimensionless, and its sign indicates which group has the larger mean. For a binary covariate, use the group proportions \(\hat{p}_1\) and \(\hat{p}_0\); a conventional denominator is the square root of the pooled proportion's variance:

$$ \operatorname{SMD}_{\mathrm{binary}} = \frac{\hat{p}_1-\hat{p}_0} {\sqrt{\bar{p}(1-\bar{p})}}, \qquad \bar{p}=\frac{\hat{p}_1+\hat{p}_0}{2}. $$

For weighted analyses, replace means and proportions with their weighted counterparts. Decide in advance how the standardizing scale will be defined. A fixed reference scale, often calculated from the original sample, makes before-and-after SMDs easier to compare; changing the denominator after weighting can change the apparent size of an imbalance even when the mean difference has not changed. SMDs are descriptive, not significance tests. A threshold such as 0.1 is sometimes used as a screening convention, not as a universal guarantee of adequate balance.

Worked Example: Summarizing Three Baseline Covariates

Suppose a hypothetical matched sample contains 100 treated and 100 control units. Age has means 52 and 50 years, respectively, with standard deviations of 10 years in both groups. A severity score has means 6.2 and 5.2 points, with standard deviations of 5 points in both groups. Smoking prevalence is 30% among treated units and 24% among controls.

Age. The standardizing denominator is \(\sqrt{(10^2+10^2)/2}=10\) years. Thus \(\operatorname{SMD}=(52-50)/10=0.200\). The treated group is higher by 0.200 pooled standard deviations.

Severity score. The denominator is \(\sqrt{(5^2+5^2)/2}=5\) points. Thus \(\operatorname{SMD}=(6.2-5.2)/5=0.200\). The mean difference is 1.00 score point, or 0.200 standard deviations.

Smoking. Here \(\bar{p}=(0.30+0.24)/2=0.27\), so the denominator is \(\sqrt{0.27(1-0.27)}=\sqrt{0.1971}\approx0.444\). Therefore \(\operatorname{SMD}_{\mathrm{binary}}=(0.30-0.24)/0.444\approx0.135\). All three summaries show residual differences in the treated group’s direction. They flag what merits inspection, but do not determine whether those differences are consequential for a particular outcome analysis.

Inspect Distributional Shape, Not Only Means

Next, compare quantiles and empirical distribution functions for important continuous covariates. A quantile-quantile plot places corresponding group quantiles against one another. If the distributions are similar, points tend to follow the equality line; systematic curvature or deviations at the ends indicate differences in spread, shape, or tails. An empirical distribution function (ECDF) at a value \(x\) is the fraction of observations at or below \(x\). Comparing the two ECDF curves reveals where one group accumulates more observations than the other.

These displays can expose discrepancies that a mean and SMD miss. A maximum vertical separation between ECDFs is one possible summary, but it is only a description of the largest observed difference across thresholds. It does not identify whether that difference matters substantively, and a formal test should not be used as the balance decision rule. Sample size affects test significance, while practical balance is about the size and structure of covariate differences.

Worked Example: A Tail Difference Hidden by Similar Means

Consider two hypothetical groups with ten age values each. The treated ages are 20, 22, 24, 26, 28, 30, 32, 34, 36, and 38 years. The control ages are 20, 22, 24, 26, 28, 30, 32, 34, 36, and 48 years.

The treated mean is \(290/10=29.0\) years; the control mean is \(300/10=30.0\) years. A mean comparison therefore gives a difference of \(-1.00\) year, but the last control observation is notably higher. At age 38, the treated ECDF is \(10/10=1.00\), whereas the control ECDF is \(9/10=0.900\). Their vertical difference is \(1.00-0.900=0.100\). At the other listed ages up to 36, both ECDFs agree. The distributional comparison thus makes the upper-tail discrepancy visible even though the means differ by only one year. In a real analysis, the plot and the substantive range of age would inform whether this tail difference is important; this small illustration is not a threshold-based decision rule.

Check Joint Structure and Prespecified Features

Marginal comparisons do not establish that the joint distribution of covariates is similar. Inspect covariate interactions and meaningful subgroups, and check nonlinear features when they are relevant to the design or outcome model. Examples include age squared, an age-by-severity interaction, or a clinically defined severity category. This is not an invitation to search indefinitely for a favorable diagnostic: choose scientifically justified features and report what was checked.

A multivariate distance can summarize differences in covariate means while accounting for covariance among covariates. For a two-variable illustration, let \(\boldsymbol{\Delta}\) be the treated-minus-control vector of mean differences and let \(S\) be a reference covariance matrix. The squared Mahalanobis distance is \(\boldsymbol{\Delta}^{T}S^{-1}\boldsymbol{\Delta}\). It is a joint location summary, not a complete comparison of distributions: it does not alone reveal tail differences, interactions, or sparse categories. Its interpretation also depends on the reference covariance matrix and the covariates included.

Worked Example: A Joint Mean-Difference Summary

Suppose two continuous covariates have treated-minus-control mean differences of 2 years for age and 1 point for a severity score, so \(\boldsymbol{\Delta}=(2,1)^T\). For this hypothetical illustration, take the reference covariance matrix to be \(S=\begin{pmatrix}100&60\\60&100\end{pmatrix}\). Its determinant is \(100(100)-60(60)=6400\), so \(S^{-1}=(1/6400)\begin{pmatrix}100&-60\\-60&100\end{pmatrix}\).

The squared distance is \(\boldsymbol{\Delta}^{T}S^{-1}\boldsymbol{\Delta} =(1/6400)\{100(2^2)-120(2)(1)+100(1^2)\}\). The expression in braces is \(400-240+100=260\), giving \(260/6400=0.040625\). The Mahalanobis distance is therefore \(\sqrt{0.040625}\approx0.202\). This number summarizes the joint mean displacement relative to the stated covariance scale; it is not a probability, a test result, or a universal pass/fail score. The marginal differences should still be reported because they show which variables contribute to the imbalance.

Also inspect rare categories, sparse covariate combinations, and missingness. A small overall SMD can conceal a consequential mismatch in a rare but important subgroup. Conversely, a category represented by very few units can produce unstable summaries. Report the relevant counts, not only standardized statistics. If survey weights are involved, use summaries consistent with the survey-weighted target and describe any extreme weights that make the comparison unstable.

A Practical Diagnostic Sequence

1
Fix the comparison.
State the treatment groups, analysis sample, target population, and matching or weighting scheme. Confirm that all diagnostics refer to this same comparison.
2
Summarize every prespecified covariate.
Report means or proportions, relevant spread and counts, and SMDs. Use a consistent reference scale where comparisons across stages are intended.
3
Inspect distributional and subgroup patterns.
Use quantile and ECDF displays for important continuous variables; check substantively chosen interactions, nonlinear terms, rare categories, and missingness.
4
Assess joint balance and report limitations.
Use a joint summary as a complement to—not a replacement for—marginal and graphical checks. Identify remaining discrepancies and describe their likely relevance without claiming that diagnostics verify exchangeability.

Reporting, Pitfalls, and Alternatives

A concise report should identify the analyzed groups and target, name the diagnostics used, summarize the principal residual differences, and explain any important limitations. For example: “After matching, the groups were similar on most measured baseline covariates by SMD, but age retained an SMD of 0.20 and the control group had a longer upper age tail. We therefore report age-specific distributional checks alongside the marginal summaries. These diagnostics concern measured covariates and do not establish exchangeability.” This communicates both the evidence and its boundary.

The main alternative is to rely on a single summary or on significance tests. A table of SMDs is compact and comparable across variables but may miss distributional shape. Graphs can reveal shape and tail discrepancies but require careful interpretation and may be crowded with many covariates. A joint distance compresses information but can hide its source. Significance tests answer a different question—whether data are inconsistent with exact equality under a statistical model—and are strongly affected by sample size. No one display replaces the others.

Common mistake: “Every SMD is below 0.1, so the groups are exchangeable and confounding has been eliminated.” This reasoning is incorrect. A threshold is only a screening convention, and measured marginal summaries cannot diagnose unmeasured confounding or guarantee similarity in all functions and combinations of covariates. The correction is to report the measured balance evidence, investigate scientifically important distributional and joint features, and state that causal interpretation still depends on assumptions such as conditional exchangeability and positivity. Those assumptions are not proven by balance diagnostics.

Diagnostics also have practical limitations. Results depend on which covariates and features were selected, on coding and measurement quality, on the target population, and on the stability of the matched or weighted sample. A visually reassuring plot can conceal small subgroups, while an exhaustive set of post hoc checks can encourage selective reporting. Prespecification, transparent summaries, and a clear account of remaining imbalance make the workflow more useful.

Check Your Understanding

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

  1. A continuous covariate has treated and control means of 14 and 12, with standard deviations of 4 and 4. Calculate its SMD.
  2. Two groups have nearly equal means, but their ECDFs separate in the upper tail. What does this imply, and what does it not imply?
  3. Why should a Mahalanobis distance be reported alongside marginal summaries rather than by itself?
  4. Does finding small SMDs prove there is no unmeasured confounding? Explain.

Solutions. (1) The denominator is \(\sqrt{(4^2+4^2)/2}=4\), so the SMD is \((14-12)/4=0.500\). (2) It indicates a distributional difference in the upper tail that the means may conceal; it does not alone show that the difference is causally important or establish a formal decision. (3) The joint distance summarizes mean displacement relative to a covariance scale but does not identify each variable’s discrepancy or reveal all tail, subgroup, and shape differences. (4) No. Small SMDs describe measured covariates under the chosen summaries; they cannot establish balance on unmeasured factors or verify exchangeability.

Clinical Biostats