BookmarkSubscribeRSS Feed
jag07g
Fluorite | Level 6

Hi,

 

I am new to modeling interaction terms using proc surveylogistic. This is my original logistic regression without an interaction term. I am predicting odds of depression and my main predictors are the variables sexualminority (1= Sexual Minority 2=Not Sexual Minority and bingedrink (1=Yes binge drink currently 2=No). 

proc surveylogistic data=survey.2017;
strata stratum;
cluster psu;
weight weight;
class gender (REF='2') sexualminority (ref='2') raceethnicity (ref='1') gradelevel (ref='1') bingedrink (ref='2')/param=ref;
model depression (ref='2')= gender sexualidentity raceethnicity gradelevel bingedrink / link=glogit rsquare;

 

I want to create an interaction term sexualminority*bingedrink but I am unsure if I have the right code. Do I need to create the interaction term in a data step first?

 

This is my code so far:

 

 

proc surveylogistic data=survey.2017;
strata stratum;
cluster psu;
weight weight;
class gender (REF='2') sexualminority (ref='2') raceethnicity (ref='1') gradelevel (ref='1') bingedrink (ref='2') sexualminority (ref='2') / param=glm;
model depression (REF='2') = sexualminority*bingedrink gender sexualminority raceethnicity gradelevel bingedrink;
lsmeans sexualminority*bingedrink /oddsratio cl diff;

slice sexualmionority*bingedrink/sliceby=bingedrink diff=control ('Sexual minority' 'Does not binge drink') oddsratio cl;

run;

 

Would this be the appropriate way to run a categorical by categorical interaction term in proc surveylogistic? Thank you!

 

2 REPLIES 2
pink_poodle
Barite | Level 11

There is a topic where a person says that, while you can do that in proc logistic, proc surveylogistic does not support this syntax:

 

https://communities.sas.com/t5/SAS-Statistical-Procedures/Proc-Surveylogistic-Interaction-Model/td-p...

 

Therefore, @vcvarela had to dummy-code the interaction variables into proc surveylogictic.

 

 

SAS_Rob
SAS Employee

Yes the usual SAS modeling syntax of A*B on the MODEL statement also works in SURVEYLOGISTIC

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!

What is ANOVA?

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.

Discussion stats
  • 2 replies
  • 1425 views
  • 0 likes
  • 3 in conversation