1.3.EDA Techniques

1.3.5.Quantitative Techniques

## 1.3.5.10. | ## Levene Test for Equality of Variances |

*Purpose:*

Test for hom*ogeneity of VariancesLevene's test ( Levene 1960) is used to test if

Test for hom*ogeneity of Variances

*k*samples have equal variances. Equal variances across samples is called hom*ogeneity of variance. Some statistical tests, for example the analysis of variance, assume that variances are equal across groups or samples. The Levene test can be used to verify that assumption.

Levene's test is an alternative to the Bartlett test. The Levene test is less sensitive than the Bartlett test to departures from normality. If you have strong evidence that your data do in fact come from a normal, or nearly normal, distribution, then Bartlett's test has better performance.

*Definition*The Levene test is defined as:

H_{0}: | \( \sigma_{1}^{2} = \sigma_{2}^{2} = \ldots = \sigma_{k}^{2} \) |

H_{a}: | \( \sigma_{i}^{2} \ne \sigma_{j}^{2} \) for at least one pair (i,j). |

Test Statistic: | Given a variable Y with sample of size N divided into k subgroups, where N is the sample size of the _{i}ith subgroup, the Levene test statistic is defined as: - \[ W = \frac{(N-k)} {(k-1)} \frac{\sum_{i=1}^{k}N_{i}(\bar{Z}_{i.}-\bar{Z}_{..})^{2} } {\sum_{i=1}^{k}\sum_{j=1}^{N_i}(Z_{ij}-\bar{Z}_{i.})^{2} } \]
can have one of the following three definitions: Z_{ij}- \(Z_{ij} = |Y_{ij} - \bar{Y}_{i.}|\)
where \(\bar{Y}_{i.}\) is the mean of the *i*-th subgroup. - \(Z_{ij} = |Y_{ij} - \tilde{Y}_{i.}|\)
where \(\tilde{Y}_{i.}\) is the median of the *i*-th subgroup. - \(Z_{ij} = |Y_{ij} - \bar{Y}_{i.}'|\)
where \(\bar{Y}_{i.}'\) is the 10% trimmed mean of the *i*-th subgroup.
and \(\bar{Z}_{..}\) is the overall mean of the Z_{ij}. Z_{ij} The three choices for defining Levene's original paper only proposed using the mean. Brown and Forsythe (1974)) extended Levene's test to use either the median or the trimmed mean in addition to the mean. They performed Monte Carlo studies that indicated that using the trimmed mean performed best when the underlying data followed a Cauchy distribution (i.e., heavy-tailed) and the median performed best when the underlying data followed a \(\chi^{2}_{4}\) (i.e., skewed) distribution. Using the mean provided the best power for symmetric, moderate-tailed, distributions. Although the optimal choice depends on the underlying distribution, the definition based on the median is recommended as the choice that provides good robustness against many types of non-normal data while retaining good power. If you have knowledge of the underlying distribution of the data, this may indicate using one of the other choices. |

Significance Level: | α |

Critical Region: | The Levene test rejects the hypothesis that the variances are equal if W > F_{α, k-1, N-k} F_{α, k-1, N-k} is the upper critical value of the F distribution with k-1 and N-k degrees of freedom at a significance level of α. In the above formulas for the critical regions, the Handbook follows the convention that |

*Levene's Test Example*

Levene's test, based on the median, was performed for the GEAR.DAT data set. The data set includes ten measurements of gear diameter for each of ten batches for a total of 100 measurements.

HWe are testing the hypothesis that the group variances areequal. We fail to reject the null hypothesis at the 0.05 significance level since the value of the Levene test statistic is less than the critical value. We conclude that there is insufficient evidence to claim that the variancesare not equal._{0}: σ_{1}^{2}= ... = σ_{10}^{2}H_{a}: σ_{1}^{2}≠ ... ≠ σ_{10}^{2}Test statistic:

W= 1.705910Degrees of freedom:k-1 = 10-1 = 9N-k= 100-10 = 90Significance level:α= 0.05Critical value (upper tail):F_{α,k-1,N-k}= 1.9855 Critical region: Reject H_{0}ifF> 1.9855

*Question*Levene's test can be used to answer the following question:

- Is the assumption of equal variances valid?

*Related Techniques*Standard Deviation Plot

Box Plot

Bartlett Test

Chi-Square Test

Analysis of Variance

*Software*The Levene test is available in some general purpose statistical software programs. Both Dataplot code and R code can be used to generate the analyses in this section. These scripts use the GEAR.DAT data file.