BCompare groups · Guide test 016
Alexander–Govern test
Uses a transformed statistic to compare several independent means under unequal variances.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- One-way ANOVA (Welch / classic) — Do the means of three or more independent groups differ?
In One-way ANOVA (Welch / classic), choose Test = Alexander–Govern.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Alexander–Govern test
Group i has true mean (i − 1) × spread.
Your data
Drag a point or use ↑/↓ to change itIf H₀ were true
- The reference: how A varies across samples when H₀ is true.
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .350).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- variance-weighted grand mean
- Hill's normalizing transformation of tⱼ
The verdict
A(2) = 2.10, p = .350
p > α = .050: compatible with H₀
Competes with Welch's ANOVA under unequal variances and often controls error better when groups are small.
- Statistic
- 2.101
- p-value
- 0.3498
Alexander–Govern test on Group 1: n = 10; Group 2: n = 10; Group 3: n = 10: A(2) = 2.10, p = .350. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: all independent group means are equal; H1: one or more differ.
Assumptions
At least two independent groups with at least two observations each; normal population observations, nonzero finite group variances, and no assumption of equal variances.
Formula
Parameters and notation
νj=nj−1. zj is the Alexander–Govern normalizing transform shown above; only its square enters A, so the sign of tj is immaterial. k is the number of groups.
Structure of the method
Estimate each group's mean variance, construct a precision-weighted common mean, and transform standardized group deviations using the Alexander–Govern normalizing approximation. Summed squared transformed scores are compared with chi-square having one fewer degree of freedom than the number of groups. Omitting the transform changes the method.
Estimated and nuisance parameters
Estimated quantities are group means, unbiased variances, precision weights, and the common weighted mean. Individual group degrees of freedom enter the normalizing transform. Group count, equality restrictions, and the measurement scale are specified by the design; neither the transform nor its coefficients are trained from data.
Settings and design choices
Specify alpha, group inclusion, missing-value policy, and any follow-up contrast plan. There is no network or optimization hyperparameter. Evaluate sensitivity to plausible transformations only when they correspond to a meaningful alternative estimand; selecting a transform by its resulting p-value requires additional inferential adjustment.
Fitting and adaptation
Recalculate weights and transformed deviations whenever sample sizes or group observations change. To assess finite-sample calibration, simulate normal equal-mean groups with the planned unequal variances and allocation, then repeat the entire statistic. Such a simulation evaluates a specified null scenario, not universal robustness to every nonnormal population.
Sensitivity and robustness
Each group needs enough observations and nonzero finite variance. Small degrees of freedom make the normalizing approximation consequential; strong asymmetry and influential observations can degrade performance. Compare group-level uncertainty and effect sizes with the omnibus result, and avoid interpreting significance as evidence that all group pairs differ.
How to use and calibrate
Estimate group mean variances, form the weighted common mean, transform each standardized deviation to a normal score using the cited algorithm, and take the upper χ²k−1 tail.
Example application
Compare several normal group means when heterogeneity of variances makes the classical ANOVA F reference unsuitable.
Interpretation and pitfalls
Watch out
Approximation quality deteriorates in very small or nonnormal samples. The weighting and transform must match the published method; ordinary squared t statistics are not the Alexander–Govern statistic.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
Omnibus test across independent groups; use the model assumptions in this entry and plan multiplicity-adjusted follow-up comparisons.
Validated — Executed successfully in the validation environment · needs numpy, scipy
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
groups = [rng.normal(m,1,20) for m in (0,.4,.8)]
print(stats.alexandergovern(*groups))
Output
AlexanderGovernResult(statistic=np.float64(18.38328311647006), pvalue=np.float64(0.000101887473133153))
Validated — Executed successfully in the validation environment · needs onewaytests
set.seed(2026)
d <- data.frame(value=c(rnorm(20),rnorm(20,.4),rnorm(20,.8)), group=factor(rep(c("A","B","C"),each=20)))
print(onewaytests::ag.test(value~group,d))
Output
Alexander-Govern Test
data: value and group
X-squared = 13.052, df = 2, p-value = 0.001465
$statistic
[1] 13.05186
$parameter
[1] 2
$p.value
[1] 0.001464959
$alpha
[1] 0.05
$method
[1] "Alexander-Govern Test"
$data
value group
1 0.52058907 A
2 -1.07969076 A
3 0.13923812 A
4 -0.08474878 A
5 -0.66663962 A
6 -2.51608903 A
7 -0.73514680 A
8 -1.02012226 A
9 0.11355444 A
10 -0.47379098 A
11 -0.40821470 A
12 -0.73043328 A
13 -0.22143660 A
14 -0.22581652 A
15 -2.54688145 A
16 1.34700150 A
17 0.61640815 A
18 0.21756434 A
19 -0.80471883 A
20 0.68974678 A
21 0.07132799 B
22 0.23531842 B
23 -0.99202888 B
24 1.86582476 B
25 0.44820681 B
26 2.30808383 B
27 2.13094453 B
28 0.45814584 B
29 1.04532816 B
30 2.12562899 B
31 -0.12896692 B
32 0.56639203 B
33 0.14527643 B
34 0.73278236 B
35 0.58243281 B
36 1.56459375 B
37 0.99349285 B
38 -0.49177973 B
39 0.97725331 B
40 -0.42490558 B
41 -0.35725386 C
42 1.57799877 C
43 -0.40422179 C
44 1.10671410 C
45 -0.03365854 C
46 2.21814116 C
47 1.51178612 C
48 0.39750228 C
49 1.59936222 C
50 1.22648444 C
51 -0.36989867 C
52 0.59379984 C
53 -0.13061031 C
54 1.24939757 C
55 0.15519355 C
56 0.56857731 C
57 -0.43636801 C
58 -0.16095530 C
59 0.93395628 C
60 -0.19905272 C
$formula
value ~ group
attr(,"class")
[1] "owt"Sources
- SciPy Alexander–Govern testdocs.scipy.org
- scipy.stats.alexandergoverndocs.scipy.org
- ag.testsearch.r-project.org
- Statistics guide v4 (historical):
- R: Executed successfully in the validation environment
- Reference's record:
- Edition 2 review: Python: executed · R: not executed (Rscript unavailable). Python: Ran in the reference's review, on this exact code. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 016, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT016.