BookmarkSubscribeRSS Feed
lotcarrots
Calcite | Level 5

In proc glimmix multiple comparisons exist for lsmeans by pdiff combined with adjust, e.g. PDIFF=ALL ADJUST=bon (yes, tukey would be the better choice, still I'd like to use bonferroni). I can get the compact letter display (cld) with an additional lines statement.

lsmeans f1*f2 / PDIFF=ALL ADJUST=bon LINES;

With this code I request all tukey-comparisons (all combinations) but I am just interested in a few. Therefore I coded my comparisons of interest with lsmestimate. To adjust for multiple comparisons I use adjust=bon adjdfe=row.

 

lsmestimate f1*f2 'comp1' [1, 1 1] [-1, 2 1],
                            'comp2' [1, 1 1] [-1, 3 1],
			    'comp3' [1, 1 1] [-1, 4 1],
			    'comp4' [1, 2 1] [-1, 3 1],
				... / cl adjust=bon adjdfe=row;

Now my question: Is it possible to get a letter display only for those comparisons of interest and not all tukey-ones as in lsmeans? I somehow have to redefine the pdiff option but I am not aware how to easily solve that task. Any ideas on how to get such a table? I'd greatly appreciate it!

1 REPLY 1
lotcarrots
Calcite | Level 5

I found out that

 

lsmeans f1*f2 / pdiff slice=(f1 f2) slicediff=(f1 f2) adjust=bon lines;

basically does the same thing as my lsmestimate list of comparisons. With this I get the 'Simple Effect Comparisons of f1*f2 Least Squares Means By f2' and analogously for 'By f1'. The problem in here is that the slicediff statement applies multiplicity adjustment only per slicediff-factor-level, i.e. within each level of each factor not for all comparisons simultaneously.

 

I can solve this by using

 

proc multtest inpvalues(Probt)=SliceDiffs bonferroni;
run;

and get the same adjusted p-values as in my manual lsmestimates, which is nice so far.

 

For the letter display I tried to make good use of the %MULT macro by Piepho

Unfortunately, this again contains all comparisons, even those that are of no interest to me.

 

Does that make sense at all oder do I want too much from Statistics or SAS?

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 25. 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
  • 1 reply
  • 1124 views
  • 0 likes
  • 1 in conversation