## ESTIMATE VS LSMESTIMATE in PROC MIXED

Solved
Occasional Contributor
Posts: 10

# ESTIMATE VS LSMESTIMATE in PROC MIXED

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?

Best Regards,

Aide

Accepted Solutions
Solution
‎08-08-2016 07:12 PM
Posts: 2,655

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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

All Replies
SAS Super FREQ
Posts: 3,839

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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]."

Occasional Contributor
Posts: 10

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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.
Solution
‎08-08-2016 07:12 PM
Posts: 2,655

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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

Occasional Contributor
Posts: 10

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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!
Valued Guide
Posts: 684

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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

Posts: 2,655

## Re: ESTIMATE VS LSMESTIMATE in PROC MIXED

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

☑ This topic is solved.