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!
There is a topic where a person says that, while you can do that in proc logistic, proc surveylogistic does not support this syntax:
Therefore, @vcvarela had to dummy-code the interaction variables into proc surveylogictic.
Yes the usual SAS modeling syntax of A*B on the MODEL statement also works in SURVEYLOGISTIC
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.