AI Glossary / Statistics and probability / Intermediate
Bartlett's test
Definition
Bartlett's test is a statistical test of whether several independent normal populations have the same variance. It combines sample variances into a corrected statistic compared with an approximate chi-square reference distribution. This entry concerns the homogeneity-of-variances test, which is distinct from Bartlett's test of sphericity used in factor analysis.
What it means
Variance describes how widely values spread around their mean. Groups may have similar averages but very different consistency, making equality of variances a separate question from equality of means.
Bartlett's null hypothesis states that every population variance is equal. The alternative says that at least one pair differs; it does not say that every group differs from every other group.
The test relies strongly on distributional assumptions. Skewness or heavy tails can distort its calibration, so a rejection may reflect departures from normality as well as variance differences. A non-significant result also does not prove equal variances, particularly when samples contain little information.
How it works
For each of k groups, calculate the sample size n_i and the sample variance s_i squared using its n_i - 1 degrees of freedom. Let N be the total sample size.
Construct the pooled variance as the sum of (n_i - 1) times each sample variance, divided by N - k. The numerator of Bartlett's statistic is (N - k) times the natural logarithm of that pooled variance, minus the sum of (n_i - 1) times the logarithm of each group variance.
Divide this numerator by a correction factor: 1 plus [the sum of 1/(n_i - 1), minus 1/(N - k)] divided by 3(k - 1). Compare the resulting statistic with a chi-square distribution having k - 1 degrees of freedom.
Large values provide evidence against equal variances under the model. Each group needs enough observations to estimate variance, and zero sample variances make the logarithmic calculation problematic. Independent sampling, approximately normal within-group distributions, and a justified treatment of missing observations are essential considerations. Unequal group sample sizes are permitted; they do not remove the distributional assumptions.
Three practical examples
- Production consistency: compare the variability of a measurement across independent samples from several machines, after checking whether normal modeling is reasonable.
- Service operations: investigate whether controlled experimental conditions produce different variability in a roughly normal performance measure.
- Simulation validation: compare variability across independent simulation settings when normally distributed outcomes are part of the data-generating design.
Think of it this way
Think of three machines aiming at the same target. One produces tightly clustered results and another scatters them widely. Comparing their average position answers an accuracy question; comparing their spread answers a consistency question. Bartlett's test addresses the latter under its normal-population model.
Worked example
Consider three independent groups, each containing six observations. Their sample variances are 1, 4, and 9 measurement-units squared. Assume normal populations for this illustration; the means are not needed to compute the test from these summaries.
Here k = 3, N = 18, and each group contributes five degrees of freedom. The pooled variance is (5 × 1 + 5 × 4 + 5 × 9) / 15 = 14/3, approximately 4.6667.
The numerator is 15 ln(14/3) - 5[ln(1) + ln(4) + ln(9)], approximately 5.1891. The correction factor is 1 + [(3/5) - (1/15)] / 6 = 1.0889. Their ratio gives a test statistic of approximately 4.7655.
With two degrees of freedom, the chi-square upper-tail probability is exp(-4.7655/2), approximately 0.0923. At a prespecified 5% significance level, this does not reject equal population variances. The substantial differences among the observed variances remain descriptively relevant; the small samples limit what can be concluded about their populations.
Illustrative case study
Fictional case: Alder Instruments measures output dimensions from three calibrated production lines. Engineers collect separate random samples during a stable operating period and inspect within-line plots before choosing a variance comparison.
Because the measurements appear reasonably compatible with normal distributions and the sampling units are independent, the analyst includes Bartlett's test in the investigation. The report presents sample sizes, variance estimates, plots, and the test result together.
When a later batch shows heavy-tailed measurements, the team revisits the analysis instead of automatically reusing the same test. Engineers also check whether a few unusual values correspond to a real equipment problem, because statistical procedure choice cannot replace process investigation.
Common misconceptions and mistakes
Do not interpret a non-significant result as certification that equal-variance assumptions are true. The test may have limited power against consequential differences.
Do not confuse this procedure with a test of equal means or with the similarly named sphericity test. Their null hypotheses and uses differ.
Do not apply it mechanically to heavily skewed durations, discrete counts, or dependent repeated measurements. The reference distribution can be inappropriate even when software returns a number.
Do not assume a rejection identifies the group responsible. Planned follow-up comparisons, visual inspection, and multiplicity considerations may be needed. Avoid choosing a later analysis solely through a preliminary significance switch without considering the properties of the whole procedure.
Business use
The business value lies in recognizing that variability can affect reliability, tolerance failures, and customer experience independently of average performance. Bartlett's test supplies one model-based piece of evidence about that variability.
A responsible report explains why the sampling and normality assumptions are plausible and how large variance differences would matter operationally. Levene-type or other robust procedures may be preferable when distributional shape is uncertain. For comparing means, a method that accommodates unequal variances may avoid depending on a separate preliminary variance test.
People also ask
Must the group sizes be equal?
No; the formula incorporates their separate degrees of freedom.
Does the test require equal means?
No; sample variances measure spread around each group's own mean.
Is it robust to non-normal data?
It is sensitive to departures from normality, which motivates considering alternatives and inspecting the data.
Check your understanding
What does rejecting the null establish under the model?
Answer: Evidence that the population variances are not all equal, without identifying every differing pair.
Does p = 0.0923 prove equal variances?
Answer: No. It indicates insufficient evidence for rejection at the stated 5% threshold, not proof of equality.
Related terms
- Variance
- Homoscedasticity
- Normal distribution
- Analysis of variance
- chi-square distribution
- Levene's test
- Welch's test
Learn next
Compare Bartlett and Levene procedures on simulated normal and skewed data. Examine how sample size changes uncertainty, then learn methods that address unequal variances directly in the substantive analysis.
More in Statistics and probability
- Balanced repeated replication
- Ball divergence - Ball divergence is a statistical measure of how two probability distributions differ, constructed by comparing the probability they assign to collections of...
- Barnard exact test - The Barnard exact test is an unconditional exact procedure for comparing the success probabilities of two independent binomial samples, represented by a...
- Base model - A base model is a previously trained model used as the starting point for further adaptation, especially fine-tuning for a particular task or application.
- Bayes classifier - A Bayes classifier is a decision rule that minimizes expected classification error when the true distribution of inputs and class labels is known and every...
- Bayes error rate - The Bayes error rate is the smallest possible expected misclassification rate for a specified joint distribution of observed features and class labels, when...
Sources
NIST/SEMATECH e-Handbook, Bartlett's Test, including the statistic, correction, and normality limitation: https://www.itl.nist.gov/div898/handbook/eda/section3/eda357.htm SciPy maintainers, bartlett official reference, including input requirements and robust alternatives: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.bartlett.html
Previous: Barrier (computer science) Next: Barycentric coordinates