Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
Levene’s test asks a single, narrow question: do two or more groups have the same population variance? It matters because so many of the standard parametric tests researchers reach for — the independent-samples t-test, one-way ANOVA, and their relatives — assume homogeneity of variance (equal spread across groups) as a precondition for the p-values they report to be trustworthy. Levene’s test is the diagnostic most commonly used to check that precondition before trusting the main result. This guide covers the logic behind how it works, why the mean-based and median-based (Brown-Forsythe) versions can disagree, and what a significant result should actually change about your analysis.
What Is Levene’s Test?
Levene’s test is a hypothesis test for equal variances. Its null hypothesis is that every group has the same population variance, and a p-value below your alpha (usually 0.05) is evidence that at least one group’s spread differs. It does this by running a one-way ANOVA on each score’s absolute deviation from its group center, so it does not require normally distributed data, and it cannot prove that variances are equal (Levene’s test, Wikipedia).
The Logic: Testing Absolute Deviations, Not the Scores Themselves
Levene’s test doesn’t compare variances directly with a ratio, the way an F-test for two variances does. Instead, it reframes a question about spread as a question about means, which lets it reuse ordinary ANOVA machinery. The procedure:
- For each group, calculate the group’s center — the mean in the original Levene (1960) formulation.
- For every observation, compute its absolute deviation from that group’s center:
|xij − centerj|. - Run a standard one-way ANOVA on these absolute deviations, treating group membership exactly as it would in a normal ANOVA on the raw scores.
- If that ANOVA is significant, the groups differ in how far, on average, their observations sit from their own center — which is precisely what unequal variance means. A significant Levene’s test is really an ANOVA on dispersion, not on location.
This is why Levene’s test is often described as converting a variance-comparison problem into a mean-comparison problem: once you’re working with absolute deviations, any test that compares group means — and its assumptions — can be reused, even though the original question was about spread.
Why the Center Choice Matters: Levene vs. Brown-Forsythe
The step researchers most often skip past — and the one this guide is really about — is that “center” isn’t fixed. Levene’s original 1960 test uses the group mean. Brown and Forsythe (1974) proposed the same procedure using the group median instead, and some software also offers a trimmed mean or a median with adjusted degrees of freedom as further variants. All four are legitimate members of the same test family; they differ only in which center the absolute deviations are measured from.
That choice isn’t cosmetic. The mean is sensitive to outliers and to skew: in a skewed or heavy-tailed distribution, deviations from the mean are inflated by whichever tail is doing the pulling, which can make Levene’s original version over-detect unequal variance — flagging groups as heteroscedastic when the real issue is non-normal shape, not unequal spread. The median is far less sensitive to outliers and skew, so absolute deviations from the median are a cleaner, more robust signal of dispersion on its own. This is the entire rationale for the Brown-Forsythe variant: it keeps Levene’s mechanism (ANOVA on absolute deviations) but swaps in a center statistic that doesn’t itself get distorted by the same non-normality the test is trying to look past.
In practice this means the mean-based and median-based versions can genuinely disagree on the same dataset — not because one is calculated wrong, but because they’re measuring dispersion around two different anchors. When a distribution is symmetric and reasonably well-behaved, they typically agree closely. When it’s skewed, has heavy tails, or contains a handful of outliers, they can diverge, and the Brown-Forsythe (median-based) result is generally the one to trust: simulation-based comparisons have consistently found it holds its nominal Type I error rate better than the mean-based version under non-normality, which is exactly the condition where you’re most likely to need a variance-equality check in the first place. Most current statistical software defaults to, or at least offers, the Brown-Forsythe version for this reason.
What a Significant Levene’s Test Should Actually Change
A significant Levene’s test is a diagnostic result, not an endpoint — it tells you a specific assumption behind your planned test doesn’t hold, and the correct response depends on which test you were about to run:
- Independent-samples t-test: switch from the pooled-variance (Student’s) t-test to Welch’s t-test, which doesn’t assume equal variances and adjusts the degrees of freedom to compensate. Most statistical software (SPSS, R’s default
t.test(), Stata) already reports both versions or defaults to Welch’s, precisely so a significant Levene’s result has a ready-made fix sitting next to it. - One-way ANOVA: use a variance-robust alternative to the F-test, most commonly the Welch ANOVA (or the Brown-Forsythe F-test, a related correction), and follow up with a post hoc procedure that doesn’t assume equal variances, such as the Games-Howell test, rather than Tukey’s HSD.
- Reaching for a data transformation instead: this is a common but often misdirected response. Transforming the outcome (a log or square-root transform, for example) can sometimes stabilize variance, but it also changes what the analysis is actually testing — the results are now about the transformed scale, which complicates interpretation and reporting. Because robust alternatives like Welch’s correction exist specifically to handle unequal variance without altering the outcome scale, routing a significant Levene’s result to Welch’s test (or its ANOVA equivalent) rather than to a transformation is usually the more defensible default. Reserve transformation for cases where non-normality itself, not just unequal variance, is the primary problem being addressed.
What a significant result should not trigger is abandoning the comparison altogether or treating unequal variance as disqualifying. Homogeneity of variance is a condition that affects which version of a test to run and how its degrees of freedom are calculated — it’s a routing decision, not a stop sign.
Assumptions and Limits of Levene’s Test Itself
Levene’s test is commonly chosen because, unlike the older F-test for two variances, it doesn’t assume the underlying data are normally distributed — that robustness is the whole reason it displaced the F-test as the default variance-equality check for two or more groups. But it isn’t assumption-free:
- It still assumes independence of observations, both within and across groups — the same requirement nearly every parametric group-comparison test carries.
- With very small group sizes, its power to detect real variance differences is limited, the same way any test’s power depends on sample size.
- It tests equality of variance, not any particular ratio or magnitude of difference — a significant result tells you variances differ, not by how much in a way that’s directly interpretable without further calculation.
These limits are also why the choice of center (mean vs. median) is worth understanding rather than treating as a software default to accept blindly: picking the Brown-Forsythe median-based version when your data are plausibly skewed is a defensible, deliberate methodological decision, not a minor technical footnote.
Levene’s Test Formula, Hypotheses and Degrees of Freedom
The null hypothesis is H0: σ1² = σ2² = … = σk², against the alternative that at least one variance differs. With Zij = |Yij − ci| (the absolute deviation from group center ci), the Levene statistic is:
W = [(N − k) / (k − 1)] × [Σ Ni(Z̄i − Z̄)²] / [ΣΣ (Zij − Z̄i)²]
- k is the number of groups, Ni the size of group i, and N the total sample size.
- W is approximately F-distributed with k − 1 and N − k degrees of freedom, so you reject equal variances when W exceeds F(1 − α; k − 1, N − k), equivalently when p < α.
Source: Levene’s test (Wikipedia). For the logic of degrees of freedom, see the linked guide.
| Center used | Name | Best suited to |
|---|---|---|
| Group mean | Original Levene (1960) | Symmetric data with moderate tails |
| Group median | Brown-Forsythe | Skewed or non-normal data |
| Trimmed mean | Trimmed Levene | Heavy-tailed data |
These recommendations follow the SciPy documentation for scipy.stats.levene, whose default is center=’median’.
Levene’s Test Worked Example
Suppose three groups of eight scores each: Group A (4, 5, 6, 5, 4, 6, 5, 5), Group B (2, 9, 4, 10, 1, 8, 3, 7) and Group C (5, 6, 4, 5, 6, 4, 5, 6). Groups A and C are tightly clustered around 5, while Group B is widely spread. With k = 3 and N = 24, the degrees of freedom are 2 and 21.
| Center | W | p-value |
|---|---|---|
| Mean | 24.53 | 0.0000032 |
| Median (Brown-Forsythe) | 24.03 | 0.0000037 |
Both versions reject the null hypothesis, which matches what the raw data show. In Python this is scipy.stats.levene(a, b, c, center=’mean’), and the median version is the same call with center=’median’. Because this sample is symmetric with no outliers, the two versions agree closely.
How to Interpret and Report Levene’s Test
- p > .05 (not significant): no evidence that variances differ. This does not prove they are equal, especially with small samples.
- p ≤ .05 (significant): the equal-variance assumption is not supported. Use a Welch-type test or the Welch ANOVA and, after ANOVA, a post hoc test that allows unequal variances such as the Games-Howell test.
A typical write-up: “Levene’s test indicated unequal variances, F(2, 21) = 24.03, p < .001, so Welch’s ANOVA was used.” Report the center you used (mean or median), the F degrees of freedom and the exact p-value or p < .001.
Should You Use Levene’s Test Before a t-Test or ANOVA?
Many textbooks teach a two-step routine: run Levene’s test, then pick the pooled or Welch version. The Wikipedia article on Levene’s test reports that this two-step procedure can markedly inflate the Type I error rate of the subsequent test, and recommends using Welch’s test in all cases. Levene’s test remains useful for describing your data and where equal variances are themselves the question, such as checking measurement consistency across instruments. For an independent-samples t-test or a one-way analysis of variance, defaulting to the Welch version removes the need for the gatekeeping step.
Levene’s Test vs. Bartlett’s Test
Bartlett’s test also tests equal variances across groups, but it is sensitive to departures from normality. SciPy’s documentation describes Levene’s test as the alternative to Bartlett’s test when there are significant deviations from normality. When the data are skewed or have outliers, or you are unsure about normality, Levene’s (median-based) is the safer choice. Neither tells you how large the variance difference is.
Frequently Asked Questions
Is Levene’s test the same as the Brown-Forsythe test?
They’re closely related but not identical. Brown-Forsythe is a variant of Levene’s test that substitutes the group median for the group mean as the center used to compute absolute deviations. Some software labels the median-based version “Levene’s test (based on median)” rather than naming it separately as Brown-Forsythe, which is why the two names are often used almost interchangeably in practice — but strictly, Brown-Forsythe is one specific version within the Levene family.
Which version should I report: mean-based or median-based?
When in doubt, the median-based (Brown-Forsythe) version is the safer default, particularly if your data show any skew or potential outliers, since it holds its Type I error rate better under non-normality. If your data are close to symmetric with no notable outliers, the two versions will usually agree closely and the choice matters less.
What should I do if Levene’s test is significant before running an independent-samples t-test?
Report and interpret Welch’s t-test result instead of the standard (pooled-variance) Student’s t-test. This is the standard routing decision most statistical packages already build in, rather than transforming the data or abandoning the comparison.
Does a non-significant Levene’s test prove the variances are equal?
No — like any null-hypothesis significance test, a non-significant result means there wasn’t enough evidence to detect a variance difference, not proof that none exists. With a small sample, a real difference in variance can easily go undetected simply because the test lacks the power to find it.
What is the null hypothesis of Levene’s test?
That all groups have equal population variances (homogeneity of variance). A small p-value rejects it and indicates at least one group has a different variance.
What does “Levene’s test of equality of error variances” mean?
It is the label SPSS uses in ANOVA output. The test is applied to the model’s residuals (the errors), the same idea as comparing the spread of scores across groups.
How is Levene’s test different from the F-test for two variances?
The F-test compares two variances through their ratio and assumes normality. Levene’s test works on absolute deviations, handles two or more groups and is less sensitive to non-normality.
For the mechanics of running Levene’s test and reading its output in specific software, see Levene’s Test in SPSS: Where It Appears and What to Do When It’s Significant, which covers the automatic-vs-opt-in behavior across the t-test, one-way ANOVA, and two-way ANOVA procedures. Related background: the t-test, one-way ANOVA, the Kruskal-Wallis test (a non-parametric alternative when both normality and variance assumptions are in doubt), degrees of freedom, and standard deviation.







