Levene's Test Calculator
Test equality of variances.
Enter data for at least 2 groups to test variance equality
Use Levene's test to check whether different groups in your data have similar amounts of variability before running ANOVA or t-tests. Many statistical tests assume groups have equal variances—if they don't, your results may be unreliable. This test helps you decide whether to proceed with standard analysis or use alternatives designed for unequal variances, like Welch's test.
What Is Levene's Test?
Levene's test assesses whether two or more groups have equal variances (homogeneity of variance or homoscedasticity). It's a prerequisite check for many statistical procedures.
Question answered: "Do these groups have significantly different variances?"
Null hypothesis: All groups have equal variances () Alternative: At least one group has a different variance.
Why Test for Equal Variances?
Many statistical tests assume equal variances across groups:
| Test | Assumption |
|---|---|
| Two-sample t-test | Equal variances (pooled version) |
| One-way ANOVA | Homogeneity of variance |
| Two-way ANOVA | Equal variances across cells |
| LSD, Tukey HSD | Equal variances |
Violating this assumption can lead to:
- Inflated Type I error rates
- Reduced statistical power
- Incorrect confidence intervals
How It Works
The Levene Approach
Instead of testing variances directly (which requires normality), Levene's test converts the problem to an ANOVA on transformed data.
Step 1: Calculate deviations from group center
Where is the group mean (or median, or trimmed mean).
Step 2: Perform one-way ANOVA on the values
If groups have equal variances, these deviations should have equal means.
Test Statistic
This follows an F-distribution with degrees of freedom.
Variants of Levene's Test
Mean-Based (Original Levene)
Uses deviations from group means:
Good for symmetric distributions.
Median-Based (Brown-Forsythe)
Uses deviations from group medians:
More robust to non-normality and outliers. Most commonly recommended.
Trimmed Mean-Based
Uses deviations from 10% trimmed means.
Compromise between mean and median approaches.
Example Calculation
Data:
| Group A | Group B | Group C |
|---|---|---|
| 23 | 31 | 45 |
| 25 | 35 | 50 |
| 22 | 29 | 43 |
| 27 | 33 | 48 |
Step 1: Calculate group medians
- Median A = 24
- Median B = 32
- Median C = 46.5
Step 2: Calculate absolute deviations from medians
| Group A | Group B | Group C |
|---|---|---|
| 1 | 1 | 1.5 |
| 1 | 3 | 3.5 |
| 2 | 3 | 3.5 |
| 3 | 1 | 1.5 |
Step 3: Perform ANOVA on these deviations
Mean deviations: A = 1.75, B = 2.0, C = 2.5 Grand mean = 2.08
Step 4: Calculate F statistic and p-value
,
Conclusion: No evidence of unequal variances ().
Interpretation
Non-Significant Result (p ≥ 0.05)
Equal variance assumption is reasonable. Proceed with:
- Pooled t-test
- Standard ANOVA
- Traditional post-hoc tests
Significant Result (p < 0.05)
Evidence of unequal variances. Consider:
- Welch's t-test (for two groups)
- Welch's ANOVA (for multiple groups)
- Games-Howell post-hoc test
- Data transformation
Sample Size Considerations
Small Samples
- Low power to detect variance differences
- Non-significant results may not indicate equal variances
- Consider using robust alternatives anyway
Large Samples
- High power—may detect trivial differences
- Consider the ratio of variances, not just p-value
- Practical significance: variance ratio > 2 or 3 is concerning
Rules of Thumb
Even without formal testing:
| Largest/Smallest Variance Ratio | Concern Level |
|---|---|
| < 2 | Generally acceptable |
| 2-3 | Minor concern |
| 3-4 | Moderate concern |
| > 4 | Serious concern |
With equal sample sizes, ANOVA is robust to moderate variance heterogeneity.
What to Do If Variances Are Unequal
For Two Groups
Use Welch's t-test, which doesn't assume equal variances.
For Multiple Groups
Use Welch's ANOVA or Brown-Forsythe ANOVA, which adjust degrees of freedom for unequal variances.
Post-Hoc Comparisons
Use Games-Howell test instead of Tukey HSD.
Transform Data
Log or square root transformations can stabilize variances.
Non-Parametric Alternatives
Kruskal-Wallis or Mann-Whitney tests are less sensitive to variance differences.
Comparison with Other Tests
Bartlett's Test
More powerful when data is normal, but very sensitive to non-normality. Not recommended unless normality is certain.
F-Test for Two Variances
Only for two groups and requires normality. Levene's test is more robust.
Fligner-Killeen Test
Non-parametric test based on ranks. Very robust but lower power.
Common Misconceptions
"Levene's Test Must Be Significant to Proceed"
False. You want non-significance—that indicates equal variances are plausible.
"Always Run Levene's Test Before ANOVA"
Debatable. With equal sample sizes, ANOVA is robust. Some statisticians recommend always using Welch's ANOVA instead of preliminary testing.
"Significant Levene's = Invalid ANOVA"
Not necessarily. ANOVA may still be valid with large, equal-sized groups.
The Preliminary Testing Problem
Some statisticians argue against routine use of Levene's test because:
- Low power with small samples: When you most need equal variances, you can't reliably detect violations
- Conditional procedures inflate error rates: Choosing test based on preliminary test results changes overall Type I error
- Alternative approach: Always use robust methods (Welch's tests) regardless
Reporting Results
When variances are equal:
"Levene's test indicated no significant difference in variances, F(2, 45) = 1.24, p = .30."
When variances are unequal:
"Levene's test indicated significant heterogeneity of variance, F(2, 45) = 4.82, p = .01. Therefore, Welch's ANOVA was used for the main analysis."
Historical Context
Howard Levene proposed this test in 1960 as a robust alternative to Bartlett's test. The median-based modification (Brown-Forsythe) came in 1974, improving robustness further.
The key insight was that testing variance differences could be reframed as testing mean differences of absolute deviations—allowing use of the robust ANOVA framework.
Related Calculations
- Variance Calculator — Calculate variance
- Standard Deviation Calculator — Calculate SD
- Welch's T-Test — T-test for unequal variances
- One-Way ANOVA — Compare group means
Summary
Levene's test assesses whether groups have equal variances, a key assumption for t-tests and ANOVA. The median-based version (Brown-Forsythe) is most robust. A significant result indicates unequal variances—use Welch's tests or Games-Howell post-hoc. Non-significance suggests equal variances are plausible. Consider the practical magnitude (variance ratios) alongside p-values. Some statisticians recommend always using robust methods rather than preliminary testing.