Homogeneity of Variance Tests For Two or More Groups

advertisement
Homogeneity of Variance Tests For Two or More Groups
We covered this topic for two-group designs earlier. Basically, one transforms the scores so
that between groups variance in the scores reflects differences in variance rather than differences in
means. Then one does a t test on the transformed scores. If there are three or more groups, simply
replace the t test with an ANOVA.
See the discussion in the Engineering Statistics Handbook. Levene suggested transforming
the scores by subtracting the within-group mean from each score and then either taking the absolute
value of each deviation or squaring each deviation. Both versions are available in SAS. Brown and
Forsythe recommended using absolute deviations from the median or from a trimmed mean. Their
Monte Carlo research indicated that the trimmed mean was the best choice when the populations
were heavy in their tails and the median was the best choice when the populations were skewed.
The Brown and Forsythe method using the median is available in SAS. It would not be very difficult
to program SAS to use the trimmed means. Obrien’s test is also available in SAS.
I provide here SAS code to illustrate homogeneity of variance tests. The data are the gear
data from the Engineering Statistics Handbook.
options pageno=min nodate formdlim='-';
title 'Homogeneity of Variance Tests';
title2 'See http://www.itl.nist.gov/div898/handbook/eda/section3/eda35a.htm'; run;
data Levene;
input Batch N; Do I=1 to N; Input GearDiameter @@; output; end;
cards;
1 10
1.006 0.996 0.998 1.000 0.992 0.993 1.002 0.999 0.994 1.000
2 10
0.998 1.006 1.000 1.002 0.997 0.998 0.996 1.000 1.006 0.988
3 10
0.991 0.987 0.997 0.999 0.995 0.994 1.000 0.999 0.996 0.996
4 10
1.005 1.002 0.994 1.000 0.995 0.994 0.998 0.996 1.002 0.996
5 10
0.998 0.998 0.982 0.990 1.002 0.984 0.996 0.993 0.980 0.996
6 10
1.009 1.013 1.009 0.997 0.988 1.002 0.995 0.998 0.981 0.996
7 10
0.990 1.004 0.996 1.001 0.998 1.000 1.018 1.010 0.996 1.002
8 10
0.998 1.000 1.006 1.000 1.002 0.996 0.998 0.996 1.002 1.006
9 10
1.002 0.998 0.996 0.995 0.996 1.004 1.004 0.998 0.999 0.991
10 10
0.991 0.995 0.984 0.994 0.997 0.997 0.991 0.998 1.004 0.997
*****************************************************************************;
proc GLM data=Levene; class Batch;
model GearDiameter = Batch / ss1;
means Batch / hovtest=levene hovtest=BF hovtest=obrien;
title; run;
*****************************************************************************;
proc GLM data=Levene; class Batch;
model GearDiameter = Batch / ss1;
means Batch / hovtest=levene(type=ABS); run;
Here are parts of the statistical output, with annotations:
Levene's Test for Homogeneity of GearDiameter Variance
ANOVA of Squared Deviations from Group Means
Source
DF
Sum of
Squares
Mean
Square
Batch
Error
9
90
5.755E-8
2.3E-7
6.394E-9
2.556E-9
F Value
Pr > F
2.50
0.0133
With the default Levene’s test (using squared deviations), the groups differ significantly in variances.
O'Brien's Test for Homogeneity of GearDiameter Variance
ANOVA of O'Brien's Spread Variable, W = 0.5
Source
DF
Sum of
Squares
Mean
Square
Batch
Error
9
90
7.105E-8
3.205E-7
7.894E-9
3.562E-9
F Value
Pr > F
2.22
0.0279
Also significant with Obrien’s Test.
Brown and Forsythe's Test for Homogeneity of GearDiameter Variance
ANOVA of Absolute Deviations from Group Medians
But not significant with the Brown & Forsythe test using absolute deviations from within-group
medians.
Source
DF
Sum of
Squares
Mean
Square
Batch
Error
9
90
0.000227
0.00133
0.000025
0.000015
F Value
Pr > F
1.71
0.0991
------------------------------------------------------------------------------------------------SAS will only let you do one Levene test per invocation of PROC GLM, so I ran GLM a second
time to get the Levene test with absolute deviations. As you can see below, the difference in
variances is significant with this test.
Levene's Test for Homogeneity of GearDiameter Variance
ANOVA of Absolute Deviations
from
Group Means
DF
Sum of
Squares
Batch
9
0.000241
0.000027
Error
90
0.00112
0.000012
Source
F Value
2.16
Mean
Square
Pr > F
0.0322
The One-Way ANOVA procedure in SPSS also
a test of homogeneity of variance, as shown below.
Test of Homogeneity of Variances
GearDiameter
provides
Levene Statistic
2.159
df1
df2
9
Sig.
90
.032
Notice that the Levene test provided by PASW is that using absolute deviations from withingroup means. The Brown-Forsythe test offered as an option is not their test of equality of variances,
it is a robust test of differences among means, like the Welch test.
Return to Wuensch’s Statistics Lessons Page
Karl L. Wuensch
December, 2011.
Download