Bartlett's Test Calculator

StatisticsLast updated: August 22, 2026

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.

Write all the values of one group on each line. You can start a line with a label in the form "Name: values". At least 2 groups, at least 2 values per group, and a variance greater than zero are required.
Sets the false positive risk. In the social sciences 5% is the common choice.

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 differs

Bartlett'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

  1. 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".
  2. Choose the significance level; α = 0.05 is standard for assumption checks.
  3. Look at the normality check row FIRST: if Shapiro-Wilk rejects normality in even one group, do not report the Bartlett result.
  4. Read χ², the correction factor C, and the p-value; if p < α, the variances are not homogeneous.
  5. 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.
  6. 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

Frequently Asked Questions

When should Bartlett's test be used, and when should it not?
If it has been confirmed with confidence that the groups are normally distributed, Bartlett is the preferred choice; under that condition it is more powerful than Levene's test, meaning it detects real differences in variance with smaller samples. It should not be used when normality is doubtful, or when the data is skewed, heavy-tailed, or contains outliers — in those cases the false positive rate rises quickly and Brown-Forsythe should be preferred.
What does the correction factor C correct?
The raw Bartlett statistic is biased upward in small samples: it systematically produces larger values than the true χ² distribution and rejects H₀ more often than it should. The factor C is always greater than 1 and grows as the number of observations per group falls; dividing the statistic by it removes the bias. As n grows, C rapidly approaches 1 and the effect of the correction disappears.
Which should I trust if Bartlett and Levene disagree?
Check the normality of the groups first. If all the groups are normal and Bartlett is significant while Levene is not, Bartlett's higher power has most likely detected a real difference. If even one group is not normal, the Bartlett rejection is probably driven by the violation of normality, and the Brown-Forsythe result should be reported.
Why does the pooled variance matter?
The classical one-way ANOVA and the equal-variance independent samples t-test use a single common variance for all the groups, and that value is the pooled variance. When the variances really are equal, pooling increases the degrees of freedom and strengthens the test. When they differ, the pooled variance represents no group correctly and the error rate of the test breaks down.
What happens if all the values in a group are identical?
Because the Bartlett statistic contains the term ln sᵢ², it becomes undefined for a group whose variance is zero; the calculator does not compute a result in that case and reports which group is at fault. Levene's test can still work with such a group, because it operates on absolute deviations. In practice, zero variance usually points to a measurement resolution problem or to incorrect data entry.
Is Bartlett's test available in SPSS?
The standard SPSS menus do not include the Bartlett test for homogeneity of variance; the Explore and One-Way ANOVA output offers four versions of Levene's test instead. Bartlett's test is computed with bartlett.test() in R, with "Test for Equal Variances" in Minitab, and with scipy.stats.bartlett in Python. The "Bartlett's Test of Sphericity" found in SPSS factor analysis is an entirely different test and should not be confused with this one.
If p is large in a homogeneity of variance test, are the variances equal?
No, it only means there is not enough evidence that they are unequal. In small samples the power of the test is low, so even real and important differences can go undetected. That is why you should look at the variance ratio alongside the p-value: if the ratio is above 4, using the Welch correction is safer even when the test comes out non-significant.