BookmarkSubscribeRSS Feed
palominm
Calcite | Level 5

Hi.

 

 

I am trying to run a tukey test after the annova

with this code:

 

data new; set mpa;
proc glm;
class fabric laundry time temperature;
model deltae=fabric|laundry|time|temperature;
means fabric*laundry*time*temperature; means fabric*laundry*time*temperature;

 

proc glm;
class fabric laundry time temperature;
model deltae=fabric|laundry|time|temperature;
means fabric*laundry*time*temperature/tukey lines;
run;

 

I think i am mistaking the second part.. 

 

Can anyone please give me a light on that?

 

thanks

4 REPLIES 4
OliviaWright
SAS Employee

Hi @palominm

 

One issue that I see with your PROC GLM is that you have the pipes | in your model statement. Those should not be necessary. In all of the examples I see they just list their dependent variables with spaces in between the variables. 

 

That could be an issue, however it may not be the only one. Did you received an error in the log when you ran this code?

 

BrianGaines
SAS Employee

I may be missing something but the use of the bar (pipe) operator should not make a difference since it is equivalent to listing the factors separately.

 

Instead, I believe the issue is that the tukey option can only be used with main effects.  As per the PROC GLM documentation for the MEANS statement, "multiple comparisons tests apply only to main effects," and for the TUKEY option it states that it "performs Tukey’s studentized range test (HSD) on all main-effect means in the MEANS statement."  

 

So the code

means A B / tukey;
means A*B;

produces the same results as 

means A B A*B / tukey;

since the interaction effect will be ignored by Tukey's test.

OliviaWright
SAS Employee

Ah, I see that now. I never seen anyone use the pipes for this but you are correct!

BrianGaines
SAS Employee

Yes, they are very convenient for factorial models! 🙂 

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 8996 views
  • 5 likes
  • 3 in conversation