To see the difference in interpretations we will do some simulations in R. But first: interactions in linear models are usually interpreted via an additive model, so no interactions means a purely additive model. But, logistic regression is a multiplicative model, so interactions modeled via product terms do have a different meaning there. We set up a model to show this via simulations. First, we have two binary predictors coded as 0/1, and define probabilities via an additive probability model $p=\beta_0 +\beta_1 x_1 + \beta_2 x_2$. So, on this additive scale there is no interaction:
set.seed(1234)
beta_0 <- 0.1
beta_1 <- 0.35
beta_2 <- 0.35
We use a big sample size so randomness is unimportant:
x_1 <- c(rep(0,5000),rep(1,5000))
x_2 <- c(rep(0,2500),rep(1,2500),rep(0,2500),rep(1,2500))
p <- beta_0 + beta_1 * x_1 + beta_2 * x_2
table(p)
p
0.1 0.45 0.8
2500 5000 2500
y <- rbinom(length(p),1,p)
Then we can estimate a logistic regression model with interaction:
mod <- glm(y ~ x_1+x_2+x_1:x_2, family=binomial() )
summary(mod)
Call:
glm(formula = y ~ x_1 + x_2 + x_1:x_2, family = binomial())
Deviance Residuals:
Min 1Q Median 3Q Max
-1.8020 -1.0888 -0.4648 1.2574 2.1349
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.17084 0.06596 -32.909 < 2e-16 ***
x_1 1.98470 0.07723 25.697 < 2e-16 ***
x_2 1.95885 0.07726 25.353 < 2e-16 ***
x_1:x_2 -0.36882 0.10055 -3.668 0.000244 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13769 on 9999 degrees of freedom
Residual deviance: 11016 on 9996 degrees of freedom
AIC: 11024
Number of Fisher Scoring iterations: 4
Note the interaction term!
Can we recover the probabilities $p$ from this model output?
newdata <- expand.grid(x_1=0:1,x_2=0:1)
pred <- predict(mod,newdata=newdata,type="response")
cbind(pred,newdata)
pred x_1 x_2
1 0.1024 0 0
2 0.4536 1 0
3 0.4472 0 1
4 0.8028 1 1
Yes, we can.
Then, what happens if we fit a logistic model without interactions?
mod.wi <- glm(y ~ x_1+x_2, family=binomial() )
summary(mod.wi)
Call:
glm(formula = y ~ x_1 + x_2, family = binomial())
Deviance Residuals:
Min 1Q Median 3Q Max
-1.8449 -1.0642 -0.4994 1.2836 2.0705
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -2.01884 0.04838 -41.73 <2e-16 ***
x_1 1.77265 0.04914 36.07 <2e-16 ***
x_2 1.74662 0.04914 35.55 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 13769 on 9999 degrees of freedom
Residual deviance: 11030 on 9997 degrees of freedom
AIC: 11036
Number of Fisher Scoring iterations: 4
anova(mod.wi, mod,test="Chisq")
Analysis of Deviance Table
Model 1: y ~ x_1 + x_2
Model 2: y ~ x_1 + x_2 + x_1:x_2
Resid. Df Resid. Dev Df Deviance Pr(>Chi)
1 9997 11030
2 9996 11016 1 13.611 0.0002248 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
pred.wi <- predict(mod.wi,newdata=newdata,type="response")
cbind(pred.wi,newdata)
pred.wi x_1 x_2
1 0.1172386 0 0
2 0.4387614 1 0
3 0.4323614 0 1
4 0.8176386 1 1
Note how the estimated parameters changes a lot, while the fitted probabilities do not change that much (about 0.02). But anyhow, for most people the fitted probabilities are easier to understand than the fitted log-oddsratios, so this teqnique of showing fitted probabilities is preferred for logistic regression, and should be more used. (with probabilities closer to zero or one the difference would be more pronounced. Try that yourself by editing the code above).