*! version 1.0.0 13Aug2026

Title

varatio -- k-group omnibus variance-ratio balance diagnostic

Syntax

varatio
varname [if] [in] [weight] ,
"by(varname:groupvar)"

groupvar must take on k >= 2 distinct values, numeric or string.
The (optionally weighted) variance of varname is compared across all
k groups simultaneously.

* "by(varname:groupvar)" specify a variable that
identifies the k groups (k >= 2)

* Required

aweights, pweights, and iweights are allowed; see
weight.

Description

varatio reports a k-group omnibus summary of variance-ratio
imbalance across levels of by(). Three omnibus statistics are
reported together: (1) F_VR, a size-weighted quadratic combination of the
pairwise log-variance-ratios (Linden, 2026), (2) GMVR, the geometric mean
of the pairwise variance ratios, extended from two-groups (Linden and Samuels, 2013), and (3) max(VR*),
the largest pairwise variance ratio, extended from two-groups for standardized mean differences (Lopez and Gutman, 2017).

Remarks

Interpreting the omnibus statistics: GMVR and max(VR*) inherit Rubin's (2001)
convention that values above 2.0 (or, before symmetrizing, below 0.5) indicate
imbalance; Linden and Samuels (2013) state the same convention applies to
the geometric mean specifically. F_VR is not on the same scale --
it is a log/RMS-based construction. Based on extensive simulations, Linden (2026)
derived the following recommendations:

F_VR < 0.10 — groups are well balanced

F_VR > 0.30 — groups are imbalanced

0.10 <= F_VR <= 0.30 — balance is uncertain: inspect the per-group and pairwise results

Options

"by(varname:groupvar)" is required. It specifies a variable that
identifies the k groups, where k >= 2. It may be numeric or
string.

Examples

Set-up

. webuse cattaneo2, clear

. tab msmoke

varatio across the 4 levels of msmoke (0, 1-5, 6-10, 11+
cigarettes/day), unweighted

. varatio mage, by(msmoke)

Multivalued treatment (IPTW)

Build generalized propensity score weights across all 4 levels of
msmoke and re-check mage's variance-ratio balance after
weighting. Comparing this to the unweighted call above shows whether the
multivalued IPTW succeeded in reducing variance imbalance in mage
across levels of msmoke, not just mean imbalance.

. mlogit msmoke i.(mmarried fbaby) mage c.mage#c.mage medu c.medu#c.medu c.mage#c.medu, base(0)

. predict double (ps1 ps2 ps3 ps4), pr

. gen iptw2 = 1/ps1 if msmoke==0

. replace iptw2 = 1/ps2 if msmoke==1

. replace iptw2 = 1/ps3 if msmoke==2

. replace iptw2 = 1/ps4 if msmoke==3

. varatio mage [pweight=iptw2], by(msmoke)

Bootstrapping F_VR

varatio has no closed-form confidence interval. Every
quantity varatio computes -- omnibus, per-group, and pairwise
-- is returned in r() (see Stored results
below), so any of them can be bootstrapped directly.

capture program drop bootvr

program define bootvr, rclass

varatio mage [pweight=iptw2], by(msmoke)

return scalar fvr = r(F_VR)

return scalar gmvr = r(GMVR)

end

bootstrap r(fvr) r(gmvr), reps(1000) seed(12345): bootvr

F_VR is bounded below at zero by construction (it is a root-mean-
square), so the default normal-approximation
bootstrap CI can report an implausible negative lower bound, particularly
when the true F_VR is small. Check the percentile and BCa intervals as
well, which respect that boundary.

. estat bootstrap, all

Stored results

varatio stores the following in r():

Scalars

r(F_VR) omnibus F_VR

r(GMVR) geometric mean variance ratio

r(maxVR) maximum pairwise variance ratio

r(N) total number of observations across all groups

r(k) number of groups

r(npairs) number of pairwise comparisons

Macros

r(by) the group variable

Matrices

r(pergroup) each group's variance, log-variance, and
deviation from the weighted mean log-variance

r(pairwise) VR* and log(VR*) for every pairwise comparison

References

Linden, A. 2026. Beyond the mean: A weighted k-sample omnibus
variance-ratio statistic for covariate balance diagnostics.
Preprint: arXiv:

Linden, A., and S. J. Samuels. 2013. Using balance statistics to determine
the optimal number of controls in matching studies.
Journal of Evaluation in Clinical Practice
19: 968-975.

Lopez, M. J., and R. Gutman. 2017. Estimation of causal effects with
multiple treatments: a review and new ideas.
Statistical Science
32(3): 432-454.

Rubin, D. B. 2001. Using propensity scores to help design observational
studies: application to the tobacco litigation.
Health Services and Outcomes Research Methodology
2: 169-188.

Citation of varatio

varatio is not an official Stata command. It is a free contribution
to the research community, like a paper. Please cite it as such:

Linden A. (2026). VARATIO: Stata module for calculating the k-group omnibus variance-ratio balance diagnostic.
Statistical Software Components SXXXXXX, Boston College Department of Economics.

Author

Ariel Linden

President, Linden Consulting Group, LLC

alinden@lindenconsulting.org

Also see

Online: esizereg, kstest (if installed), cvmtest (if installed), adtest (if installed)