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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1289 views
  • 0 likes
  • 3 in conversation