Bartlett's Test Calculator
Statistics
- Pooled variance: the df-weighted mean of the three variances is Sp^2 = 5.32 on 30 degrees of freedom.
- Log contrast: M = 30 ln(5.32) - sum((ni - 1) ln(si^2)) = 0.230.
- Correction: C = 1.045, so chi-square = M / C = 0.22 on 2 degrees of freedom.
- Bartlett result: chi-square 0.22, p = exp(-chi2 / 2) = 0.8959 for the equal-variance null.
Before an ANOVA pools three groups into one error term, it assumes their variances are equal. Bartlett's test is the classic check of that assumption: it contrasts the pooled variance with the geometric spread of the group variances on a log scale, producing a chi-square statistic. This calculator runs the test for three groups from their sizes and variances, and - because three groups mean exactly 2 degrees of freedom - it reports the p-value in its exact closed form, p = exp(-chi2/2), with no table or approximation between you and the answer.
The test is powerful and famously touchy: it detects unequal variances efficiently when the data are normal, and it also detects non-normality and calls it unequal variance. Knowing both halves of that reputation is part of using it well.
Bartlett's test is nearly a century old and still the default variance check in statistics packages, which makes understanding its temperament a practical necessity rather than a history lesson. This page's version is deliberately narrow - three groups, exact tail - because the three-group pre-ANOVA check is the use the test actually sees, and because the closed-form p-value at 2 degrees of freedom removes the last excuse for reporting the statistic without its probability.
Worked examples
Variances 4.5, 6.1, 5.2 - homogeneous
(10 · 4.5 · 12 · 6.1 · 11 · 5.2)
| Bartlett chi-square | 0.22 (df = 2) |
| Pooled variance | 5.32 |
| Correction factor C | 1.045 |
| p-value | 0.8959 |
Variances 2.0, 9.0, 4.0 on groups of 8
(8 · 2 · 8 · 9 · 8 · 4)
| Bartlett chi-square | 3.63 (df = 2) |
| Pooled variance | 5.00 |
| Correction factor C | 1.063 |
| p-value | 0.1628 |
Larger groups: chi-square 4.39
(15 · 12.5 · 10 · 3.1 · 20 · 8.4)
| Bartlett chi-square | 4.39 (df = 2) |
| Pooled variance | 8.63 |
| Correction factor C | 1.035 |
| p-value | 0.1113 |
The log-contrast idea
If all groups shared one variance, the pooled variance - the degrees-of-freedom-weighted average - would estimate it well, and each group variance would hover nearby. Bartlett's statistic measures the gap between the log of that pooled value and the weighted average of the logs, a contrast that is zero when all variances agree and grows as they separate. Multiplying by the total degrees of freedom puts it on the chi-square scale.
Small samples bias the raw statistic upward, so Bartlett's correction factor C divides it back down; C runs from 1.035 to 1.063 across this page's examples, a few percent of honesty. With three groups the reference distribution has 2 degrees of freedom, whose survival function is a pure exponential - the one case where a chi-square p-value needs no numerical machinery at all.
The log scale is doing deep work in the statistic. Variances are multiplicative creatures - a group twice as variable has four times the variance - and logarithms turn those ratios into symmetric differences, so the contrast treats 'half' and 'double' as equal offences. The geometric-mean character of the test is why it pairs naturally with the lognormal-ish behaviour of sample variances, and why its power against genuine variance inequality, when normality holds, exceeds the deviation-based alternatives.
The test's construction explains its temperament in one line: it is a likelihood-ratio statistic, optimal against the alternatives the normal model imagines, and therefore exquisitely tuned to exactly the model it assumes. Feed it normal data with unequal variances and it is the best detector available; feed it heavy-tailed data with equal variances and it detects the tails. This is not a flaw to apologise for but a specification to read - Bartlett's test tests the joint proposition 'normal, with equal variances', and a rejection indicts the conjunction.
- Pooled variance: df-weighted mean of the group variances
- Statistic: M = (N - k) ln Sp^2 - sum (ni - 1) ln si^2
- Correction: chi2 = M / C, with C from the group sizes
- At df = 2, p = exp(-chi2 / 2) exactly
Worked examples
The examples are calibrated to the three verdicts an analyst actually meets: nothing to see, a spread that looks alarming but cannot be convicted on the available data, and the same disagreement sharpened by larger samples into the test's grey zone.
Groups of 10, 12 and 11 with variances 4.5, 6.1 and 5.2 return 0.22 (df = 2), with Pooled variance 5.32, Correction factor C 1.045, p-value 0.8959. Variances this close are what homogeneity looks like; an ANOVA can proceed without a second thought.
Three groups of 8 with variances 2.0, 9.0 and 4.0 return 3.63 (df = 2), with Pooled variance 5.00, Correction factor C 1.063, p-value 0.1628. A fourfold spread between the largest and smallest variance, yet the small samples cannot convict it - the test honestly reports its own uncertainty.
Groups of 15, 10 and 20 with variances 12.5, 3.1 and 8.4 return 4.39 (df = 2), with Pooled variance 8.63, Correction factor C 1.035, p-value 0.1113. The closest call of the three: more data has sharpened the same size of disagreement to the edge of respectability.
Read the pooled variances across the examples - 5.32, 5.00, 8.63 - and notice they play no role in the verdict by themselves. Bartlett's test is entirely about the disagreement among the group variances around that pooled value, weighted by their degrees of freedom; the pooled figure is the centre the disagreement is measured from, nothing more.
Bartlett versus Levene
Levene's test answers the same question with absolute deviations instead of logs, trading power for robustness: it barely notices non-normality. Bartlett notices everything. The working rule is to use Bartlett when normality is independently credible - residuals inspected, measurement process understood - and Levene (or Brown-Forsythe) when it is not. Running Bartlett on skewed data and reporting 'variances differ' is one of the most common false alarms in applied statistics.
Also read the verdict in context: with huge samples Bartlett rejects over variance differences too small to harm an ANOVA, and with tiny samples it waves through differences that would. The statistic and p-value on this page are the evidence; the decision still belongs to the analyst who knows the design.
Sample size steers this test more than most. Doubling every group in the second example, with identical variances, would push its chi-square from 3.63 toward significance without the data pattern changing at all - the test would be reporting its own power, not a new fact about the variances. Conversely the first example's calm verdict is genuinely informative because its groups are a little larger. Report group sizes with the result, as the worked examples do, so a reader can tell a verdict from a power statement.
Practically, the test is often run as one panel in a small diagnostics row - a normality check beside it, a Levene cross-check under it - and its chi-square read as evidence rather than verdict. The exact p-value at 2 degrees of freedom that this page provides makes that panel unusually honest for the three-group case: there is no approximation left to hide behind, so whatever the number says, it says about the data and the assumptions, not about the numerics.
| Variances | Pooled | chi2 | p-value |
|---|---|---|---|
| 4.5, 6.1, 5.2 | 5.32 | 0.22 | 0.8959 |
| 2.0, 9.0, 4.0 | 5.00 | 3.63 | 0.1628 |
| 12.5, 3.1, 8.4 | 8.63 | 4.39 | 0.1113 |
Scope of this calculator
This page covers the three-group case, the most common pre-ANOVA check and the one with the exact exponential tail. The inputs are summary statistics - group sizes and variances - so no raw data upload is needed; variances from a spreadsheet or a paper's table drop straight in. If your software reports standard deviations, square them first. For more than three groups the same formulas generalise, but the degrees of freedom rise and the p-value leaves its closed form behind.
A final housekeeping point: the test consumes variances, and the world's software is split between reporting variances and standard deviations, in tables that do not always label which. Squaring an SD that was already a variance - or the reverse - manufactures a rejection or a pass out of thin air. The examples' magnitudes are a sanity anchor: variances of single digits against means in the tens are typical of well-behaved measurements; if your inputs look wildly different in scale, check the label before the test.
A closing perspective on the test's place in the workflow: variance homogeneity is a means, not an end. A rejected Bartlett test does not forbid the analysis - it redirects it, toward a Welch-style ANOVA that drops the assumption, a transformation that stabilises the variances, or a model that lets each group keep its own spread. The chi-square on this page is the signpost at that junction, and its exact p-value makes the direction it points as unambiguous as a three-group check can honestly be.
FAQs
What chi-square do variances 4.5, 6.1, 5.2 give?
0.22, with p = 0.8959 - no evidence against equal variances. The pooled variance is 5.32.
What is the pooled variance there?
5.32, the degrees-of-freedom-weighted mean of the three variances, on 30 degrees of freedom.
Variances 2.0, 9.0 and 4.0 - significant?
Chi-square 3.63, p = 0.1628 - not significant. Eight observations per group cannot convict even a fourfold variance spread.
Why is the p-value a simple exponential?
With three groups the test has 2 degrees of freedom, and the chi-square survival function at 2 df is exactly exp(-chi2/2).
What does the correction factor do?
It divides the raw log-contrast to remove small-sample bias: C is 1.045, 1.063 and 1.035 across the examples.
Which example comes closest to rejecting?
The third - chi-square 4.39, p = 0.1113, on a pooled variance of 8.63. Still short of the usual 0.05 line.