Bartlett's Test for Homogeneity of Variance
Bartlett's test is used to test the assumption that variances are equal (i.e., homogeneous) across groups. The test is easy to implement and produces valid results, assuming data points within groups are randomly sampled from a normal distribution.
Because Bartlett's test is sensitive to departures from normality, a normality test is prudent. Several ways to check for departures from normality are described at: How to Test for Normality: Three Simple Tests.
Note: Unlike Hartley's Fmax test, which also tests for homogeneity, Bartlett's test does not assume equal sample sizes across groups.
Hypothesis Testing
Bartlett's test is an actual hypothesis test, where we examine observed data to choose between two statistical hypotheses:
 Null hypothesis: Variance ( σ^{2} ) is equal across all groups.
H_{0}: σ^{2}_{i} = σ^{2}_{j} for all groups
 Alternative hypothesis: Variance is not equal across all groups.
H_{1}: σ^{2}_{i} ≠ σ^{2}_{j} for at least one pair of groups
Like many other techniques for testing hypotheses, Bartlett's test for homogeneity involves computing a teststatistic and finding the Pvalue for the test statistic, given degrees of freedom and significance level. If the Pvalue is smaller than the significance level, we reject the null hypothesis; if it is bigger, we cannot reject the null hypothesis.
How to Conduct Bartlett's Test
The steps required to conduct Bartlett's test for homogeneity are detailed below:
 Step 1. Specify the significance level ( α ).
 Step 2. Compute the sample variance ( s^{2}_{j} ) for each group.
kΣj=1( X_{ i, j}  X_{ j} )^{ 2}
s^{2}_{j} = ( n_{ j}  1 ) where X_{ i, j} is the score for observation i in Group j , X_{ j} is the mean of Group j, n_{ j} is the number of observations in Group j , and k is the number of groups.
 Step 3. Compute the pooled estimate of sample variance ( s^{2}_{p} ).
n = Σ n_{ i}
kΣj=1( n_{ j}  1 ) s^{2}_{j}s^{2}_{p} = ( n  k ) where n_{ j} is the sample size in Group j , k is the number of groups, n is the total sample size, and s^{2}_{j} is the sample variance in Group j.
 Step 4. Compute the test statistic (T).
A = ( n  k ) * ln( s^{2}_{p} )
B = Σ [ ( n_{ j}  1 ) * ln( s^{2}_{j} ) ]
C = 1 / [ 3 * ( k  1 ) ]
D = Σ [ 1 / ( n_{ j}  1 )  1 / ( n  k ) ]
T = ( A  B ) / [ 1 + ( C * D ) ]
where A is the first term in the numerator of the test statistic, B is the second term in the numerator, C is the first term in the denominator , D is the second term in the denominator, and ln is the natural logarithm.
 Step 5. Find the degrees of freedom ( df ), based on the number of groups ( k ).
df = k  1
 Step 7. Find the Pvalue for the test statistic. The Pvalue is the probability
of seeing a test statistic more extreme (bigger) than the observed T statistic from Step 4.
It turns out that the test statistic (T) is distributed much like a chisquare statistic with ( k1 ) degrees of freedom. Knowing the value of T and the degrees of freedom associated with T, we can use Stat Trek's ChiSquare Calculator to find the Pvalue  the probability of seeing a test statistic more extreme than T.
 Step 7. Accept or reject the null hypothesis, based on Pvalue and significance level. If the Pvalue is bigger than the significance level, we cannot reject the null hypothesis that variances are equal across groups. Otherwise, we reject the null hypothesis.
So you will understand how to accomplish each step, let's work through an example, one step at a time.
Example 1
The table below shows sample data for five groups. Based on the data, would you say that group variances are homogeneous?
Group 1  Group 2  Group 3  Group 4  Group 5 

1 2 3 4 5 
1 3 5 7 9 
1 4 7 10 13 
1 5 9 13 17 
1 6 11 16 21 
We will use Bartlett's test to test the assumption that variances are equal across groups.
Specify Significance Level
The significance level is the probability of rejecting the null hypothesis when it is true. Researchers often choose 0.05 or 0.01 for a significance level. For the purpose of this exercise, let's choose 0.05.
Compute Sample Variance
Using the formula below, we compute sample variance:
kΣj=1
( X_{ i, j}  X_{ j} )^{ 2}


s^{2}_{j} =  
( n_{ j}  1 ) 
The variance for each group is shown below:
Variance  

Group 1  Group 2  Group 3  Group 4  Group 5 
2.5  10  22.5  40  62.5 
Compute Pooled Estimate of Variance
To compute the pooled estimate of sample variance, we use the formula below:
kΣj=1
( n_{ j}  1 ) s^{2}_{j}


s^{2}_{p} =  
( n  k ) 
s^{2}_{p} = 27.5
Compute the Test Statistic (T)
To compute the test statistic (T), we use the following formulas:
A = ( n  k ) * ln( s^{2}_{p} ) = 66.284
B = Σ ( n_{ j}  1 ) * ln( s^{2}_{j} ) = 56.626
C = 1 / [ 3 * ( k  1 ) ] = 0.083
D = Σ [ 1 / ( n_{ j}  1 ) ]  [ 1 / ( n  k ) ] = 1.0
T = ( A  B ) / [ 1 + ( C * D ) ]
T = (66.284  56.626) / [1 + (0.083 * 1.0)] = 8.92
Find Degrees of Freedom
Compute degrees of freedom ( df ), based on the number of groups ( k ).
df = k  1 = 5  1 = 4
Find PValue
The Pvalue is the probability of seeing a test statistic (T) that is more extreme (bigger) than the observed test statistic. For this problem, we found that the observed test statistic was 8.92. And we know the test statistic follows a chisquare distribution. Therefore, we want to know the probability of seeing a chisquare test statistic bigger than 8.92
Use Stat Trek's ChiSquare Calculator to find that probability. Enter the degrees of freedom (4) and the observed test statistic (8.92) into the calculator; then, click the Calculate button.
From the calculator, we see that P( T > 8.92 ) equals about 0.06; so the PValue is 0.06.
Test the Null Hypothesis
When the PValue is bigger than the significance level, we cannot reject the null hypothesis. When it is smaller, we cannot accept the null hypothesis.
Here, the PValue (0.06) is bigger than the significance level (0.05), so we cannot reject the null hypothesis that the data tested follows a normal distribution.
Other Options
To illustrate exactly how Bartlett's test works, we solved the problem above manually, executing each step by hand. That is useful for understanding, but it is also laborious and timeconsuming. Here are two easier ways to solve the same problem:
 Use the Bartlett's Test Calculator. The Bartlett's Test Calculator makes it easy. You enter a few inputs, and the calculator handles all the computations. To see how to solve the above problem with the calculator, go to Bartlett's Test Calculator: Problem 1.
 Try Hartley's Fmax test. Other tests, such as Hartley's Fmax test, can also be used to test for homogeneity of variance. For comparison, we applied Hartley's Fmax test to above problem. If you're curious to see whether Bartlett's test agreed with Hartley's test, go to Hartley's Fmax Test of Normality: Example 1.