BookmarkSubscribeRSS Feed
Emma_at_SAS
Lapis Lazuli | Level 10

Hi everyone!

I want to introduce a 3-way interaction term in my PROC surveylogistic model. I have three variables A, B, and C each with three levels. 

In the MODEL statement, I add A|B|C but I want to see the details of differences using the LSMESTIMATE. How may I introduce contrasts with LSMESTIMATE?

Thank you,

Maryam

 

6 REPLIES 6
PaigeMiller
Diamond | Level 26

If you want to determine differences you can start with LSMEANS instead of LSESTIMATE. There are many options in the LSMEANS statement that allow you to compute differences and determine statistical significance of those differences.

--
Paige Miller
Emma_at_SAS
Lapis Lazuli | Level 10

Thanks, PaigeMiller for your quick response!

What is the advantage of LSMESTIMATE over LSMEANS or what are their differences? My advisor asked me to use LSMESTIMATE but I do not know why and because I do not know enough I cannot discuss the details.

 

Thanks!

 

PaigeMiller
Diamond | Level 26

It is my understanding that LSMESTIMATE is used for special comparisons that are not built into LSMEANS. In addition, LSMESTIMATE in some situations is much harder to use, whereas the same comparison in LSMEANS would be much easier to program.

 

So, for example, if you have three levels of X1, let's call them LEVEL1, LEVEL2 and LEVEL3, and you want to estimate the differences between two levels, e.g.

 

LEVEL1 – LEVEL2 or

LEVEL2 – LEVEL3 or

LEVEL1 – LEVEL3

 

these are all built into LSMEANS and there is no need to use LSMESTIMATE. Any time you are comparing the mean difference between two levels, you would use LSMEANS. If for some reason you want to estimate

 

2*LEVEL1 – 3*LEVEL2 + 0.4*LEVEL3

 

(which is not comparing two levels) this is not available from LSMEANS and the only choice is LSMESTIMATE.

 

 

--
Paige Miller
Emma_at_SAS
Lapis Lazuli | Level 10

Thanks, PaigeMiller! 

Your clarification was super helpful. So, probably because I am using survey data with WEIGHT in my PROC SURVEYLOGISTIC then I need to use LSMESTIMATE. Do you have any suggestions or know of a resource to help me introduce a 3-way interaction into my LSMESTIMATE statement?

 

Thank you! 

PaigeMiller
Diamond | Level 26

@Emma_at_SAS wrote:

So, probably because I am using survey data with WEIGHT in my PROC SURVEYLOGISTIC then I need to use LSMESTIMATE.


Allow me to say that I do not agree. PROC SURVEYLOGISTIC properly applies the survey weights in the LSMEANS statement, so you should not have to wind up using LSMESTIMATE just to compare groups.

 

Do you have any suggestions or know of a resource to help me introduce a 3-way interaction into my LSMESTIMATE statement?

No, I do not.

--
Paige Miller
Emma_at_SAS
Lapis Lazuli | Level 10
Thank you very much!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 996 views
  • 1 like
  • 2 in conversation