How to get Tukey grouping in Proc Mixed?

Reply
New Contributor
Posts: 3

How to get Tukey grouping in Proc Mixed?

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;

SAS Super FREQ
Posts: 3,477

Re: How to get Tukey grouping in Proc Mixed?

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.

New Contributor
Posts: 3

Re: How to get Tukey grouping in Proc Mixed?

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!

 

SAS Super FREQ
Posts: 3,477

Re: How to get Tukey grouping in Proc Mixed?

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:

New Contributor
Posts: 3

Re: How to get Tukey grouping in Proc Mixed?

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;

Ask a Question
Discussion stats
  • 4 replies
  • 452 views
  • 0 likes
  • 2 in conversation