BookmarkSubscribeRSS Feed
HaloPlayer420
Calcite | Level 5

proc glm plots=diagnostics;
class innoc Nlevel;
model eq1= innoc Nlevel innoc*Nlevel;
run;

 

This is my piece of code, what is the test for normality here , with the plots diaagnositic I am getting a qq plot and a histogram that shows that my data is normal,

 

But I have no idea what test I am using to check for this normality.

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I don't think there is a "default" test for the normality of the residuals in PROC GLM. And just to make sure, the only thing that you should be testing for normality is the residuals, you didn't say that or make that clear. And so at the end when you say "... shows that my data is normal", this is an incorrect conclusion; it show that the residuals (not the data) are normally distributed.

 

I believe your choices are the histogram of residuals, and the QQ plot. Either of those will help you decide if the residuals are normally distributed. If you really want a formal test that the residuals are normally distributed, you can save the residuals and use PROC UNIVARIATE to obtain several different formal tests of normality.

--
Paige Miller
Rick_SAS
SAS Super FREQ

The article, "An overview of regression diagnostic plots in SAS" shows how to interpret the plots in the diagnostics panel. The two plots you want to look at are discussed in Section 4: Normality of residuals.   

 

If the previous two plots show skewness or other non-normal features, you might want to explore which levels of the classification variables are contributing to the non-normality of the residuals. You can use the EFFECTPLOT statement to display a box plot (which shows symmetry/skewness of residuals) or an interaction plot (which shows the distribution of the residuals by using a dot plot). To see these plots, use PROC GENMOD instead of PROC GLM:

proc genmod data=Have;
   class innoc Nlevel;
   model eq1= innoc Nlevel innoc*Nlevel;
   effectplot box / cluster obs;
   effectplot interaction(sliceby=innoc) / obs;
   effectplot interaction(sliceby=Nlevel) / obs;
run;

For details about interaction plots, see the doc for the EFFECTPLOT statement.

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 570 views
  • 0 likes
  • 3 in conversation