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

Dear Experts,

 

I wonder if you can tell me is there any analysis which LSMESTIMATE statment can not do, but ESTIMATE statement can do it? if yes, could you give me some examples?

 

As you know, the syntax of LSMESTIMATE is easier to use than ESTIMATE, then could LSMESTIMATE replace ESTIMATE?

 

Thanks advance for your kindly help!

 

Best Regards,

Aide

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

The primary thing that LSMESTIMATE cannot do that ESTIMATE can is to produce BLUPs for levels of random effects, given fixed effects.  Since LSmeans are marginal means over the random effects, LSMESTIMATE isn't designed to get at the individual levels of the random effects to produce predicted values.  The primary thing that it CAN do that ESTIMATE cannot is to apply family-wise corrections for multiple comparisons.

 

Steve Denham

View solution in original post

6 REPLIES 6
Rick_SAS
SAS Super FREQ

I highly recommend the paper "CONTRAST and ESTIMATE Made Easy: The LSMESTIMATE Statement," which compaes and contrasts these statements.

 

Although I am not an expert in this area, the paper says (p. 2) "the LSMEANS statement covers a subset of the analyses that are provided by the ESTIMATE statement, but it is a very important subset." It goes on to say the "LSMESTIMATE statement gives you a way to obtain custom hypothesis tests that are defined not in terms of the fundamental model parameters beta, but in terms of the LS-means."

 

The same page provides an example: "If you collect data about men and women and you just want to know whether the means are different, you compare gender averages [by using the ESTIMATE statement]. However, if you want to know whether they are different, adjusting for age, height, hair color, and so on, you then compare gender LS-means [by using the LSMESTIMATE statement]."

tacit
Fluorite | Level 6
Thanks! I did have already read this paper, from this paper, the key massage I get is that LSMESTIMATE is easier to use than ESTIMATE & CONTRAST statement.
SteveDenham
Jade | Level 19

The primary thing that LSMESTIMATE cannot do that ESTIMATE can is to produce BLUPs for levels of random effects, given fixed effects.  Since LSmeans are marginal means over the random effects, LSMESTIMATE isn't designed to get at the individual levels of the random effects to produce predicted values.  The primary thing that it CAN do that ESTIMATE cannot is to apply family-wise corrections for multiple comparisons.

 

Steve Denham

tacit
Fluorite | Level 6
Thanks, Steve Denham! I think you pointed out the key difference for me. Then If we just need to specify the fixed effects, LSMESTIMATE can do all the things which ESTIMATE statement do? In my work, I hardly specify the random effect, can you tell me when do we need to spicify the random effect? an example is appreciated! Thanks so much!
lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

You also have more flexibility in working with covariables (continuous predictors) with the estimate statement. LSMESTIMATE is mostly for working with factors (class variables).

SteveDenham
Jade | Level 19

For most things, the AT= option will give you the control you need for continuous covariables in the LSMESTIMATE statement.  However, if you have continuous by categorical interactions in the model, you will almost certainly need to use an ESTIMATE statement to look at effects due to varying the continuous variable.

 

Steve Denham

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 6 replies
  • 6968 views
  • 10 likes
  • 4 in conversation