Why Examine Balance Beyond the Raw Mean?
A continuous covariate can have the same mean in treated and comparison groups while having different curvature, spread across regions, or tail behavior. A standardized difference for the original covariate checks one feature of its distribution: the difference in its mean. It does not establish that the groups agree on nonlinear functions of that covariate. Representing the covariate with additional functions, called basis terms, provides targeted summaries of those differences.
For example, the squared covariate \(X^2\) helps reveal differences in second moments, while a spline term can focus attention on differences above or below a chosen value. These summaries are design diagnostics: they describe whether selected features of measured covariates differ between treatment groups after matching or weighting. They are not tests of whether treatment assignment is unconfounded, and they do not establish causal effects.
Calculating Basis-Term Balance Summaries
For a basis function \(g\), calculate each unit’s transformed value \(g(X_i)\), then compare the group means. One common standardized difference divides their difference by a fixed reference standard deviation. The reference scale should be chosen consistently for the diagnostic—for example, the pooled standard deviation of the transformed term in the original, unweighted sample—and kept fixed when comparing before and after matching or weighting.
Here \(T_i=1\) denotes a treated unit and \(T_i=0\) a comparison unit. The numerator is a difference in the units of \(g(X)\); the denominator makes the summary dimensionless. For \(g(X)=X^2\), for instance, both the difference and reference standard deviation are in squared units. The sign indicates which group has the larger mean of the transformed term; the magnitude describes the difference relative to the chosen reference scale.
For weights \(w_i\), replace each group mean with its weighted mean. For group \(a\), where \(a\) is \(T\) or \(C\), this is \(\bar{g}_{a,w}=\sum_{i:T_i=a}w_i g(X_i)/\sum_{i:T_i=a}w_i\). The group’s total weight must be positive. A fixed reference standard deviation makes before-and-after comparisons easier to interpret because a change in the SMD then reflects a change in the group difference, rather than a changing denominator.
Empirical means and variances of transformed values are defined when the observed transformed values are finite; for weighted means, the weights must also have a positive sum. The population distribution need not have finite moments for these empirical summaries to be calculated. Finite population moments are needed only when discussing the corresponding population expectations or variances.
Worked Example: Equal Raw Means but Imbalance in a Quadratic Term
Suppose a hypothetical matched sample has two treated units with \(X=0,2\) and two comparison units with \(X=1,1\). Calculate the raw mean difference and the standardized difference for \(X^2\). Use the pooled sample standard deviation of \(X^2\) as the reference scale.
The raw means are \(\bar{X}_T=(0+2)/2=1\) and \(\bar{X}_C=(1+1)/2=1\). Thus the raw mean difference is \(1-1=0\). A diagnostic using only the raw mean would not flag a difference in this particular feature.
The squared values are \(0,4\) for treated units and \(1,1\) for comparison units. Their means are \(\overline{X^2}_T=(0+4)/2=2\) and \(\overline{X^2}_C=(1+1)/2=1\), giving a difference of \(2-1=1\). In the treated group, the sample variance is \(\{(0-2)^2+(4-2)^2\}/(2-1)=8\). In the comparison group it is \(0\). The pooled sample variance is \(\{(2-1)8+(2-1)0\}/(2+2-2)=4\), so the pooled standard deviation is \(s_{X^2,\mathrm{ref}}=\sqrt{4}=2\).
Therefore, \(\operatorname{SMD}_{X^2}=(2-1)/2=0.500\). This hypothetical example shows how a quadratic term can reveal a difference in curvature-related information despite equal raw means. It does not imply that every relevant feature of the covariate distributions has been checked.
Choosing Polynomial and Spline Terms
Polynomial terms extend the raw covariate with powers such as \(X^2\) or \(X^3\). Comparing means of \(X\) and \(X^2\) checks differences in the first and second raw moments; when the means and second moments are equal, the variances are equal too, since \(\operatorname{Var}(X)=E(X^2)-\{E(X)\}^2\), provided the population moments exist. In a sample, the corresponding empirical relationship holds. This still does not imply that the full distributions agree: different distributions can share the same first two moments.
A spline basis can target a region of the covariate range. A simple piecewise-linear hinge term at knot \(k\) is \(h_k(X)=\max(X-k,0)\). It is zero at and below the knot and increases linearly above it. A collection of such terms at prespecified knots can summarize how group means differ across several regions. More elaborate spline bases can describe smooth curvature, but their terms and knots should be defined clearly before balance is summarized.
Polynomial powers can be highly correlated, especially when \(X\) is far from zero or spans a wide range. Centering and scaling \(X\) before constructing powers can improve numerical behavior and make terms easier to inspect. For example, if \(Z=(X-c)/r\), where \(c\) is a fixed center and \(r\) a positive scale, then \(Z^2\) is a quadratic term on a more manageable scale. The choice of basis affects which features the diagnostics emphasize; it does not change the underlying observed data.
Worked Example: Using a Spline Term to Inspect a Region
Consider a hypothetical sample with treated values \(X=0,1,3,4\) and comparison values \(X=0,2,2,4\). Compare the means of \(X\) and the hinge term \(h_2(X)=\max(X-2,0)\). For the hinge-term SMD, use the pooled sample standard deviation of the hinge values.
Both raw means equal \(2\): \(\bar{X}_T=(0+1+3+4)/4=2\), and \(\bar{X}_C=(0+2+2+4)/4=2\). The hinge values are \(0,0,1,2\) for treated units and \(0,0,0,2\) for comparison units. Their means are \(0.75\) and \(0.50\), respectively, so the hinge-term mean difference is \(0.75-0.50=0.25\).
The treated hinge values have sample variance \(\{(0-.75)^2+(0-.75)^2+(1-.75)^2+(2-.75)^2\}/3=2.75/3=0.9167\). The comparison hinge values have sample variance \(\{(0-.50)^2+(0-.50)^2+(0-.50)^2+(2-.50)^2\}/3=3/3=1\). The pooled variance is \(\{3(0.9167)+3(1)\}/6=0.9583\), giving a pooled standard deviation of about \(0.9789\). Thus the hinge-term SMD is \(0.25/0.9789\approx0.255\).
The raw means agree, but the groups differ in the mean of the hinge term, which emphasizes values above 2. This summary can prompt closer inspection of that region; it is not a complete description of either distribution and does not establish that a particular knot is uniquely appropriate.
Weighted Diagnostics and a Practical Sequence
After weighting, calculate the weighted mean of every selected basis term separately in the treated and comparison groups. Interpret the resulting difference using the same fixed reference scale as for the unweighted diagnostic. This makes it possible to see whether the weighting reduced imbalance in a nonlinear feature, not just in the raw covariate. As with other weighted balance summaries, large or uneven weights can make a few observations influential, so inspect the weights and the distribution of observed covariate values alongside the summaries.
Worked Example: Weighted Balance for Raw, Quadratic, and Spline Terms
Suppose a hypothetical weighted sample contains treated observations \((X,w)=(0,1),(2,1),(4,2)\) and comparison observations \((X,w)=(0,1),(2,2),(4,1)\). Use the original six observations, before weighting, to define each term’s sample standard deviation as the fixed reference scale.
Each group has total weight \(4\). The treated weighted mean of \(X\) is \((0\cdot1+2\cdot1+4\cdot2)/4=2.5\); the comparison weighted mean is \((0\cdot1+2\cdot2+4\cdot1)/4=2\). The weighted raw difference is \(0.5\). The six original \(X\) values are \(0,2,4,0,2,4\), with mean \(2\) and sample variance \(16/5=3.2\), so the reference standard deviation is \(\sqrt{3.2}\approx1.789\). The weighted raw SMD is \(0.5/1.789\approx0.280\).
For \(X^2\), the treated weighted mean is \((0\cdot1+4\cdot1+16\cdot2)/4=9\); the comparison weighted mean is \((0\cdot1+4\cdot2+16\cdot1)/4=6\). The difference is \(3\). Across the six original observations, the squared values are \(0,4,16,0,4,16\). Their sample variance is \(832/15\approx55.47\), so the reference standard deviation is about \(7.447\). Thus the weighted quadratic SMD is \(3/7.447\approx0.403\).
For the hinge \(h_2(X)\), the values at \(X=0,2,4\) are \(0,0,2\). The treated weighted mean is \((0\cdot1+0\cdot1+2\cdot2)/4=1\); the comparison weighted mean is \((0\cdot1+0\cdot2+2\cdot1)/4=0.5\). The original six hinge values are \(0,0,2,0,0,2\). Their sample mean is \(2/3\); their sample variance is \(\{4(0-2/3)^2+2(2-2/3)^2\}/5=16/15\), giving a reference standard deviation of about \(1.033\). The hinge-term SMD is \(0.5/1.033\approx0.484\).
In this constructed example, weighted differences remain for all three summaries, and the hinge-term difference is most pronounced relative to its reference scale. The calculations describe this sample and weighting scheme; they do not by themselves determine whether the weights are suitable for a causal analysis.
How to Use the Summaries—and Where They Can Fail
A useful diagnostic sequence is to identify continuous covariates important to the design, specify a small set of interpretable basis terms, calculate each term’s group difference and standardized difference, and compare those summaries before and after matching or weighting. A table or plot should label the underlying covariate and the transformation, such as “age squared” or “hinge at age 50.” Record knot locations and reference scales so that the results can be reproduced and interpreted.
Look for patterns rather than treating one cutoff as a pass/fail rule. A small raw SMD alongside a larger squared-term SMD suggests that equal means may mask a difference in spread or shape. An imbalance in a hinge term points to a difference in the selected region, but not necessarily to the exact location or cause of that difference. Check whether the finding is consistent with other diagnostics, such as distributional or quantile comparisons. A single basis term can miss a feature it was not designed to represent.
Basis summaries are sensitive to specification. Changing polynomial degree, centering, spline type, or knot locations changes the features being summarized. A term with very little variation can also have a small reference standard deviation, making its SMD unstable or uninformative; report the scale and inspect the raw differences as well. If a transformed variable takes an infinite or undefined value for an observed unit, the corresponding empirical summary cannot be calculated as stated and the data or transformation must be addressed.
These summaries complement, rather than replace, the other balance diagnostics. A raw-covariate SMD is simpler and directly checks mean balance; distributional diagnostics can reveal differences not captured by a chosen set of moments or spline terms. Basis-term summaries offer an interpretable way to target nonlinear features, but no finite collection of them proves equality of full distributions or rules out imbalance in unmeasured covariates. Balance is a design assessment, not a guarantee of no confounding.
Common Mistakes
- Assuming equal raw means imply equal covariate distributions. Equal means check only one feature. The worked examples show that transformed-term means can differ even when the raw means match.
- Reading a basis-term SMD as a causal effect. It describes a difference between groups on a transformed covariate; it is not an estimate of the treatment effect.
- Changing the denominator between before-and-after summaries without saying so. Use a clearly stated, consistent reference scale when the goal is to compare balance changes.
- Treating a small collection of balanced terms as proof of full balance. Terms summarize selected functions. Other distributional differences may remain.
- Assuming empirical summaries require finite population moments. They require finite observed transformed values, and weighted means additionally require a positive total weight. Finite population moments matter for corresponding population quantities, not for defining a finite-sample summary.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- If treated and comparison groups have the same mean of \(X\), what does that establish, and what does it not establish?
- For treated values \(X=0,2\) and comparison values \(X=1,1\), calculate the group means of \(X^2\). What feature does the comparison reveal?
- For a weighted mean of a basis term, what conditions on the observed values and weights are needed for the empirical summary to be defined?
- Why is a fixed reference standard deviation useful when comparing basis-term SMDs before and after weighting?
Solutions. (1) It establishes equality of the observed raw means, but not equality of variances, tails, or full distributions. A transformed-term comparison can reveal differences the raw means miss. (2) The treated mean is \((0^2+2^2)/2=2\); the comparison mean is \((1^2+1^2)/2=1\). The difference in squared-term means indicates a difference in this second-moment feature. (3) The observed transformed values must be finite, and the group’s total weight must be positive. Finite population moments are not required to calculate this finite-sample summary. (4) With the same denominator, changes in the SMD reflect changes in the group difference on that term rather than a change in the reference scale.