BookmarkSubscribeRSS Feed
Raman3
Calcite | Level 5

Hi SAS community,

I am trying to analyze grain yield data which follows a normal distribution. I would like get lsmeans comparisons using LSD. But, in the lsmeans statement, adjust option does not provide LSD. Below is the code that I am using in Proc Glimmix (using tukey method)- 

 
proc glimmix data=Yieldkgha plots=residualpanel;
class Treatment SiteYear Block Plot;
model Yieldkgha = Treatment|SiteYear / dist= gaussian;
random _Residual_/ group=Treatment ;
Random Block(SiteYear);
/*calculate lsmeans for all possible treatment and crop and adjust the values using Tukey*/
lsmeans Treatment|SiteYear / adjust=tukey lines cl;
/*covtest "common variance" homogeneity;*/
/*Checking assumptions of ANOVA */
output out = resids predicted=pred residual=res;
ods output tests3=anova
               lsmeans=lsmeansYieldkgha
               lsmlines=lslinesYieldkgha;
run;
 
Can someone inform me how to conduct LSD in Proc Glimmix?
4 REPLIES 4
data_null__
Jade | Level 19

This suggests that you simply omit ADJUST

 

proc glimmix data=sashelp.class;
   class age;
   model weight = age;
   lsmeans age / lines;
   run;

Capture.PNG

sbxkoenk
SAS Super FREQ

I moved this topic from "New Users" to "Statistical Procedures"-board.

sbxkoenk
SAS Super FREQ

Can someone inform me how to conduct LSD in Proc Glimmix?

The short answer is: you cannot get the LSD value from PROC GLIMMIX or PROC MIXED. There is such a thing as a least significant difference (LSD) only if all the cells have the same size and the model is simple enough so that the significance of all comparisons can be judged on the same scale. This is often not the case for mixed models, as a result, no LSD value is available in PROC GLIMMIX or PROC MIXED.

 

You may specify the LSMEANS statement with ADJUST=TUKEY and the LINES option ...

... and that will be the closest method I could suggest.

 

BR, Koen

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
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
  • 4 replies
  • 456 views
  • 1 like
  • 4 in conversation