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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1216 views
  • 0 likes
  • 3 in conversation