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
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
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]."
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
You also have more flexibility in working with covariables (continuous predictors) with the estimate statement. LSMESTIMATE is mostly for working with factors (class variables).
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.