Usage Note 22526: Testing and adjusting for unequal variances (heteroscedasticity)
You can compare the variances of two populations using PROC TTEST. A folded F statistic testing the equality of the two variances is provided by default in the "Equality of Variances" table in the PROC TTEST results. The test assumes the response is normally distributed. For an example, see "Comparing Group Means" in the Getting Started section of the PROC TTEST documentation.
The HOVTEST= option in the MEANS statement of the ANOVA and GLM procedures enables you to test the equality (homogeneity) of variances for one-way ANOVA models. The Bartlett, Brown-Forsythe, Levene (the default), and O'Brien variance tests are provided. You can also use the WELCH option in the MEANS statement in PROC GLM to perform Welch's ANOVA when the group variances are not assumed to be equal. Welch's ANOVA is robust to violation of the assumption of equal variances for one-way models. For example, the following statements request the Levene's test for homogeneity of variances and the Welch's ANOVA model:
model y = trt;
means trt / hovtest=levene welch;
For an example, see "Testing for Equal Group Variances" in the Examples section of the PROC GLM documentation.
It is important to note that only the results from the HOVTEST= and WELCH options in PROC GLM account for variance heterogeneity. All other results assume equal variances.
The MIXED and GLIMMIX procedures are alternative procedures that have the ability to adjust for unequal variances. For example, in the statements below the GROUP= option in the REPEATED statement allows you to estimate the variances separately. Therefore, all results will be adjusted for unequal variances. Adding the DDFM=SATTERTHWAITE option in the MODEL statement adjusts the degrees of freedom for the unequal variances.
model y = trt / ddfm=satterth;
repeated / group=trt;
lsmeans trt / pdiff adjust=tukey;