Calcite | Level 5

## Compact letter display for proc glimmix with lsmestimate

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],

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!

Calcite | Level 5

## Re: Compact letter display for proc glimmix with lsmestimate

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?

Discussion stats