Goodness of Fit

Levene's Test

Levene's Test checks whether two or more groups have equal variances (homogeneity of variance). Use it to verify the equal-variance assumption before running ANOVA or t-tests.

Share
Levene's Test

Quick Hits

  • Tests whether two or more groups have equal variances
  • Used to check the homogeneity of variance assumption for ANOVA and t-tests
  • More robust than Bartlett's test when data is not perfectly normal
  • Null hypothesis: all group variances are equal (rejecting means unequal)
  • Three variants: based on mean, median (Brown-Forsythe), or trimmed mean

The StatsTest Flow: Difference or Goodness of Fit >> Testing Distribution Assumptions >> Do groups have equal variance?

Not sure this is the right statistical method? Use the Choose Your StatsTest workflow to select the right method.


What is Levene's Test?

Levene's Test is a statistical test that assesses whether the variances of a continuous variable are equal across two or more groups. It is the most commonly used test for the homogeneity of variance assumption required by ANOVA and the standard t-test.

The test works by computing the absolute deviations of each observation from its group center (mean, median, or trimmed mean), then performing a one-way ANOVA on these deviations. A significant result indicates the group variances are not equal.

Levene's Test is also called Levene's Test for Equality of Variances. The median variant is called the Brown-Forsythe Test.


Assumptions for Levene's Test

The assumptions include:

  1. Continuous Data
  2. Two or More Independent Groups
  3. Independent Observations

Continuous Data

The variable being tested must be continuous. Levene's test is not meaningful for categorical or binary outcomes.

Two or More Independent Groups

You need at least two groups to compare. The groups must be independent of each other.

Independent Observations

Observations within each group must be independent.


When to use Levene's Test?

  1. You want to check the equal-variance assumption before running ANOVA or a t-test
  2. Your data may not be perfectly normal (Levene's is robust to non-normality)
  3. You have two or more independent groups

Levene's vs. Bartlett's Test

Bartlett's test is an alternative variance equality test that is more powerful when data is normal but very sensitive to non-normality. Use Levene's test (especially the median variant) as the default because most real-world data is not perfectly normal.

If you are testing normality itself, use the Shapiro-Wilk Test. If you are testing whether your data follows a specific distribution, use the Kolmogorov-Smirnov Test.


Levene's Test Example

Before running a One-Way ANOVA comparing customer satisfaction scores across three pricing tiers (basic, pro, enterprise), you check whether the variance of satisfaction scores is similar across tiers.

Levene's test (median variant): F(2, 297) = 1.34, p = 0.26.

Since p > 0.05, the equal-variance assumption holds and you proceed with the standard ANOVA. If it had been significant, you would use Welch's ANOVA or the Kruskal-Wallis Test instead.


References

  1. https://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm
  2. https://online.stat.psu.edu/stat501/lesson/10/10.4

Frequently Asked Questions

What should I do if Levene's test is significant?
If variances are unequal, you have several options: (1) Use Welch's t-test or Welch's ANOVA instead of the standard versions, as they do not assume equal variances. (2) Use a non-parametric test like Mann-Whitney U or Kruskal-Wallis. (3) Use Games-Howell post-hoc tests instead of Tukey HSD for pairwise comparisons.
Which variant of Levene's test should I use?
The median variant (Brown-Forsythe test) is the most robust and recommended for general use. The mean variant is the original but is sensitive to non-normal data. The trimmed mean variant is a compromise. Most software defaults to the median variant.
Should I always test variance equality before a t-test?
Many statisticians now recommend simply using Welch's t-test by default, which does not assume equal variances and performs well even when variances are equal. This avoids the two-stage testing problem where your overall Type I error rate is affected by the preliminary test.

Key Takeaway

Levene's test is the standard method for testing the equal-variance assumption. Use the median (Brown-Forsythe) variant for robustness. However, consider using Welch's t-test or Welch's ANOVA by default, which avoid the need for a preliminary variance test altogether.

Send to a friend

Share this with someone who loves clean statistical work.