Bartlett Test of Homogeneity of Variances

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

Fligner-Killeen Test of Homogeneity of Variances

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