Test for Homogeneity

Here the homogeneity (equality) of the population variances $ \sigma_1^2, \sigma_2^2, \ldots, \sigma_k^2$ from k groups is tested. The hypothesis testing problem evaluates the null hypothesis

$\displaystyle H_0: \sigma_1^2 = \sigma_2^2 = \cdots = \sigma_k^2

In the following we introduce two test procedures--Hartley's maximum F-ratio test and Levine's test.

Let $ X_{i1}, X_{i2}, \ldots, X_{in_i}$ be the data from the i-th group, and let $ m_i$ be the sample median of the i-th group. The data from $ k$ groups are arranged either (a) all in a single variable with another categorical variable indicating factor levels, or (b) in multiple columns each of whose variables represents a factor level. In the Hartley's test we set $ Z_{ij} = X_{ij}$ for $ j = 1,\ldots,n_i$, whereas, we have $ Z_{ij} = \vert X_{ij} - m_i\vert$ when the Levine's test is considered. Then the test procedure uses the sample mean $ \displaystyle
\bar{Z}_{i\cdot} = \frac{1}{n_i} \sum_{j=1}^{n_i} Z_{ij}$ and the sample variance $ \displaystyle
s_i^2 = \frac{1}{n_i-1} \sum_{j=1}^{n_i} (Z_{ij} - \bar{Z}_{i\cdot})^2$ within group for every factor level $ i = 1,\ldots,k$.

It calculates the test statistic and the p-value . The Hartley's test requires the normality assumption and the same sample size $ n_1 = n_2 = \cdots = n_k$ (but the test can be performed even if the sample sizes are not equal). The test statistic is built on the maximum F-ratio $ s_{\mbox{max}}^2/s_{\mbox{min}}^2$ of the largest $ s_{\mbox{max}}^2$ to the smallest $ s_{\mbox{min}}^2$ of k sample variances. The Levine's test on the other hand does not require the same sample size, and works reasonably even if the normality assumption does not hold. The Levine's test uses the test statistic constructed for analysis of variance in essence. In either case by rejecting $ H_0$ we can find evidence of a difference in the population variances (that is, we can support the alternative hypothesis $ H_A$ that the population variance are not all equal).