The Levene, Brown-Forsythe, and O’Brien
tests are used to test if multiple data samples have equal variances,
against the alternative that at least two of the data samples do not
have equal variances.
The test statistic is
W=(N−k)∑i=1kNi(Z¯i.−Z¯..)2(k−1)∑i=1k∑j=1Ni(Zij−Z¯i.)2,
where Ni is
the sample size of the ith group, and k is
the number of groups. Depending on the type of test specified with
the TestType name-value pair arguments, Zij can
have one of four definitions:
If you specify LeveneAbsolute, vartestn uses Zij=|Yij−Y¯i.|, where Y¯i. is the mean of the ith
subgroup.
If you specify LeveneQuadratic, vartestn uses Zij2=(Yij−Y¯i.)2, where Y¯i. is the mean of the ith
subgroup.
If you specify BrownForsythe, vartestn uses Zij=|Yij−Y˜i.|, where Y˜i. is the median of the ith
subgroup.
If you specify OBrien, vartestn uses
Zij=(0.5+ni−2)ni(yij−y¯i)2−0.5(ni−1)σi2(ni−1)(ni−2),
where ni is
the size of the ith group, σi2 is
its sample variance.
In all cases, the test statistic has an F-distribution
with k – 1 numerator degrees of freedom,
and N – k denominator
degrees of freedom.
The Levene, Brown-Forsythe, and O’Brien tests are less
sensitive to departures from normality than Bartlett’s test,
so they are useful alternatives if you suspect the samples come from
nonnormal distributions.