Box’s test is used to determine whether two or more covariance matrices are equal. Bartlett’s test for homogeneity of variance presented in Homogeneity of Variances is derived from Box’s test. One caution: Box’s test is sensitive to departures from normality. If the samples come from non-normal distributions, then Box’s test may simply be testing for non-normality.
Suppose that we have m independent populations and we want to test the null hypothesis that the population covariance matrices are all equal, i.e.
H0: Σ1 = Σ2 =⋯= Σm
Now suppose that S1, …, Sm are sample covariance matrices from the m populations where each Sj is based on nj independent observations each consisting of k × 1 column vector (or alternatively a 1 × k row vector).
Now define S as the pooled covariance matrix
where n = define the following:
The null hypothesis (of equal covariance matrices) is rejected when M(1 – c ) > χ2-crit (or p-value < α).
This estimate works pretty well provided nj > 20, m ≤ 5 and k ≤ 5. A better estimate can be obtained using the F distribution by defining the following:
If c2 > c2 define F = F+, while if c2 < c2 define F = F–. Then F ~ F(df, df2). The null hypothesis is rejected if F > Fcrit.
Observation: If any of the Sj is not invertible then |Sj| = 0, and so ln|Sj| will be undefined. Thus M will be undefined and the test will fail.
Example 1: Determine whether the covariance matrices for Young, Middle and Old are equal in Example 1 of ANOVA with Repeated Measures with One Between Subjects Factor and One Within Subjects Factor.
Figure 1 – Covariance matrices for Example 1
The sample covariance matrices for Young, Middle and Old are calculated (see Figure 1) using the COV supplemental array function from the data in Figure 1 of ANOVA with Repeated Measures with One Between Subjects Factor and One Within Subjects Factor. Since the nj (j = 1, 2, 3) are all equal, the pooled covariance is simply the average of the Young, Middle and Old covariance matrices.
The calculations required for Box’s test are given in Figure 2.
Figure 2 – Box’s test for Example 1
m = number of matrices = 3 (Young, Middle, Old), k = the size of each covariance matrix = 5 (each matrix is 5 × 5), n1 = n2 = n3 = number of subjects in each sample = 7 and so n = n1 + n2 + n3 = 21. In columns Q, R, S and V, nn = n1 – 1 = 6 for Young, nn = n2 – 1 = 6 for Middle, nn = n3 – 1 = 6 for Old and nn = n – m = 18 for Pooled. The other entries are as described above.
Generally we use a significant level of α = .001 for this test. From Figure 2 we see that M = 34.81 and both the chi-square test and the F test are not significant. We therefore have no reason to reject the null hypothesis that the three covariance matrices are equal.