Help using Base SAS procedures

LSMESTIMATE in proc mixed

Reply
Regular Contributor
Posts: 180

LSMESTIMATE in proc mixed

Hello,

I am trying to fit a mixed model, and for some reason I could not find, SAS 9.3 doesn't let me use the lsmestimate statement.

I wrote the next code (only with real variable names), and the lsmestimate is colored with red and not with blue like I would expect..

proc mixed data = MyData plots = all;

  class X1 X2;

  model Y = X3 X1;

  random intercept / subject = Subject_ID;

  random intercept / subject = Z1*Subject_ID;

  lsmeans X1 / plot = diff;

  lsmestimate X1 "level 1 vs. level 3" 1 0 -1;

run;

does anybody knows why ?

Thank you !

Respected Advisor
Posts: 4,927

Re: LSMESTIMATE in proc mixed

Sometimes, new features are not recognized by the enhanced editor but they work anyway.Do you get error messages when you run this analysis?

PG

PG
Respected Advisor
Posts: 2,655

Re: LSMESTIMATE in proc mixed

This happens to me all the time, and I have had no trouble with the LSMESTIMATE statement.

Steve Denham

Regular Contributor
Posts: 180

Re: LSMESTIMATE in proc mixed

you are both right, I tried running it, and it ran smoothly, so it's only an "editor bug".

The output was identical to the one I got from the 'estimate' command, I am not sure I understand the difference then...

Respected Advisor
Posts: 2,655

Re: LSMESTIMATE in proc mixed

For a lot of things, LSMESTIMATE and ESTIMATE will give the same result.  What you can do with LSMESTIMATE that you cannot do with ESTIMATE is why I tend to use it more.  The biggest difference is that LSMESTIMATE can accept a "multiple line" series of estimates, much like the CONTRAST statement, while the ESTIMATE statement provides only a single comparison.  This is especially useful for joint testing of hypotheses of interest, and for application of multiple comparison adjustments when you are only interested in specific comparisons, as opposed to the adjustments available through the LSMEANS statment.

Steve Denham

Ask a Question
Discussion stats
  • 4 replies
  • 629 views
  • 0 likes
  • 3 in conversation