I am using the RMS package and attempted to obtain the adjusted odds ratio for a logistic regression interaction. There does not seem to be a straightforward way to do this. I have decided to obtain the coeffient associated with the interaction by using the contrast.rms argument. I have then used the function exp on the obtained coefficient. I had two questions.

  1. Is my method suitable for obtaining an odds ratio?
  2. Is there a better method of doing this when using an rms object?


  • $\begingroup$ Questions solely about how software works are off-topic here, but you may have a real statistical question buried here. You may want to edit your question to clarify the underlying statistical issue. You may find that when you understand the statistical concepts involved, the software-specific elements are self-evident or at least easy to get from the documentation. $\endgroup$ Feb 20, 2018 at 4:37

1 Answer 1


The interaction odds ratio that makes sense is the ratio of two odds ratios. In a binary logistic model with two binary predictors, this is the anti-log of the interaction coefficient. Things get more tricky when dealing with non-binary predictors, but the R rms package contrast.rms function provides a very general way to specify differences-in-differences contrasts that works for a wide variety of problems. You just have to decide which contrasts are of interest. In the two binary predictor case this would look like contrast(fit, list(a=1,b=1), list(a=1,b=0), list(a=0,b=1), list(a=0,b=0)) which will get you the same result as anti-logging the interaction term if you anti-log the contrast estimate and its confidence limits.

  • $\begingroup$ Thanks, should the last list in the code you have provided be 'list(a=0,b=0)'? $\endgroup$
    – user183974
    Feb 20, 2018 at 5:30
  • $\begingroup$ If so, I get a negative contrast term. I assume this can't be the antilog, and that you have to obtain the antilog of the contrast term? $\endgroup$
    – user183974
    Feb 20, 2018 at 6:15
  • $\begingroup$ I have experimented with the results and it seems as though this is right. You need to take the antilog of the term given by contrast to obtain the odds ratio. $\endgroup$
    – user183974
    Feb 20, 2018 at 11:05
  • $\begingroup$ I corrected the code and adding anti-log at the end. $\endgroup$ Feb 20, 2018 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.