Levene's Test Calculator

Test equality of variances.

Example:

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 (σ12=σ22=⋯=σk2\sigma_1^2 = \sigma_2^2 = \cdots = \sigma_k^2) Alternative: At least one group has a different variance.

Why Test for Equal Variances?

Many statistical tests assume equal variances across groups:

TestAssumption
Two-sample t-testEqual variances (pooled version)
One-way ANOVAHomogeneity of variance
Two-way ANOVAEqual variances across cells
LSD, Tukey HSDEqual 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

Zij=∣Xij−Xˉi∣Z_{ij} = |X_{ij} - \bar{X}_i|

Where Xˉi\bar{X}_i is the group mean (or median, or trimmed mean).

Step 2: Perform one-way ANOVA on the ZZ values

If groups have equal variances, these deviations should have equal means.

Test Statistic

W=(N−k)(k−1)⋅∑i=1kni(Zˉi−Zˉ)2∑i=1k∑j=1ni(Zij−Zˉi)2W = \frac{(N-k)}{(k-1)} \cdot \frac{\sum_{i=1}^{k} n_i(\bar{Z}_i - \bar{Z})^2}{\sum_{i=1}^{k}\sum_{j=1}^{n_i}(Z_{ij} - \bar{Z}_i)^2}

This follows an F-distribution with (k−1,N−k)(k-1, N-k) degrees of freedom.

Variants of Levene's Test

Mean-Based (Original Levene)

Uses deviations from group means:

Zij=∣Xij−Xˉi∣Z_{ij} = |X_{ij} - \bar{X}_i|

Good for symmetric distributions.

Median-Based (Brown-Forsythe)

Uses deviations from group medians:

Zij=∣Xij−X~i∣Z_{ij} = |X_{ij} - \tilde{X}_i|

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 AGroup BGroup C
233145
253550
222943
273348

Step 1: Calculate group medians

  • Median A = 24
  • Median B = 32
  • Median C = 46.5

Step 2: Calculate absolute deviations from medians

Group AGroup BGroup C
111.5
133.5
233.5
311.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

F=0.47F = 0.47, p=0.64p = 0.64

Conclusion: No evidence of unequal variances (p=0.64p = 0.64).

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 RatioConcern Level
< 2Generally acceptable
2-3Minor concern
3-4Moderate concern
> 4Serious 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:

  1. Low power with small samples: When you most need equal variances, you can't reliably detect violations
  2. Conditional procedures inflate error rates: Choosing test based on preliminary test results changes overall Type I error
  3. 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

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.