## Test for Homogeneity

Here the homogeneity (equality) of the population variances from k groups is tested. The hypothesis testing problem evaluates the null hypothesis

Let be the data from the i-th group, and let be the sample median of the i-th group. The data from 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 for , whereas, we have when the Levine's test is considered. Then the test procedure uses the sample mean and the sample variance within group for every factor level .

It calculates the test statistic and the p-value . The Hartley's test requires the normality assumption and the same sample size (but the test can be performed even if the sample sizes are not equal). The test statistic is built on the maximum F-ratio of the largest to the smallest 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 we can find evidence of a difference in the population variances (that is, we can support the alternative hypothesis that the population variance are not all equal).