BookmarkSubscribeRSS Feed
night_rose
Fluorite | Level 6

I am using proc logistic to create a model that has 2 dummy variable and I added the interaction term. When a model includes an interaction term, the odds ratios that are presented for the variables included in the interaction are conditional to the other variable involved. It is useful when the interaction is significant, but when the interaction is insignificant, it is unnecessary to look at the results conditionally. Is there a way to still get the main effects odds ratios (unconditional) by keeping the interaction term in the model ? Or the only way would be to rerun the model without the interaction term ?

 

 

6 REPLIES 6
SteveDenham
Jade | Level 19

The second example in the LOGISTIC Procedure documentation has something that may be what you want, using the ODDSRATIO and CONTRAST statements.  Here is the online link:  https://documentation.sas.com/doc/en/statug/15.2/statug_logistic_examples02.htm 

 

SteveDenham

StatDave
SAS Super FREQ

When a predictor is involved in interaction, PROC LOGISTIC does not provide an odds ratio estimate for it in the default table that it presents. I suspect that you are using the EXPB option which adds a column in the parameter estimates table containing exponentiated values of the estimates, but it is important to understand that these values are not always odds ratio estimates. Also, it makes little sense to talk about the overall odds ratio for a predictor involved in interaction just as one doesn't talk of the main effect of a predictor in an ordinary regression model when it is involved in interaction. When the model allows for interaction, the predictor has a different effect at each level of the interacting predictor(s). These separate estimates are provided by the ODDSRATIO statement and this statement computes those estimates appropriately regardless of the coding (parameterization) used for CLASS predictors. Rather than the EXPB option, the ODDSRATIO statement is the recommended way to obtain odds ratio estimates.

 

That said, a single odds ratio estimate can be provided for a predictor in interaction by using the LSMEANS statement, but note the coefficients used (as shown by the E option) for the two individual log odds. As they show, each log odds is essentially averaged over the levels of the interacting predictor which may not be very meaningful (and possibly misleading) particularly when the predictor of interest has very different effect in each level of the interacting predictor. Note also that the LSMEANS statement requires use of PARAM=GLM in the CLASS statement.

proc logistic; 
class a b/param=glm;
model y(event="1")=a|b;
lsmeans a/diff e cl oddsratio;
run;
night_rose
Fluorite | Level 6

Thank you for your reply! This helps me, and I do understand that when the interaction is significant, it is important to look at the conditional odds ratio. I tried the LSMEANS statement for my predictor variables. The only thing I am confused about is how come does the odds ratios and the estimates of the coefficients that I obtain are slightly different than the ones I get when I run the model without the interaction. Is there a difference in the calculation method ? (ex: odds ratio for sex in model with interaction : 2.048, in the model without the interaction : 2.053)

 
StatDave
SAS Super FREQ
See those log odds coefficients from the E option that I mentioned. That's shows how the odds ratio is computed in the interaction model. That won't be the same as the odds ratio for the model without interaction unless the interaction is estimated as exactly zero. Use the same LSMEANS statement in your model without interaction and compare the log odds coefficients from the E option.
night_rose
Fluorite | Level 6
I see, but is there any way that the SAS model can give me the same odds ratio for the predictor variables of the model without interaction ? Or do I really need to compute the model without interaction to get the non-conditional main effects (when interaction is insignificant) ?
StatDave
SAS Super FREQ
Since the model is changed, the odds ratio estimates cannot be the same. If you consider the interaction to be zero, then removing it from the model treats it as zero and provides the overall odds ratio estimate for the predictor.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 6 replies
  • 1430 views
  • 6 likes
  • 3 in conversation