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
Have you tried the ODDSRATIO statement instead? It's easier to structure IMO.
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
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.
Your estimate statement compare the main effect , not interaction effect.
Maybe you should check ODDSRATIO + AT or SLICE statement .
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!
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.