Skip to content

BCompare groups · Guide test 016

Alexander–Govern test

Uses a transformed statistic to compare several independent means under unequal variances.

Runs in CodeSplashPython example validatedR example validated

Do it in CodeSplash

In the app, set it up in Analyze with this method:

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

3
10
0.60

Group i has true mean (i − 1) × spread.

2.50
0.050

Your data

Drag a point or use ↑/↓ to change it
Group 1 · n = 10 · mean 0.16Group 2 · n = 10 · mean 1.07Group 3 · n = 10 · mean 0.62

If H₀ were true

A = 2.10
  1. The reference: how A varies across samples when H₀ is true.
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .350).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

A=∑jzj2∼χk−12,zj=normalized tj=xˉj−xˉ+sj/njA = \sum_j z_j^2 \sim \chi^2_{k-1},\qquad z_j = \text{normalized } t_j = \dfrac{\bar x_j-\bar x_+}{s_j/\sqrt{n_j}}

With your numbers

A=2.10,ν=2A = 2.10,\quad \nu = 2
xˉ+\bar x_+
variance-weighted grand mean
zjz_j
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 H0.

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

vj=sj2/nj, wj=1/vj∑h1/vh, xˉw=∑jwjxˉjtj=xˉj−xˉwvjA=∑jzj2≈χk−12aj=νj−1/2, bj=48aj2, cj=ajlog⁡(1+tj2/νj)zj=cj+cj3+3cjbj−4cj7+33cj5+240cj3+855cj10bj2+8bjcj4+1000bj\begin{gathered}v_j=s_j^2/n_j,\ w_j=\frac{1/v_j}{\sum_h1/v_h},\ \bar x_w=\sum_jw_j\bar x_j\\[5pt] t_j=\frac{\bar x_j-\bar x_w}{\sqrt{v_j}}\\[5pt] A=\sum_j z_j^2\approx\chi^2_{k-1}\\[5pt] a_j=\nu_j-1/2,\ b_j=48a_j^2,\ c_j=\sqrt{a_j\log(1+t_j^2/\nu_j)}\\[5pt] z_j=c_j+\frac{c_j^3+3c_j}{b_j}-\frac{4c_j^7+33c_j^5+240c_j^3+855c_j}{10b_j^2+8b_jc_j^4+1000b_j}\end{gathered}

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.

Python · native

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))
R

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

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.