BookmarkSubscribeRSS Feed
abarnett313
Calcite | Level 5

Greetings,

 

I am trying to request odds ratio estimates in proc logistic for interaction terms in a model using SAS v9.4.

 

In the model, the interaction is between two categorical dichotomous variables ("victimlgbta" and percschsafe"). For both variables, 0 is the reference group and 1 indicates "Yes" to the questions being measured. I have the following statement, but the results it produces are not consistent with other parts of the output (re: significance of the interaction terms):

 

Proc logistic data=secondyp.lgbq;

class race(ref="5" param=ref) sex(ref="1" param=ref) percschsafe(param=ref ref="0") victimlgbta(param=ref ref="0");

 

model SuicideAttemptA(event='1')=peervicadd race age sex grade percschsafe victimlgbta percschsafe*victimlgbta /clodds=wald lackfit expb;

estimate "LGBT Victimization: No" victimlgbta 0 1 /exp cl;

estimate "LGBT Victimization: Yes" victimlgbta 1 0 /exp cl;

estimate "Perception of School Safety: No" percschsafe 0 1 /exp cl;

estimate "Perception of School Safety: Yes" percschsafe 1 0 /exp cl;

Estimate "LGBTVict x PercSchSafe (Ever Afraid? No / LGBT Vic? No)" percschsafe 0 1 victimlgbta 0 1 percschsafe*victimlgbta 0 1 0 1 /exp cl;

Estimate "LGBTVict x PercSchSafe (Ever Afraid? Yes / LGBT Vic? No)" percschsafe 1 0 victimlgbta 0 1 percschsafe*victimlgbta 1 0 0 1 /exp cl;

Estimate "LGBTVict x PercSchSafe (Ever Afraid? No / LGBT Vic? Yes)" percschsafe 0 1 victimlgbta 1 0 percschsafe*victimlgbta 0 1 1 0 /exp cl;

Estimate "LGBTVict x PercSchSafe (Ever Afraid? Yes / LGBT Vic? Yes)" percschsafe 1 0 victimlgbta 1 0 percschsafe*victimlgbta 1 0 1 0 /exp cl;

 

I have had limited success finding guidance on how to write estimate statements in proc logistic. Any help or insight into what may be wrong with my statements would be greatly appreciated.

 

 

Thanks!

 

Andrew

4 REPLIES 4
Reeza
Super User

Have you tried the ODDSRATIO statement instead? It's easier to structure IMO.

abarnett313
Calcite | Level 5

Thank you for your reply! I had tried using that, but the results I obtained didn't make sense (i.e. the OR estimates looked significant (didn't cross 1) even though the p-value in the omnibus test was >0.05. Also, is it possible to pull SE estimates wit hthe ODDSRATIO statement? Thanks again, Andrew

Reeza
Super User

Your going to have to show both code and results if you're having trouble with interpretation. 

 

One thing to keep an eye on is what confidence intervals you use. If it differs from method to calculate P-value you can get results that misalign, but it's usually not by much. 

Ksharp
Super User

Your estimate statement compare the main effect , not interaction effect.

Maybe you should check  ODDSRATIO + AT or SLICE statement .

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
  • 4 replies
  • 2019 views
  • 1 like
  • 3 in conversation