Pages

Thursday, July 14, 2011

Levene's test for equality of variances

In an earlier post, I discussed about Bartlett's test for homogeneity of variances. But I found out that Bartlett's test is very sensitive to normality assumption. Even if the data is slightly non-normal, then it does not hold good. In that case Levene's test for equality of variances becomes the test of choice.

In R we can go for library(car) and then apply Levene's Test by using the following formula:
leveneTest(age~sex): in this e.g. sex is a categorical variable having male and female as two groups. This formula will test the null hypothesis that the variances of age in male and female groups are equal. If p is less than 0.05 then it means that the null hypothesis is rejected i.e. the variances are not equal in the two groups.