BookmarkSubscribeRSS Feed
amd9663
Calcite | Level 5

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
Calcite | Level 5

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
Calcite | Level 5

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-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!

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.

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
  • 6024 views
  • 0 likes
  • 2 in conversation