Bartlett's Test Calculator
Bartlett's test examines whether the population variances of k groups are equal, using a likelihood ratio approach. The logarithm of each group variance is compared with the logarithm of the pooled variance; when the variances are close to one another the difference is small, and when they diverge it produces a large χ² value. To remove the small-sample bias, the statistic is divided by the correction factor C.
The defining property of this test is its extreme sensitivity to whether the groups are normally distributed: when the kurtosis departs from normal, Bartlett frequently rejects H₀ even if the variances really are equal. That is why this calculator also tests every group with Shapiro-Wilk, computes the Brown-Forsythe (median-centered Levene) result on the same data, and states it plainly as a warning when the two tests diverge. Bartlett should be preferred only when normality has been confirmed with confidence; under that condition it is more powerful than Levene's test.
Bartlett Test Statistic
sᵢ² = Σ(xᵢⱼ − x̄ᵢ)² / (nᵢ − 1) — group variance
S²ₚ = Σ (nᵢ − 1)·sᵢ² / (N − k) — pooled variance
T₀ = (N − k)·ln S²ₚ − Σ (nᵢ − 1)·ln sᵢ²
C = 1 + [ Σ 1/(nᵢ − 1) − 1/(N − k) ] / ( 3(k − 1) )
χ² = T₀ / C ~ χ²(k − 1)
df = k − 1; decision: reject H₀ if χ² > χ²_{k−1}(1 − α) or p < α
H₀: σ₁² = σ₂² = … = σₖ² · H₁: at least one variance differsBartlett's test REQUIRES the groups to be normally distributed and is extremely sensitive to that assumption; on non-normal data the false positive rate climbs far above the nominal level. If normality has not been confirmed with confidence, Brown-Forsythe (median-centered Levene) should be preferred. R's bartlett.test() and the Bartlett row in Minitab's "Test for Equal Variances" output use the same formula.
How to Calculate
- Write all the values of one group on each line; if you like, start a line with a label in the form "Group name: values".
- Choose the significance level; α = 0.05 is standard for assumption checks.
- Look at the normality check row FIRST: if Shapiro-Wilk rejects normality in even one group, do not report the Bartlett result.
- Read χ², the correction factor C, and the p-value; if p < α, the variances are not homogeneous.
- Inspect the ln sᵢ² column in the group variance table: the group that departs most from the logarithm of the pooled variance dominates the statistic.
- Check the Brown-Forsythe comparison; if the two tests diverge, base your decision on Brown-Forsythe, which is robust to non-normality.
Worked Examples
Three teaching methods — normal groups, different variances (n = 10 x3)
The group variances are 3.73, 23.60, and 6.68, and the pooled variance is 11.34. The raw statistic is 8.1620, and with the correction C = 1.0494 it becomes χ²(2) = 7.778 with p = 0.020; since the critical χ² is 5.9915, homogeneity of variance is rejected. The Shapiro-Wilk p-values of the three groups are 0.814, 0.322, and 0.840, so Bartlett's test is an appropriate choice here, and Brown-Forsythe reaches the same decision (W = 8.1701; p = 0.002).
Bartlett χ² (corrected): 7.7779 · Raw statistic (before the correction): 8.1620 · Correction factor (C): 1.0494
Three groups with homogeneous variances (n = 12 x3)
The variances are 2.09, 1.90, and 1.90, and the pooled variance is 1.96. With the correction C = 1.0404, χ²(2) = 0.032 and p = 0.984; since the critical value is 5.9915, homogeneity of variance holds comfortably. Very different means do not affect the equality of variances — Bartlett's test is concerned only with the spread.
Bartlett χ² (corrected): 0.0321 · Raw statistic (before the correction): 0.0334 · Correction factor (C): 1.0404
A false positive caused by a violation of normality (2 groups)
A single value of 31 in the control group raises its variance to 11.39 (against 2.22 in the treatment group). Bartlett gives χ²(1) = 5.153 with p = 0.023 and rejects homogeneity of variance; but the Shapiro-Wilk p-value of the control group is below 0.001, meaning the normality assumption has collapsed. On the same data Brown-Forsythe gives W(1; 18) = 0.0847 with p = 0.774 and sees no problem at all. The Bartlett rejection stems not from a difference in variance but from a single outlier.
Bartlett χ² (corrected): 5.1527 · Raw statistic (before the correction): 5.4390 · Correction factor (C): 1.0556