Why Compare Covariate Distributions Jointly?
A balance table can show small differences in covariate means while concealing an important difference in how covariates occur together. For example, treated and control groups could have the same proportion of low and high values for each of two covariates, but the low values could tend to occur together in one group and separately in the other. A collection of marginal summaries does not fully describe that joint pattern.
Energy distance provides a scalar summary of the difference between two multivariate distributions. It is based on distances between observations: distances across groups contribute positively, while distances within each group are subtracted. A larger value indicates more distributional separation for the chosen covariate representation and scale.
This diagnostic complements standardized mean differences, variance ratios, and marginal distribution checks. It does not replace examining those summaries: a single scalar cannot identify which covariates or regions of the joint distribution account for a discrepancy.
Definition and Empirical Calculation
In a matched sample, let \(X_1,\ldots,X_n\) be the treated covariate vectors and \(Y_1,\ldots,Y_m\) the control vectors. The empirical energy distance compares the two empirical distributions:
The within-group sums include pairs of an observation with itself; these contribute zero distance. This formula is the energy distance between the two empirical distributions, rather than a significance-test statistic. It can be used descriptively on the matched observations without assuming that they are independent random samples. Interpreting it as an estimate of a population distance requires an appropriate sampling interpretation.
For weighted observations, use normalized nonnegative weights \(a_i\) for treated units and \(b_j\) for controls, with \(\sum_i a_i=\sum_j b_j=1\). The same comparison is
These weights define two weighted empirical distributions. For ordinary unweighted samples, \(a_i=1/n\) and \(b_j=1/m\), recovering the preceding formula.
Why the Distance Detects Distributional Differences
The distance formula compares average cross-group separation with average within-group separation. The algebra behind its nonnegativity can be seen by writing \(\nu=P-Q\), a signed measure whose total mass is zero. Expanding the double integral gives
Euclidean distance is strictly of negative type: for a zero-total-mass signed measure, the left side is nonnegative, and it is zero only when the signed measure is zero. Thus the population energy distance is nonnegative and vanishes only when \(P=Q\). The result concerns the full distributions, not just their means.
This also explains an important distinction from Mahalanobis distance between group means. A mean-based multivariate summary describes the separation of average covariate vectors, while energy distance responds to differences in the distributions of the vectors, including differences in spread, shape, and dependence. The two measures answer related but different questions.
Worked Example: Same Marginal Distributions, Different Joint Pattern
Suppose two matched groups each have two observations on two covariates already put on a common scale. The treated vectors are \(X_1=(0,0)\) and \(X_2=(2,2)\). The control vectors are \(Y_1=(0,2)\) and \(Y_2=(2,0)\). Each coordinate has the same observed values, \(0\) and \(2\), in both groups.
The treated and control mean vectors are both \((1,1)\). In addition, the marginal empirical distribution of each coordinate is identical across groups. The joint pairings differ: in the treated group, the coordinates move together, while in controls one is high when the other is low.
Every cross-group distance is \(2\). For instance, \(\|X_1-Y_1\|=\|(0,-2)\|=2\), and the other three cross-group distances are also \(2\). Therefore the average cross-group distance is
Within each group, the two distinct observations are separated by \(2\sqrt{2}\), and the two self-distances are zero. Each within-group average, including self-pairs, is therefore
The empirical energy distance is
The positive result reveals a difference in the joint empirical distributions despite equal means and equal marginal distributions. It does not say which covariate is responsible; the observed pattern indicates that the dependence between the covariates differs.
Worked Calculations and Interpretation
Worked Example: Equal Means Do Not Ensure Equal Distributions
Consider a single covariate measured in score units. The treated values are \(-1\) and \(1\); the control values are \(0\) and \(0\). Both sample means equal \(0\), but the treated observations vary while the controls do not.
Each of the four cross-group distances is \(1\), so the cross-group average is \(1\). The treated within-group distance matrix has two zero diagonal entries and two distances of \(2\), giving an average of \((0+2+2+0)/4=1\). All control within-group distances are zero. Thus
The energy distance is \(1\) score unit, even though the mean difference is zero. In this example, the distributional discrepancy is in spread. In multiple dimensions, it can also reflect shape or dependence that is not captured by a mean vector.
Worked Example: Calculating a Weighted Energy Distance
Suppose the treated weighted empirical distribution places weight \(0.75\) at \(0\) and \(0.25\) at \(2\). The control weighted empirical distribution places weight \(0.25\) at \(0\) and \(0.75\) at \(2\). The covariate is measured in score units, and the weights in each group sum to one.
A cross-group draw has different values with probability \(0.75(0.75)+0.25(0.25)=0.625\). When values differ, their distance is \(2\). The average cross-group distance is therefore \(0.625(2)=1.25\).
Within the treated distribution, two independent draws differ with probability \(2(0.75)(0.25)=0.375\), so the average within-treated distance is \(0.375(2)=0.75\). The control weights are reversed, giving the same within-control average, \(0.75\). Hence
The weighted empirical distributions differ, and their energy distance is \(1.00\) score unit. The comparison describes the distributions implied by these weights; it is not a causal effect estimate.
Scale, Diagnostics, and Alternatives
Euclidean distances depend on covariate units. If one covariate is recorded in dollars and another in years, the dollar coordinate can dominate the distance simply because its numerical scale is larger. A multivariate energy diagnostic therefore requires an explicit representation and scale for the covariates.
A common practice is to transform covariates using fixed reference scales, such as pooled standard deviations, before calculating Euclidean distances. Use the same transformation for both groups and for before-and-after comparisons. Standardizing each group separately is not appropriate for assessing their differences: it can remove differences in location or scale that the diagnostic is intended to reveal. For categorical covariates, the encoding and distance induced by that encoding also need to be chosen deliberately.
Energy distance is best read alongside other balance diagnostics. Standardized mean differences summarize location differences for individual covariates; variance ratios and marginal distribution checks examine other one-variable features; interaction or subgroup summaries can help localize joint patterns. Mahalanobis distance summarizes separation between mean vectors while accounting for covariance scaling, but, like other mean-based summaries, it does not generally compare the full distributions.
There is no universal energy-distance threshold that establishes acceptable balance. Its magnitude depends on covariate units, the number and nature of covariates, and the distributions being compared. Compare values only under a consistent representation and scale, and inspect the underlying covariates and relevant plots when the value suggests a discrepancy.
Common Pitfalls and Limitations
- Calling a positive value a failed significance test. Energy distance here is a descriptive balance summary. A positive empirical value does not by itself provide a p-value or establish that a population difference is statistically significant.
- Assuming a small value proves balance in every respect. The scalar can conceal which dimensions or observations contribute to it. Review marginal summaries and meaningful interactions as well.
- Comparing values computed on different scales. A numerical change may reflect a changed unit or transformation rather than improved balance. Keep the distance definition and scaling fixed.
- Interpreting equal means as equal distributions. Equal means do not rule out differences in variance, shape, or dependence, as the examples show.
Energy distance compares the empirical distributions available in the analyzed sample. It does not establish that all relevant confounding has been controlled, nor does it guarantee that the matched sample represents the target population. Its role is narrower: to provide a multivariate distributional balance diagnostic that can reveal discrepancies missed by mean comparisons alone.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- What feature of the distributions is represented by the cross-group term in energy distance, and why are within-group terms subtracted?
- Two groups have equal covariate means. Does that imply their energy distance is zero? Explain.
- In the first worked example, why can energy distance be positive when each covariate has the same marginal distribution in both groups?
- Why must the same covariate scaling be used when comparing energy distances before and after matching?
Solutions. (1) The cross-group term is the average distance between a draw from each distribution. Subtracting within-group distances compares that separation with the groups' own spread; this combination is zero when the distributions agree and nonnegative for Euclidean distance. (2) No. Equal means do not imply equal distributions; differences in spread, shape, or dependence can produce positive energy distance. (3) The pairings differ: the treated coordinates move together and the control coordinates move in opposite directions. Energy distance uses joint vectors, not just separate marginal distributions. (4) Euclidean distance depends on units. Changing the scaling changes the contributions of covariates, so a before-and-after difference would not be a like-for-like comparison.