BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mthorne
Obsidian | Level 7

Can someone point me to where I can see how differences of LSMEANS are calculated in GLIMMIX using the DIFF option?

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

TDIFF is the t-value of the test to see if the LSMEANS are different. PDIFF is the probability associated with the t-value.

--
Paige Miller

View solution in original post

10 REPLIES 10
PaigeMiller
Diamond | Level 26

LSMEANS calculations: https://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_details41.htm&docsetVersion=1...

 

Essentially, Least Squares Means tries to adjust for different number of observations in cells, which can bias the calculation of regular old means.

--
Paige Miller
mthorne
Obsidian | Level 7
Hi Paige,
Thanks for replying! I am actually interested in the calculations that are used in the DIFF option, which compares one LSMEAN to another, because I am trying to understand how it compares to a Fisher's LSD test.
PaigeMiller
Diamond | Level 26

First you calculate the individual LSMEANS and then you do a subtraction to get a DIFF. 

 

The formula for Fisher's LSD is here: https://www.statisticshowto.com/how-to-calculate-the-least-significant-difference-lsd/

 

So I believe that FIsher's LSD uses the difference of actual factor means while LSMEANS uses the difference of least-squares means. So the difference between two means won't even agree.

--
Paige Miller
mthorne
Obsidian | Level 7
I'm not sure it is that simple. Just because one is not exactly equal to another doesn't equate to a difference in the analyses that I have run.
PaigeMiller
Diamond | Level 26

I don't understand what you are saying.

--
Paige Miller
mthorne
Obsidian | Level 7
I guess I don't understand what the calculation that indicates one LSMEAN is different from another. I have hand calculated Fisher's LSDs and I understand that it depends on the outcome of the LSD equation, but I can't find that similar equation for PDIFF. I have attached a DIFF plot from one of my analysis and it looks like if the variance of a LSMEAN doesn't intersect with a central value or vector, then that lsmean is different from zero or lsmeans that do intersect with that line. I have also attached a difference of lsmeans table that indicates which lsmeans are different from others. But, how is this determined is my question?
Mark
PaigeMiller
Diamond | Level 26

Here's a worked example: https://support.sas.com/kb/24/984.html

--
Paige Miller
mthorne
Obsidian | Level 7
Thank you, this is helpful! So then is TDIFF the same as PDIFF?
Mark

PaigeMiller
Diamond | Level 26

TDIFF is the t-value of the test to see if the LSMEANS are different. PDIFF is the probability associated with the t-value.

--
Paige Miller
mthorne
Obsidian | Level 7
Okay, thank you very much!
Mark

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register 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
  • 10 replies
  • 1538 views
  • 1 like
  • 2 in conversation