I'm using fixed effects logistic regression in R, using the glm
function. I've done some reading about interpreting interaction terms in generalized linear models. When using the log odds, the model is linear and the interaction term(s) can be interpreted in the same way as OLS regression. When the coefficients are exponentiated into odds ratios, this is no longer the case. Since my audience are more familiar with odds ratios, i'd like to report my results using that metric.
Is there a pre-cooked way of calculating interaction terms as odds ratios using R? If, not, can anyone walk me through how this should be done?
Edit 1: I'm providing a reproducible example below.
set.seed(1234)
dat <- data.frame(
Y = factor(round(runif(60))),
x1 = rnorm(60, 10, 3),
sex = sample(c("male", "female"), size = 60, prob = c(.4, .6), replace = TRUE),
population = sample(c("France", "Kenya", "Thailand"), size = 60, prob = c(.3, .45, .25), replace = TRUE)
)
fm1 <- glm(Y ~ x1 + sex * population, family = binomial(link = "logit"), data = dat)
summary(fm1)
# odds ratios
exp(coef(fm1))
Edit 2: additional clarification.
The motivation behind my question comes from the following explanation of logistic regression interactions from the UCLA statistics site:
http://www.ats.ucla.edu/stat/stata/seminars/interaction_sem/interaction_sem.htm
My understanding, from reading this, is that the interpretation of interaction terms that have been transformed into either odds ratios or probabilities is not the same as for the same terms in log odds units. I guess I'm trying to understand if I just need to change my interpretation of the interaction term when converting to odds ratios, or whether I need to do some calculation in addition to the exponentiation?