Performs Bartlett’s test of the null that the variances in each of the groups (samples) are the same.
plot(count ~ spray, data = InsectSprays,
horizontal=TRUE,
pch=18,col=c("pink","lightblue","lightgreen"))
bartlett.test(InsectSprays$count, InsectSprays$spray)
##
## Bartlett test of homogeneity of variances
##
## data: InsectSprays$count and InsectSprays$spray
## Bartlett's K-squared = 25.96, df = 5, p-value = 9.085e-05
bartlett.test(count ~ spray, data = InsectSprays)
##
## Bartlett test of homogeneity of variances
##
## data: count by spray
## Bartlett's K-squared = 25.96, df = 5, p-value = 9.085e-05
The Fligner Killeen test is a non-parametric test for homogeneity of group variances based on ranks.
It is useful when the data is non-normal or where there are outliers.
Test of the null that the variances in each of the groups (samples) are the same.
fligner.test(InsectSprays$count, InsectSprays$spray)
##
## Fligner-Killeen test of homogeneity of variances
##
## data: InsectSprays$count and InsectSprays$spray
## Fligner-Killeen:med chi-squared = 14.483, df = 5, p-value = 0.01282
fligner.test(count ~ spray, data = InsectSprays)
##
## Fligner-Killeen test of homogeneity of variances
##
## data: count by spray
## Fligner-Killeen:med chi-squared = 14.483, df = 5, p-value = 0.01282