Levene’s Test
Test whether several groups have equal spread, with the median, mean or trimmed centre.
Centring on the median is the Brown–Forsythe variant. It is the robust default: skew and outliers move a median far less than a mean, so the test keeps its stated error rate on data that is not normal.
F distribution with df 2, 27
α = 0.05
Under 4 is the usual rule of thumb
There is no evidence the spreads differ. That is not proof they are equal — a small sample can miss a real difference — but the equal-variance assumption is not contradicted here.
| Group | n | Mean | SD | Centre used | Mean |deviation| |
|---|---|---|---|---|---|
| A | 10 | 5.032 | 0.5831 | 5.155 | 0.442 |
| B | 10 | 4.661 | 0.7937 | 4.55 | 0.597 |
| C | 10 | 5.526 | 0.4426 | 5.435 | 0.334 |
The test is a one-way ANOVA on that last column: if the spreads were equal, the mean absolute deviations would be too.
Levene’s test checks whether several groups have the same spread — the assumption an ANOVA or pooled t-test rests on. It replaces every value by its distance from its group’s centre, then runs an ANOVA on those distances. A p above 0.05 leaves the equal-variance assumption intact.
A clever reduction
The idea is simpler than it first looks. If two groups have the same spread, their values sit about equally far from their own centres on average. So replace each value by that distance — |xᵢⱼ − centreᵢ| — and the question “do the spreads differ?” becomes “do the mean distances differ?”, which is exactly what a one-way ANOVA answers. Levene’s W is that ANOVA’s F statistic, read against the same F distribution with k − 1 and N − k degrees of freedom.
That reduction is why the test is so widely available and so easy to justify: nothing new is being assumed beyond what ANOVA already assumes about the transformed values, and the transformed values are far better behaved than the originals.
Why the median is the default here
Levene’s original used the mean. Brown and Forsythe showed in 1974 that centring on the median keeps the test’s actual error rate much closer to the nominal α when the data is skewed or heavy-tailed — precisely the situations where you are worried about assumptions in the first place. The size of that difference is easy to underestimate. Simulating three groups of twenty drawn from a lognormal distribution with genuinely equal variances, the mean-centred test declares the spreads unequal about 26% of the time; the median-centred one does so about 4%, which is roughly the 5% it promises. A mean is dragged toward a long tail and a median is not, so the median version is what R, SPSS and SciPy all default to, and what this page defaults to.
where zᵢⱼ = |xᵢⱼ − centreᵢ|; compared against F with k − 1 and N − k degrees of freedom
- 1 Find each group’s centre. The median by default; the mean gives Levene’s original version.
- 2 Replace every value by its absolute deviation. A value of 6.11 in a group with median 5.155 becomes |6.11 − 5.155| = 0.955.
- 3 Run a one-way ANOVA on those deviations. The between-group mean square over the within-group mean square gives W.
- 4 Read W against the F distribution. For three groups of ten, W = 1.119 on 2 and 27 degrees of freedom gives p = 0.341.
- 5 Interpret it as a green light, not a guarantee. p above α means nothing contradicts equal spreads. It is not evidence that they are equal.
Which centre to use
All three are ANOVAs on absolute deviations; only the centre changes.
| Centre | Name | Use it when |
|---|---|---|
| Median | Brown–Forsythe | The default. Skewed data, outliers, or you are not sure — it holds its error rate best |
| Mean | Levene’s original | The groups are genuinely close to normal, where it has slightly more power |
| 10% trimmed mean | Brown–Forsythe, third form | Heavy tails — more extreme values than a normal would produce |
What to do when it comes out significant
A significant Levene result means the spreads differ by more than sampling explains, so a pooled analysis is not safe. The usual answer is not to abandon the comparison but to use a version that does not pool: Welch’s t-test for two groups and Welch’s ANOVA for more, both of which adjust the degrees of freedom instead of assuming a common variance. Both are now the recommended defaults in much of the methods literature regardless of what Levene says, precisely because they cost so little when the variances are equal.
Two cautions about reading the test. Like any test, its power depends on sample size: with small groups it will miss real differences in spread, and with very large ones it will flag differences too small to matter. The variance ratio shown alongside the p-value is a useful sanity check — a largest-to-smallest ratio under about 4 is generally tolerable for ANOVA even when the formal test objects.
The other caution is what the test is not. It says nothing about normality, which is a separate assumption checked with a Q–Q plot or the Shapiro–Wilk test. Levene is fairly robust to non-normality by design, which is the whole point of the median centring, but it is not a substitute for looking at the shape of your data.