Exploratory Data Analysis
Levene Test for Equality of Variances
Test for Homogeneity of Variances
Levene's test (
is used to test if k samples have equal variances. Equal
variances across samples is called homogeneity 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.
The Levene test is defined as:
σ12 = σ22 = ... = σk2
σi2 ≠ σj2
for at least one pair
Given a variable Y with sample of size N
divided into k subgroups, where Ni
is the sample size of the ith subgroup, the Levene
test statistic is defined as:
where Zij can have one of the
following three definitions:
are the group means of the Zij
and is the overall mean of the
the mean of the
the median of
the ith subgroup.
is the 10% trimmed
mean of the ith subgroup.
The three choices for defining Zij
determine the robustness and power of Levene's test.
By robustness, we mean the ability of the test to not
falsely detect unequal variances when the underlying
data are not normally distributed and the variables are
in fact equal. By power, we mean the ability of the test
to detect unequal variances when the variances are in fact
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 (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.
The Levene test rejects the hypothesis that the
variances are equal if
where Fα, k-1, N-k
upper critical value of the
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
is the upper critical value from the F distribution
and F1-α is the lower critical value.
Note that this is the opposite of some
texts and software programs.
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.
H0: σ12 = ... = σ102
Ha: σ12 ≠ ... ≠ σ102
We are testing the hypothesis that the group variances are
equal. 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 variances
are not equal.
Test statistic: W = 1.705910
Degrees of freedom: k-1 = 10-1 = 9
N-k = 100-10 = 90
Significance level: α = 0.05
Critical value (upper tail): Fα,k-1,N-k = 1.9855
Critical region: Reject H0 if F > 1.9855
Levene's test can be used to answer the following
- Is the assumption of equal variances valid?
Standard Deviation Plot
Analysis of Variance
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.