BookmarkSubscribeRSS Feed
sumah
Fluorite | Level 6

I selected my final multiple linear regression model and wanted to test for heteroskedasticity. It seems that I can do that using "white option" in the model statement using PROC REG but not PROC GLM.

What's the difference between white and welch tests?

What is the correct way to test for heteroskedasticity using PROC GLM?

3 REPLIES 3
Rick_SAS
SAS Super FREQ

PROC REG assumes that the explanatory variables are continuous. White's test uses the variance of the residuals to determine whether the data are heteroskedasticity.

 

PROC GLM was originally designed for the analysis of variance. The Welch test analyzes a CLASS variable (that is, categorical) and tests for equal variances across the levels of a specified CLASS variable. It is only applicable to a simple one-way model.  

 

I don't think PROC GLM supports a formal hypothesis test, but you can use diagnostic plots to inspect the distribution of the residuals and a Q-Q plot to inspect their approximate normality. Put PLOTS=ALL on the PROC GLM statement, which will create a panel of diagnostic plots and a panel of residual plots. You can inspect the diagnostic plots to get a fee for whether heteroskedasticity is a problem.  For more about the diagnostic panel, see https://blogs.sas.com/content/iml/2021/03/24/regression-diagnostic-plots-sas.html 

sbxkoenk
SAS Super FREQ

Hello,

 

  • You can fit a model in which the residual variance is proportional to a power of the mean (a PoM-model).
  • I am under the impression you might be interested in a model in which the residual variance differs according to the level of some categorical predictor variable(s).

Such models (both above!) can be handled quite easily with the MIXED procedure (or HPMIXED if you have a large dataset or LMIXED if you have Viya). 
PROC NLMIXED is also an option.

 

PROC MIXED, by default, uses the generalized least squares (GLS) method as the default estimation method for fixed effects.
The generalized least squares (GLS) - method is a good start when you want to deal with heteroskedasticity.

 

Koen

SteveDenham
Jade | Level 19

For GLM: To test for homogeneity of variance across CLASS levels in a one-way ANOVA setting, use the MEANS statement with the HOVTEST option. There are a variety of tests available. I prefer the Brown-Forsythe method.

 

For mixed models (GLIMMIX being preferred); Include a RANDOM statement with the following syntax:

 

RANDOM _residual_/group = <class variable>;

And add the following COVTEST statement:

 

COVTEST 'common variance' homogeneity

This conducts a likelihood ratio test. One nice thing about this approach is that even for moderate sized datasets, you can ignore the testing part, and rely on convergence in distribution of the variance components if, in fact, there is no heteroscedasticity. You do this at the cost of degrees of freedom, so if you are in a situation where power of the test is at a premium, you can remove the statements if the test is non-significant.

 

For a situation where you have a main linear regression and you are looking for the influence of fixed categorical covariates, the GLIMMIX approach is quite handy.

 

SteveDenham

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 414 views
  • 6 likes
  • 4 in conversation