Understand the idea
This test asks a question about SPREAD, not center: do these groups vary around their own averages by roughly the same amount, or is one group much more erratic than another? Two groups can have identical average values while one is tightly clustered and the other is scattered wide; this test specifically catches that difference in consistency, which a test of means would completely miss.
Why does this matter beyond curiosity? The classic (pooled) two-sample t-test and the ordinary one-way ANOVA both quietly ASSUME every group has roughly the same spread, and pool that spread into one shared estimate. If that assumption is actually wrong, the p-values those tests report can be meaningfully off. So this test is often run first, as a check: if the spreads really do look unequal, switch to Welch's t-test for two groups, or for three or more read the Alexander-Govern test that the One-Way ANOVA card lists under Alternative Tests; neither needs that assumption.
Of the three test variants offered, Brown-Forsythe (which measures each point's distance from its group's MEDIAN rather than its mean) is the general-purpose recommendation, because it stays reliable even when the underlying data are skewed or have outliers. Bartlett's test is more powerful when every group really is normally distributed, but that same sensitivity becomes a liability on non-normal data: it can mistake ordinary skewness for a genuine difference in spread and produce a flood of false alarms.
This homoscedasticity test checks homogeneity of variance, meaning whether the groups have equal spread. Levene's test in its Brown-Forsythe test form measures spread around each group's median instead of its mean, which keeps it reliable on skewed data.
Practitioner explanation
KernelStats offers Levene's (mean-centered, Z_ij = |Y_ij - Ybar_i|, an ANOVA F-test on the deviations), Brown-Forsythe (identical construction but median-centered, Z_ij = |Y_ij - Ytilde_i|, the default of R's car::leveneTest, the recommended general-purpose choice and this card's default, the same check the One-Way ANOVA card runs; the mean-centered Levene form is available as an option), and Bartlett's (a likelihood-ratio test directly on the group variances, chi-square distributed under H0, the MOST POWERFUL of the three when every group is genuinely normal but also the most fragile, rejecting far too often on non-normal data by mistaking skewness for unequal variance).
The product provides a direct decision table rather than leaving the choice ambiguous: Bartlett when data are roughly normal and maximum power matters; Brown-Forsythe for skewed/heavy-tailed/outlier-prone data OR as the general default when unsure; Levene specifically when a textbook or requirement calls for 'Levene's test' by name. A Shapiro-Wilk normality check per group is run automatically and the card WARNS explicitly when Bartlett specifically is at risk from non-normal data, rather than silently reporting Bartlett's result without flagging that its core assumption may be violated.
The product states plainly and repeatedly that this test's ONLY job is checking variance equality, never normality (a separate, distinct question requiring Shapiro-Wilk or a Q-Q plot), and that a non-significant result here NEVER proves the variances are truly equal; it only means the test lacked sufficient evidence to reject equality, which is a particularly weak conclusion with small group sizes since all three variance tests are comparatively low-powered to begin with.
When to use it
Consider it when
You want to check homogeneity of variance, either as a prerequisite assumption check for a pooled t-test or classic ANOVA, or as a genuine question in its own right (do these groups differ in spread, consistency, or precision).
Use caution when
Group sizes are very small (all three variance tests are low-powered in that regime, and a non-significant result is weak evidence for equal variances), or Bartlett's test is chosen despite a per-group normality check flagging non-normality (switch to Brown-Forsythe instead, which the card's own warning directs you toward).
Formulas and symbols
Levene's test statistic (mean-centered)
Z_ij = |Y_ij - Ybar_i| the absolute deviation from the group mean. Under H0, W ~ F(k-1, N-k).
Brown-Forsythe test statistic (median-centered)
Identical construction to Levene's but centered on each group's median, making it robust to skewed or heavy-tailed data. The recommended general-purpose default.
Bartlett's test statistic
s_p^2 the pooled variance, C a small-sample correction factor. Under H0, T ~ chi-square(k-1). Most powerful under normality, most fragile without it.
Assumptions and checks
- Independence of observations. This test assumes observations within and across groups are independent; violating this invalidates the variance comparison regardless of which method (Levene, Brown-Forsythe, Bartlett) is selected.
In KernelStats: Not checked by KernelStats: assumed from the study design; stated directly as a standing reminder.
- Normality (of residuals, not of the raw data). Bartlett's test is highly sensitive to non-normality: a significant Bartlett result can reflect non-normal data rather than genuinely unequal variances; Levene's and Brown-Forsythe's tests are robust to this and are the recommended default for that reason.
In KernelStats: Checked directly: Shapiro-Wilk is run on each group and the worst (smallest) p-value is reported; the card notes when the selected method (Levene/Brown-Forsythe) is robust to the departure it found, versus when Bartlett's result might be confounded by non-normality.
- A group with fewer than 2 observations has an undefined variance, so it cannot be compared to any other group's spread.
In KernelStats: Checked directly: the card confirms every tested group has at least 2 observations before computing the comparison.
Alternatives
- Two-Sample t-Test. You want to compare means directly, and KernelStats's default Welch's t-test does not require this equal-variances check at all, since it handles unequal variances automatically.
- Normality Test (Battery). The actual question is about the SHAPE of the distribution (normality), not the equality of spread across groups, a genuinely different question this test does not answer.
Worked example
Scenario
Comparing the variance of body mass across three penguin species with the card's default test, Brown-Forsythe (median-centered).
Result
Brown-Forsythe W(2, 339) = 5.12, p = .006 (Levene W = 5.34, p = .005; Bartlett chi-square(2) = 5.99, p = .050); SDs are 459 g (Adelie), 384 g (Chinstrap) and 504 g (Gentoo), and at least one species fails Shapiro-Wilk (smallest p = .032).
Interpretation
The three species differ in the spread of body mass, not just in average (the largest SD is about 1.3 times the smallest). Because one species departs from normality, Bartlett's borderline result is the one to distrust here, and Brown-Forsythe's, which does not need normality, is the one to report. A variance ratio of 1.7 is modest, but to compare the three means, read the Alexander-Govern test that the One-Way ANOVA card lists under Alternative Tests: it allows for unequal spreads (for two groups, Welch's t-test does the same).
Dataset: penguins.csv
Common misconceptions
Misconception
A non-significant equal-variances test result proves the group variances are truly equal.
Correction
Failing to reject the null hypothesis means the test lacked sufficient evidence to detect a difference in spread: it does not prove the variances are equal. This is especially weak evidence with small samples, since all three variance tests have limited power to begin with.
Read more: Misconception: a non-significant result proves there is no effect
Misconception
Levene's test (or any of these three tests) checks whether the data are normally distributed.
Correction
These tests check equality of VARIANCE across groups specifically: they say nothing about whether the data within each group follow a normal distribution. Normality is a separate, distinct question, checked with a Shapiro-Wilk test or a Q-Q plot, not with an equal-variances test.
References
- NIST/SEMATECH e-Handbook of Statistical Methods, §1.3.5.10 Levene test for equality of variances, NIST/SEMATECH (2012), §1.3.5.10.
- Robust tests for the equality of variances, Brown, M. B. and Forsythe, A. B. (1974), Journal of the American Statistical Association, 69(346), 364-367.
