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
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.
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!
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.
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!
@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.
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!
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.