Date: Mon, 12 Feb 2001 16:06:35 -0800
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Cassell" <Cassell.David@EPAMAIL.EPA.GOV>
Subject: Re: Bartlett's test
Christopher tong wrote:
> Is there a Bartlett's test for equality of variance (say,
> for residuals in an ANOVA model) in SAS v.8?
There is a Bartlett's test in the sample library. If you don't have it
on your machine, you can get it from the SAS website [go to the tech
section and use the search facility].
HOWEVER.. that code computes the original Bartlett's test, which is highly
sensitive to departures from normality [see Box, 1953, Biometrika 40,
There is a correction which helps this substantially, but I have not seen
any SAS code to do the computations. So I went to the SAS website and
and found this:
(Embedded image moved to file: pic00288.gif) Is there a way to test for
homogeneity of variances/heteroscedasticity?
Yes, It is also possible to model the variance at the same time that you
model the mean response using PROC GENMOD. Use the %VARMOD macro
Bartlett's test can be done with the SAS/STAT Sample library program,
bartlett.sas (title: "Bartlett's Test for Homogeneity of Variance").
Beginning in Release 6.12, the MEANS statement in ANOVA and GLM includes
options for testing homogeneity of variances for one-way ANOVA models
and will perform Welch's test for differences between group means when
the group variances are not assumed to be equal. The Bartlett,
Brown-Forsythe, Levene, and O'Brien tests are provided.
Example: PROC GLM; CLASS TRT; MODEL Y=TRT;
MEANS TRT/HOVTEST=LEVENE WELCH;
Prior to Release 6.12, the %HOMOVAR macro performs the O'Brien,
Brown-Forysthe, Levine, Bartlett, and Welch Anova F tests for
homogeneity of variance. The macro requires base SAS and SAS/STAT
software (Release 6.06 or later). To use the %HOMOVAR macro, see the
documentation in the header or see the Proceedings of the Seventeenth
Annual SAS Users Group International Conference , 1992, pp. 1178-1182.
Or see the %VARMOD macro for additional information.
My personal preference would be Brown-Forsythe, since they don't do the
Fligner-Killeen test. Levene appears to have a problem where "the type I
error rate sometimes becomes inflated to an unsatisfactory level". That's
a quote from Conover, Johnson, and Johnson, 1981, Technometrics 23, pp
David Cassell, OAO Corp. Cassell.David@epa.gov
Senior computing specialist