BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
abdulla
Pyrite | Level 9

Hi, 

I know that the following is applicable for equal variance levene's test. 

 

Proc glm data=want;

   class age;

   model y=age;

   means age / hovtest;

run;

 

But if I have two variables with interaction term, what will be the code for levene's test? I tried the following but it didn't work.

 

Proc glm data=want;

   class age sex;

   model y=age sex age*sex;

   means age sex age*sex/ hovtest;

run;

 

Please help

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

The documentation states "Note that this option is ignored unless your MODEL statement specifies a simple one-way model.

 

You may test the homogeneity of variance across all combined classes by creating a new variable:

 

data heartTest;
set sashelp.heart;
if cmiss(smoking, sex) = 0 then smokeSex = cats(smoking, sex);
run;

proc glm data=heartTest plots=none;
class smokeSex;
model cholesterol = smokeSex;
means smokeSex / hovtest=bf;
run;
PG

View solution in original post

3 REPLIES 3
PGStats
Opal | Level 21

The documentation states "Note that this option is ignored unless your MODEL statement specifies a simple one-way model.

 

You may test the homogeneity of variance across all combined classes by creating a new variable:

 

data heartTest;
set sashelp.heart;
if cmiss(smoking, sex) = 0 then smokeSex = cats(smoking, sex);
run;

proc glm data=heartTest plots=none;
class smokeSex;
model cholesterol = smokeSex;
means smokeSex / hovtest=bf;
run;
PG
abdulla
Pyrite | Level 9
Hey PG you are awesome. Thanks a lot

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1714 views
  • 1 like
  • 3 in conversation