Why Compare Variances?
In a comparison of several independent normal populations, a shared variance is a substantive assumption: it says that the populations have the same spread, even if their means differ. Bartlett’s test evaluates that assumption by comparing the fit of a model with one common variance to a model with a separate variance for each population. Its reference distribution is approximately chi-square, with degrees of freedom determined by the number of variance restrictions.
The test is especially sensitive to departures from normality. Its likelihood derivation relies on normal samples, and the usual chi-square calibration can be inaccurate when the populations are appreciably nonnormal. The assumptions are therefore part of the test, not a technical detail that can be omitted.
Each \(n_i\) must be at least 2, so every sample variance is defined. The sample means are allowed to differ under both hypotheses. The test concerns equality of variances, not equality of means.
The Constrained and Unrestricted Likelihoods
The classical Bartlett statistic uses the likelihood of the within-group residual contrasts, which removes the unknown group means. Write \(Q_i=\sum_{j=1}^{n_i}(X_{ij}-\bar X_i)^2=\nu_i s_i^2\). Under the normal model, an orthogonal transformation of each sample separates its mean coordinate from its \(\nu_i\) residual coordinates. The residual coordinates are independent normal variables with variance \(\sigma_i^2\). Consequently, apart from a factor not involving the variances, the residual likelihood is
Under the unrestricted model, each variance is maximized separately. For group \(i\), its log-likelihood contribution, up to a constant, is \(-\frac{\nu_i}{2}\log(\sigma_i^2)-\frac{Q_i}{2\sigma_i^2}\). Differentiating with respect to \(\sigma_i^2\) gives \(-\nu_i/(2\sigma_i^2)+Q_i/(2\sigma_i^4)=0\), so the maximum occurs at \(\hat{\sigma}_i^2=Q_i/\nu_i=s_i^2\).
Under the null hypothesis, all variances equal a common value \(\sigma^2\). The residual log-likelihood, again up to a constant, is \(-\frac{\nu}{2}\log(\sigma^2)-\frac{\sum_iQ_i}{2\sigma^2}\). Its derivative is \(-\nu/(2\sigma^2)+\sum_iQ_i/(2\sigma^4)\), which vanishes at \(\hat{\sigma}_0^2=\sum_iQ_i/\nu=s_p^2\). The second derivative at this value is negative, so it is the maximum.
To verify the expression, the unrestricted maximum likelihood is proportional to \(\prod_i(s_i^2)^{-\nu_i/2}\exp(-\nu_i/2)\), while the restricted maximum is proportional to \((s_p^2)^{-\nu/2}\exp(-\nu/2)\). The exponential factors cancel in their ratio. Taking minus twice the logarithm gives \(A\). Nonnegativity also follows because the restricted model is a subset of the unrestricted model, so its maximized likelihood cannot be larger.
Worked Example: Forming the Likelihood-Ratio Statistic
Suppose three independent normal samples have degrees of freedom \(\nu_1=9,\nu_2=11,\nu_3=8\), with observed sample variances \(s_1^2=4,s_2^2=6,s_3^2=9\). Calculate the pooled variance and the uncorrected likelihood-ratio statistic.
The total residual degrees of freedom are \(\nu=9+11+8=28\). The pooled variance is \(s_p^2=(9(4)+11(6)+8(9))/28=(36+66+72)/28=174/28=6.2143\).
Therefore \(A=28\log(6.2143)-9\log(4)-11\log(6)-8\log(9)\). Using \(\log(6.2143)\approx1.82685\), \(\log(4)\approx1.38629\), \(\log(6)\approx1.79176\), and \(\log(9)\approx2.19722\), this is \(51.1518-12.4766-19.7094-17.5778\approx1.3880\). The result is positive, as required for a likelihood-ratio statistic.
Bartlett’s Correction and the Chi-Square Reference
The uncorrected statistic \(A\) has a chi-square limit, but its finite-sample distribution can be biased relative to that limit. Bartlett’s correction rescales \(A\) to improve the calibration. Define
For independent normal samples, the classical Bartlett approximation compares \(T_B\) to a chi-square distribution with \(k-1\) degrees of freedom. This is an approximation, not an exact finite-sample distribution. The correction factor is positive, and the statistic is unchanged if every sample variance is expressed in a different common measurement unit: multiplying all variances by the same positive constant adds cancelling log terms in \(A\).
The degrees of freedom follow from the dimension of the restriction. Parameterize the variance alternatives by \((\eta_1,\ldots,\eta_k)=(\log\sigma_1^2,\ldots,\log\sigma_k^2)\), an open \(k\)-dimensional parameter space. Under \(H_0\), these coordinates satisfy \(\eta_1=\cdots=\eta_k\), leaving a one-dimensional subspace. Thus the null imposes \(k-1\) independent restrictions. The normal model is regular for positive variances, and the null lies in the interior of the parameter space. Wilks’ likelihood-ratio theorem therefore gives the chi-square limit with degrees of freedom equal to this dimension difference, \(k-1\).
The scale correction can also be motivated from the null expectation of \(A\). Under \(H_0\), \(Q_i/\sigma^2\) has a chi-square distribution with \(\nu_i\) degrees of freedom, and \(\sum_iQ_i/\sigma^2\) has a chi-square distribution with \(\nu\) degrees of freedom. If \(\psi\) denotes the logarithmic derivative of the gamma function, then \(E[\log(\chi^2_d)]=\psi(d/2)+\log 2\). Substituting these expectations into \(A\) gives
For large \(d\), \(\psi(d/2)=\log(d/2)-1/d-1/(3d^2)+O(d^{-4})\). Applying this expansion to the total and group terms yields \(E_0[A]=(k-1)+\frac{1}{3}(\sum_i1/\nu_i-1/\nu)\), to the displayed order. This is \((k-1)C\) to that order, explaining why division by \(C\) improves the finite-sample scale calibration. It does not make the test exact.
Worked Example: Applying the Bartlett Correction
Return to the sample variances \(4,6,9\) and degrees of freedom \(9,11,8\). There are \(k=3\) groups, so \(C=1+\frac{1}{6}(1/9+1/11+1/8-1/28)\). The quantity in parentheses is approximately \(0.29131\), giving \(C\approx1.04855\).
The corrected statistic is \(T_B=1.3880/1.04855\approx1.3238\), with \(k-1=2\) degrees of freedom. For a chi-square distribution with 2 degrees of freedom, the upper-tail probability is \(\exp(-T_B/2)\), so the approximate p-value is \(\exp(-1.3238/2)\approx0.516\). At a 0.05 significance level, this result does not reject equality of variances.
Worked Example: A Two-Group Test
Two independent normal samples have \(\nu_1=4,\nu_2=6\), and their observed variances are \(s_1^2=1\) and \(s_2^2=4\). The total degrees of freedom are \(\nu=10\), and the pooled variance is \(s_p^2=(4(1)+6(4))/10=28/10=2.8\).
The uncorrected statistic is \(A=10\log(2.8)-4\log(1)-6\log(4)\approx10.29619-0-8.31777=1.97843\). The correction factor is \(C=1+\frac{1}{3}(1/4+1/6-1/10)=1+0.31667/3\approx1.10556\). Thus \(T_B\approx1.97843/1.10556=1.7896\). There are \(k-1=1\) degrees of freedom. The test statistic is not itself a variance ratio; it combines the group variances through their weighted logarithms.
Worked Example: Checking the Degrees of Freedom and Scale
Consider three samples with \((\nu_1,\nu_2,\nu_3)=(4,6,5)\) and variances \((3,3,12)\). Then \(\nu=15\) and \(s_p^2=(4(3)+6(3)+5(12))/15=90/15=6\).
The likelihood-ratio statistic simplifies to \(A=15\log(6)-4\log(3)-6\log(3)-5\log(12)\). Since \(\log(12)=\log(3)+\log(4)\), this equals \(15\log(2)-5\log(4)=5\log(2)\approx3.4657\). The correction factor is \(C=1+\frac{1}{6}(1/4+1/6+1/5-1/15)=1+0.55/6\approx1.09167\). Hence \(T_B\approx3.1747\), compared to a chi-square distribution with \(3-1=2\) degrees of freedom. The degrees of freedom count the two independent equality restrictions, regardless of the unequal sample sizes.
Interpretation, Assumptions, and a Common Pitfall
A small p-value is evidence against a common population variance under the independent normal model; it does not identify which groups differ, nor does it establish why their variances differ. A large p-value is not proof that the variances are equal. It means the observed discrepancies are not sufficiently unusual under the test’s reference model to reject the null at the chosen level.
A common mistake is to use \(n_i\) instead of \(\nu_i=n_i-1\) as the weights in the classical Bartlett statistic, or to compare the statistic to \(\chi^2_k\). The residual likelihood has \(\nu_i\) residual coordinates because each sample mean is estimated. The variance restriction has \(k-1\) degrees of freedom because \(k\) separate variance parameters are reduced to one common parameter. These are distinct roles: \(\nu_i\) weight the observed sample variances, while \(k-1\) determines the reference distribution.
Another pitfall is treating the normality assumption as optional. Bartlett’s test can be notably sensitive to nonnormality, so a rejection may reflect an unsuitable distributional model as well as unequal variances. The correction factor addresses finite-sample likelihood calibration under the normal model; it does not repair sensitivity to nonnormal data.
Check Your Understanding
Use the definitions and derivations above to answer the following.
- Why does the unrestricted residual-likelihood estimate of \(\sigma_i^2\) equal \(s_i^2\), rather than a variance with denominator \(n_i\)?
- For \(k=4\) independent groups, what are the chi-square degrees of freedom, and how many independent variance restrictions does this represent?
- Explain why the Bartlett correction changes the statistic’s scale but not its degrees of freedom.
- For two groups with \(\nu_1=5\) and \(\nu_2=9\), write the correction factor \(C\) without evaluating it.
- Why does a significant Bartlett test not, by itself, identify which population variances differ?