SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
amd9663
Fluorite | Level 6

Hello! I like to use Tukey Groupings in Proc GLM and GLIMMIX but is it possible to get Tukey groupings in Proc Mixed? Here is some example code. Thank you!!

 

proc mixed;
class trt ID;
model logng=trt;
lsmeans trt/adjust=tukey;
run;

4 REPLIES 4
Rick_SAS
SAS Super FREQ

The documentation for the LSMEANS statement in PROC MIXED indicates that it supports the ADJUST=tukey. So I'd say "yes," provided that you remember it is for fixed effects only.

amd9663
Fluorite | Level 6

Thanks for the reply! Do you know how to write code in Mixed that tells SAS to do the Tukey groupings? In the code I provided, I get the Tukey-adjusted P-values but have to figure out the groupings (e.g., A, B, C;  LS-means with the same letter are not significantly different) on my own. It is not hard to do, but I want SAS do it for me! I know how to do it in GLM and GLIMMIX (the lines option) just not in Mixed (the lines option does not work). Thank you for your help!

 

Rick_SAS
SAS Super FREQ

If I understand your question, I think you are asking for graphical techniques to determine significant differences between groups. The old LINES option is not the best at that task. In fact, in Westfall et al, Multiple Comparisons and Multiple Tests, the authors show an example (p. 69-70) in which the LINES output is misleading and write "our purpose in showing this analysis is to discourage [their emphasis] you from using it" with unequal sample sizes because it "can lead to incorrect inferences."

 

Due to the influential book by Hsu (1996), other graphical approaches have been implemented in SAS. A favoriate of many is the "diffogram," which you can request on the LSMEANS statement by using the PLOTS=DIFFOGRAM option.

 

For more about graphical comparisons of LSMEANS, see the excellent papers by Robin High:

amd9663
Fluorite | Level 6

Awesome! Thank you so much. I tried adding it to the LSMEANS statement (as below) but it would not run. Can you make any suggestions to this code? Thank you!!

 

proc mixed;
class trt ID;
model logng=trt;
lsmeans trt/adjust=tukey plots=diffogram;
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 7216 views
  • 2 likes
  • 2 in conversation