# Obtaining the odds ratio of a 2x2 logistic regression interaction in rms

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?

Thanks

• 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. Feb 20 '18 at 4:37

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.