Programming the statistical procedures from SAS

Estimate statements for odds ratios for interaction terms in proc logistic

Reply
Occasional Contributor
Posts: 9

Estimate statements for odds ratios for interaction terms in proc logistic

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

Grand Advisor
Posts: 16,850

Re: Estimate statements for odds ratios for interaction terms in proc logistic

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

Occasional Contributor
Posts: 9

Re: Estimate statements for odds ratios for interaction terms in proc logistic

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

Grand Advisor
Posts: 16,850

Re: Estimate statements for odds ratios for interaction terms in proc logistic

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. 

Grand Advisor
Posts: 9,444

Re: Estimate statements for odds ratios for interaction terms in proc logistic

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

Maybe you should check  ODDSRATIO + AT or SLICE statement .

Ask a Question
Discussion stats
  • 4 replies
  • 111 views
  • 1 like
  • 3 in conversation