Tutorials › Introduction to Statistics › Levene and Brown-Forsythe Tests for Equal Variance

Multiple Comparisons and ANOVA Assumptions · Tutorial 885 of 996

Levene and Brown-Forsythe Tests for Equal Variance

Learn to calculate and interpret Levene’s and Brown-Forsythe tests, and understand what these assumption checks can—and cannot—establish.

Intermediate 12 min read

What You'll Learn

  • State the null and alternative hypotheses for equal group variances.
  • Construct absolute deviations using group means or medians.
  • Calculate the ANOVA F statistic for transformed deviations.
  • Interpret a test result in context without treating it as proof of equal variances.
  • Recognize how outliers, distribution shape, and sample size affect these checks.

Why Test for Equal Variances?

In one-way ANOVA, the equal-variance assumption means that the population response variances are the same across the groups being compared. Residual plots, as discussed in the earlier material on checking equal variances with residual plots, can reveal patterns such as a changing spread. Levene’s and Brown-Forsythe tests provide another check: they turn each observation into a measure of its distance from a group center, then compare the average distances across groups.

These tests are useful as diagnostic evidence, not as automatic pass-or-fail rules. A large p-value does not establish that the population variances are equal, and a small p-value does not tell us how serious the variance differences are for a particular analysis. The study design and the data’s distributional features still matter.

Definition: Suppose there are \(k\) independent groups, with population variances \(\sigma_1^2,\ldots,\sigma_k^2\). The equal-variance hypotheses are \(H_0:\sigma_1^2=\cdots=\sigma_k^2\) and \(H_a:\) at least one group population variance differs. Levene’s test applies a one-way ANOVA to absolute deviations from each group’s sample mean. Brown-Forsythe’s test applies the same procedure to absolute deviations from each group’s sample median.

How the Tests Are Calculated

Write \(Y_{ij}\) for observation \(j\) in group \(i\), where group \(i\) has \(n_i\) observations. Choose a center \(C_i\) for each group, and calculate a transformed value \(Z_{ij}=|Y_{ij}-C_i|\). For Levene’s test, \(C_i=\bar{x}_i\), the sample mean in group \(i\). For Brown-Forsythe’s test, \(C_i\) is the sample median in group \(i\). The test is a one-way ANOVA of the \(Z_{ij}\) values.

Let \(N=\sum_{i=1}^{k}n_i\), let \(\bar{Z}_i\) be the mean of the transformed values in group \(i\), and let \(\bar{Z}\) be their mean across all groups. The between-group and within-group sums of squares for these transformed values are

$$ SS_{\text{between}}=\sum_{i=1}^{k} n_i(\bar{Z}_i-\bar{Z})^2, \qquad SS_{\text{within}}=\sum_{i=1}^{k}\sum_{j=1}^{n_i}(Z_{ij}-\bar{Z}_i)^2. $$

Divide each sum of squares by its degrees of freedom to obtain \(MS_{\text{between}}=SS_{\text{between}}/(k-1)\) and \(MS_{\text{within}}=SS_{\text{within}}/(N-k)\). The test statistic is their ratio. Its reference distribution is an approximate \(F\) distribution with \(k-1\) and \(N-k\) degrees of freedom.

$$ F=\frac{MS_{\text{between}}}{MS_{\text{within}}} $$

A large \(F\) indicates that the group means of the absolute deviations are separated relative to the variation in those deviations within groups. The p-value is calculated using the upper tail of the reference \(F\) distribution. At significance level \(\alpha\), reject \(H_0\) if the p-value is at most \(\alpha\); otherwise, do not reject it.

Assumptions and a Justification

Before interpreting the approximate \(F\) test, consider its conditions. The observations should be independent within and across groups, as supported by how the data were collected. The response should be quantitative, and the group-specific transformed values should be suitable for the approximate ANOVA reference distribution. The approximation is most dependable when the group data are not dominated by severe skewness or extreme observations; small samples can make the test particularly sensitive to such features. No test of equal variances can establish independence, which must be assessed from the study design.

Why can comparing absolute deviations provide information about spread? If a group’s response is normally distributed with mean \(\mu_i\) and standard deviation \(\sigma_i\), then its expected absolute distance from its population mean is proportional to \(\sigma_i\):

$$ E(|Y-\mu_i|)=\sigma_i\sqrt{\frac{2}{\pi}}. $$

To see this, write \(Y=\mu_i+\sigma_i U\), where \(U\sim N(0,1)\). Then \(|Y-\mu_i|=\sigma_i|U|\), so \(E(|Y-\mu_i|)=\sigma_i E(|U|)\). Integrating the standard normal density gives

$$ E(|U|)=2\int_0^\infty u\frac{1}{\sqrt{2\pi}}e^{-u^2/2}\,du =\sqrt{\frac{2}{\pi}}, $$

which yields the result. Thus, when group distributions have a common normal shape, different standard deviations correspond to different expected absolute deviations. In practice the tests use sample centers, not population centers, and use an approximate \(F\) reference distribution; the argument explains the connection to spread, not a guarantee that every distribution meets the test’s conditions.

Worked Example: Levene’s Test From the Deviations

Suppose hypothetical measurements from three groups are: A: 8, 9, 10, 11; B: 6, 8, 10, 12; and C: 7, 9, 11, 13. Each group has four independent observations. Use Levene’s test at \(\alpha=0.05\).

The group means are 9.5, 9, and 10. The absolute deviations from those means are A: 1.5, 0.5, 0.5, 1.5; B: 3, 1, 1, 3; and C: 3, 1, 1, 3. Their group means are \(\bar{Z}_A=1\), \(\bar{Z}_B=2\), and \(\bar{Z}_C=2\), with grand mean \(\bar{Z}=5/3\).

There are \(k=3\) groups and \(N=12\) observations. The between-group sum of squares is

$$ SS_{\text{between}}=4\left[(1-5/3)^2+(2-5/3)^2+(2-5/3)^2\right]=2.667. $$

The within-group sum of squares is \(1+4+4=9\). For example, group A contributes \(3(1.5-1)^2+(0.5-1)^2=1\); each of B and C contributes 4. Therefore,

$$ MS_{\text{between}}=\frac{2.667}{2}=1.333,\qquad MS_{\text{within}}=\frac{9}{9}=1.000,\qquad F=\frac{1.333}{1.000}=1.333. $$

The degrees of freedom are 2 and 9, and the upper-tail p-value is approximately 0.311. Because \(0.311>0.05\), we do not reject equal population variances. This result does not prove the variances equal; it says these data do not provide strong evidence against equality by this test.

Worked Example: Brown-Forsythe’s Test With Different Spreads

Consider hypothetical data in three independent groups. Group A consists of 9, 10, 10, 10, 11 repeated twice; group B consists of 7, 9, 10, 11, 13 repeated twice; and group C consists of 5, 9, 10, 11, 15 repeated twice. Each group has ten observations. Apply Brown-Forsythe’s test at \(\alpha=0.05\).

The median in each group is 10. The five absolute deviations for one copy of each group’s values are A: 1, 0, 0, 0, 1; B: 3, 1, 0, 1, 3; and C: 5, 1, 0, 1, 5. Each pattern occurs twice. The transformed group means are 0.4, 1.6, and 2.4, so their grand mean is \(44/30=1.467\).

The between-group sum of squares is

$$ SS_{\text{between}}=10\left[(0.4-1.467)^2+(1.6-1.467)^2+(2.4-1.467)^2\right]=20.267. $$

For one copy of the five deviations, the within-group sums of squares are 1.2, 7.2, and 23.2; repeating each pattern doubles their total to \(SS_{\text{within}}=63.2\). Thus,

$$ MS_{\text{between}}=\frac{20.267}{2}=10.133,\qquad MS_{\text{within}}=\frac{63.2}{27}=2.341,\qquad F=\frac{10.133}{2.341}=4.329. $$

With 2 and 27 degrees of freedom, the upper-tail p-value is approximately 0.023. Since \(0.023<0.05\), reject the equal-variance null hypothesis. The test provides evidence that at least one population variance differs; it does not identify which group differs or quantify the practical importance of that difference.

Why the Choice of Center Matters

Levene’s mean-centered deviations can be affected by an extreme observation, because that observation also pulls the group mean. The median is less affected by an extreme value, so Brown-Forsythe’s version is often preferred when outliers or skewness are concerns. This greater resistance does not make it immune to unusual data or guarantee a correct conclusion for every distribution.

Worked Example: One Outlier, Two Versions

For a compact hypothetical comparison, let group A be 0, 0, 0, 4 and group B be −1, 0, 0, 1. Assume the eight observations are independent. Both groups have sample median 0. Use the two procedures to see how centering changes the transformed data.

For Levene’s test, the group means are 1 and 0. The absolute deviations are A: 1, 1, 1, 3, with mean 1.5; and B: 1, 0, 0, 1, with mean 0.5. The transformed-data grand mean is 1. The between-group sum of squares is \(4[(1.5-1)^2+(0.5-1)^2]=2\), and the within-group sum is \(3+1=4\). Therefore, \(F=(2/1)/(4/6)=3.000\), with 1 and 6 degrees of freedom and p approximately 0.134.

For Brown-Forsythe’s test, the deviations from the medians are A: 0, 0, 0, 4 and B: 1, 0, 0, 1. Their means are 1 and 0.5, and the grand mean is 0.75. The between-group sum of squares is \(4[(1-0.75)^2+(0.5-0.75)^2]=0.5\). The within-group sum is 12 for A plus 1 for B, or 13. Hence \(F=(0.5/1)/(13/6)=0.231\), with 1 and 6 degrees of freedom and p approximately 0.648.

Neither test rejects at 0.05, but the statistics differ because the centers produce different deviations. This small example illustrates sensitivity to the method; it does not establish that either test is universally preferable.

Interpretation and Limitations

The formal null concerns equal population variances. However, the calculations compare means of absolute deviations. For distributions with different shapes, equal variances need not imply equal expected absolute deviations, and different variances need not translate into a simple difference in those means. The tests are therefore best understood as assumption checks whose behavior depends partly on distribution shape, sample size, and outliers. Brown-Forsythe’s median centering improves resistance to some departures from normality, but does not remove these limitations.

A non-significant result is not evidence that the assumption has been proved. The test may have limited ability to detect variance differences, particularly with small samples. Conversely, a significant result does not by itself settle how an ANOVA analysis should proceed. Consider the result alongside residual plots, the study context, and the size of the observed spreads. These tests assess variance patterns; they do not test normality, independence, or whether group means are equal.

Common Mistakes

  • Using the response values instead of absolute deviations. The test’s ANOVA is applied to \(Z_{ij}=|Y_{ij}-C_i|\), not directly to the original responses.
  • Reversing the centers. Levene’s test uses group means; Brown-Forsythe’s version uses group medians.
  • Calling a large p-value proof of equality. A large p-value means the data do not provide strong evidence against the null; it does not establish that the variances are identical.
  • Treating the test as a complete assumption check. Neither procedure establishes independence or checks every feature of the ANOVA model.
Key takeaway: Both procedures run an ANOVA on group-specific absolute deviations. Levene’s uses means as centers, while Brown-Forsythe’s uses medians. Interpret their p-values as diagnostic evidence, not proof that equal variances hold or fail.

Check Your Understanding

Answer each question using the definitions and procedures above.

  1. State the null and alternative hypotheses for a test of equal variances across four groups.
  2. What values are analyzed in Levene’s test, and how does Brown-Forsythe’s test change their construction?
  3. A test gives p = 0.18 at \(\alpha=0.05\). What is the correct conclusion, and what conclusion would be too strong?
  4. Why can Brown-Forsythe’s test be less affected by an extreme observation than Levene’s test?
  5. Name one important assumption or limitation that these tests do not resolve.