What is a Levene’s Test Calculator?
Levene’s test of equality of variances checks whether two or more groups have the same population variance, the homogeneity of variance assumption behind the t-test and ANOVA. Each value is replaced by its absolute distance from its group’s centre (the mean, or the median in the Brown–Forsythe version), and a one-way ANOVA is run on those distances. The statistic W follows an F distribution with k − 1 and N − k degrees of freedom; if p ≤ α, the variances differ.
What the Levene’s Test Calculator does
Paste the raw values for 2 to 10 groups and choose the centre: median (Brown–Forsythe, the default), mean (Levene’s original test, the one SPSS prints) or a trimmed mean. The calculator returns the W statistic, both degrees of freedom, the p-value and the critical F, a table of each group’s size, centre, mean absolute deviation and variance, the ANOVA table computed on the deviations, and every step of the working.
Run it before a pooled t-test or a one-way ANOVA, both of which assume equal variances, or whenever consistency itself is the question: which machine, method or supplier is more variable. Unlike the classical F-test for two variances, Levene’s test does not depend on the data being normal, and it handles any number of groups.
How to use the Levene’s Test Calculator
- Type or paste each group’s values into its own box under Data for each group; use Add group for a third or later group.
- Pick the Centre used for the deviations. Keep Median unless you need to match software that centres on the mean, such as SPSS.
- For a trimmed mean, set Trim from each end (5% matches SciPy’s default).
- Set the significance level α and read W, the p-value and the decision. The step-by-step solution lists every absolute deviation and the ANOVA built from them.
How to interpret Levene’s test results
The hypotheses are H₀: σ₁² = σ₂² = … = σₖ² (all groups have equal variances, the homogeneity of variance assumption holds) and H₁: at least one variance differs. The test is right-tailed, so only a large W counts against H₀.
| Result | What it means | What to do next |
|---|---|---|
| p ≤ α (for example p = 0.004) | The variances differ; homogeneity of variance is violated | Use Welch’s t-test (2 groups) or Welch’s ANOVA with Games–Howell (3+ groups) |
| p > α (for example p = 0.41) | No evidence that the variances differ | The pooled t-test or classic one-way ANOVA is reasonable; check the variance ratio too |
| p > α with fewer than about 10 values per group | The test had little power; equal variances are not shown | Prefer Welch’s methods, which do not need equal variances |
How to report Levene’s test (APA style)
Report the centre, W as an F statistic with both degrees of freedom, and the p-value. For the clinic example below: Levene’s test based on the median showed that the variance of waiting times differed across the three clinics, F(2, 27) = 6.66, p = .004, so Welch’s ANOVA was used to compare the means.
For a non-significant result: Levene’s test showed no evidence of unequal variances, F(2, 57) = 0.91, p = .41, so the homogeneity of variance assumption was retained. Give the p-value to two or three decimals, or write p < .001 for very small values.
Levene’s test formula: how W is calculated
Levene’s test is calculated in three moves: turn every value into its absolute distance from its group’s centre, run a one-way ANOVA on those distances, and compare the resulting W with an F distribution. With k groups, nᵢ values in group i and N values in total:
| Symbol | Meaning |
|---|---|
| xᵢⱼ | observation j in group i |
| cᵢ | centre of group i |
| Z̄ᵢ | mean of the absolute deviations in group i |
| Z̄ | mean of all N absolute deviations |
| k, N | number of groups and total number of observations |
W is exactly the F statistic of a one-way ANOVA applied to the Zᵢⱼ. The test is always right-tailed: only a large W is evidence against equal variances.
Results match scipy.stats.levene for all three centres. For the trimmed mean, floor(proportion × nᵢ) values are removed from each end of the sorted group to find the centre, and all nᵢ observations still contribute a deviation, as in current SciPy. Some other programs also drop the trimmed values from the deviations, which gives a slightly different W.
Worked example
Worked example: waiting times at three clinics
Problem. Waiting times in minutes for ten patients at each clinic. A: 23, 25, 22, 26, 24, 27, 21, 25, 24, 23. B: 18, 29, 24, 33, 20, 27, 15, 31, 22, 26. C: 21, 27, 24, 29, 20, 26, 23, 28, 22, 25. Are the waiting times equally variable at α = 0.05? Use the median as the centre.
- 01Medians: A = 24, B = 25, C = 24.5.
- 02Absolute deviations from each median average Z̄₁ = 1.4 (A), Z̄₂ = 4.7 (B) and Z̄₃ = 2.5 (C); the overall mean deviation is Z̄ = 86 / 30 = 2.8667.
- 03SS between = 10(1.4 − 2.8667)² + 10(4.7 − 2.8667)² + 10(2.5 − 2.8667)² = 56.4667, so MS between = 56.4667 / 2 = 28.2333.
- 04SS within = 114.5, so MS within = 114.5 / 27 = 4.2407.
- 05W = 28.2333 / 4.2407 = 6.6576 with df = (2, 27); critical F = 3.3541.
- 06p = P(F₂,₂₇ ≥ 6.6576) ≈ 0.0045.
Answer. W = 6.66 exceeds the critical value 3.35 (p ≈ 0.0045), so reject H₀: the clinics do not have equal variances. Clinic B is far less consistent (s² = 33.61 against 3.33 for clinic A). Centring on the mean instead gives W = 6.81, p ≈ 0.0040, the same conclusion.
Mean, median or trimmed mean: which centre to use
All three versions use the same W formula; they differ only in the centre each value is measured from. That choice controls how the test behaves when the data are not normal.
| Centre | Usual name | Best for | Software that uses it by default |
|---|---|---|---|
| Median | Brown–Forsythe test | Skewed data; the safest general choice | SciPy, R (car::leveneTest), Minitab |
| Mean | Levene’s test (1960) | Symmetric, moderate-tailed data | SPSS |
| Trimmed mean | Trimmed Levene test | Heavy-tailed data with outliers | Optional in SciPy (center='trimmed') and Stata (robvar) |
What to do after Levene’s test
A significant result (p ≤ α) means the equal-variance assumption is not safe. For two groups, switch from the pooled t-test to Welch’s t-test; for three or more, use Welch’s ANOVA or a robust alternative instead of the classic F-test, and prefer Games–Howell over Tukey’s HSD for follow-up comparisons.
A non-significant result does not prove the variances are equal. With small groups the test often misses real differences, and with very large groups it flags differences too small to matter. Look at the variance ratio as well: ANOVA and the pooled t-test cope well when the largest variance is under about four times the smallest and the group sizes are similar.
Sources and how the results were checked
The method follows Levene (1960) and Brown and Forsythe (1974). The worked example and the example presets were checked against SciPy 1.18 (scipy.stats.levene with center='median', 'mean' and 'trimmed') and agree to the decimals shown: W = 6.6576, p = 0.0045 (median) and W = 6.8063, p = 0.0040 (mean).
- Levene, H. (1960). Robust tests for equality of variances. In I. Olkin (Ed.), Contributions to Probability and Statistics: Essays in Honor of Harold Hotelling (pp. 278–292). Stanford University Press.
- Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364–367. doi:10.1080/01621459.1974.10482955
- NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.10 Levene Test for Equality of Variances.
- SciPy documentation, scipy.stats.levene.
Common use cases
- Checking the equal-variance assumption before a pooled t-test or one-way ANOVA.
- Comparing the consistency of several machines, production lines, laboratories or suppliers.
- Testing whether a treatment changes the variability of a response, not just its average.
- Deciding between Tukey’s HSD and Games–Howell for post-hoc comparisons.
- Reproducing the Levene F that SPSS, R or Python reports for a homework or thesis table.
Assumptions and limitations
- Independent observations: the groups must contain different, unrelated units. Repeated measurements on the same subjects need a different approach.
- Raw data required: the test is built from individual deviations, so it cannot be computed from means and standard deviations alone. With only summary statistics for two groups, the F-Test Calculator is the fallback, but it assumes normal data.
- Low power in small samples: with fewer than about 10 values per group, real differences in spread are often missed. Many statisticians skip the preliminary test and use Welch’s t-test by default.
- The test compares spread around each group’s own centre. It does not test whether the centres differ; use the ANOVA Calculator or a t-test for that.
- To test one variance against a claimed value rather than against other groups, use the One-Sample Variance Test Calculator.
- Check normality separately with the Shapiro–Wilk Test Calculator; Levene’s test does not tell you whether the data are normal.
Frequently asked questions
What is Levene’s test?
How is Levene’s test calculated?
What is the difference between Levene’s test and the Brown–Forsythe test?
How do I interpret the p-value of Levene’s test?
Why does my Levene’s test result differ from SPSS?
leveneTest centre on the median unless told otherwise. Set the centre to Mean in this calculator to reproduce the SPSS value; the two versions usually agree on the decision but not on the exact F.Is Levene’s test better than the F-test for equal variances?
What are the degrees of freedom for Levene’s test?
What should I do if Levene’s test is significant?
Cite this page
Statculator. (2026, November 14). Levene’s Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/levenes-test-calculator/