Section B.10 Testing Conditional Hypotheses: Interactions
In the social sciences there is a great interest in what are called conditional hypotheses or interactions. Many of our theories do not assume simply additive effects but multiplicative effects. For example, [274] suggest that the threat of punishment only affects the probability of involvement in crime for those with a propensity to offend, but are largely irrelevant for people who do not have this propensity. Or you may think that a particular crime prevention programme may work in some environments but not in others. The interest in this kind of conditional hypothesis is growing.
One of the assumptions of the regression model is that the relationship between the response variable and your predictors is additive. That is, if you have two predictors \(x_1\) and \(x_2\text{,}\) regression assumes that the effect of \(x_1\) on \(y\) is the same at all levels of \(x_2\text{.}\) If that is not the case, you are then violating one of the assumptions of regression. This is in fact one of the most important assumptions of regression, even if researchers often overlook it.
One way of extending our model to accommodate for interaction effects is to add terms to our model, a third predictor \(x_3\text{,}\) where \(x_3\) is simply the product of multiplying \(x_1\) by \(x_2\text{.}\) Notice we keep a term for each of the main effects (original predictors) as well as a new term for the interaction effect. “Analysts should include all constitutive terms when specifying multiplicative interaction models except in very rare circumstances” ([199] p.66).
How do we do this in R? One way is to use the following notation in the formula argument. Notice how we have added a third term
RD90:SOUTH_f, which is asking R to test the conditional hypothesis that resource deprivation may have a different impact on homicide for southern and northern counties.
fit_5 <- lm(HR90 ~ RD90 + SOUTH_f + RD90:SOUTH_f , data=ncovr)
# which is equivalent to:
# fit_5 <- lm(HR90 ~ RD90 * SOUTH_f , data=ncovr)
summary(fit_5)
## ## Call: ## lm(formula = HR90 ~ RD90 + SOUTH_f + RD90:SOUTH_f, data = ncovr) ## ## Residuals: ## Min 1Q Median 3Q Max ## -17.05 -3.00 -0.57 2.23 68.14 ## ## Coefficients: ## Estimate Std. Error t value Pr(>|t|) ## (Intercept) 4.548 0.159 28.68 <2e-16 *** ## RD90 2.581 0.196 13.15 <2e-16 *** ## SOUTH_f1 3.261 0.225 14.51 <2e-16 *** ## RD90:SOUTH_f1 0.562 0.238 2.37 0.018 * ## --- ## Signif. codes: ## 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Residual standard error: 5.29 on 3081 degrees of freedom ## Multiple R-squared: 0.366, Adjusted R-squared: 0.365 ## F-statistic: 592 on 3 and 3081 DF, p-value: <2e-16
You see here that essentially you have only two inputs (resource deprivation and south) but several regression coefficients. [188] suggest reserving the term input for the variables encoding the information and term predictor to refer to each of the terms in the model. So here we have two inputs and three predictors (one for SOUTH, another for resource deprivation, and a final one for the interaction effect).
In this case the test for the interaction effect is significant, which suggests there is such an interaction. Let’s visualise the results with the
effects package:
plot(allEffects(fit_5), ask=FALSE)

Notice that essentially what we are doing is running two regression lines and testing whether the slope is different for the two groups. The intercept is different: we know that Southern counties are more violent, but what we are testing here is whether the level of homicide goes up in a steeper fashion (and in the same direction) for one or the other group as the level of resource deprivation goes up. We see that’s the case here. The estimated lines are almost parallel, but the slope is a bit more steep in the Southern counties. In Southern counties resource deprivation seems to have more of an impact on homicide than in northern counties.
A word of warning: the moment you introduce an interaction effect, the meaning of the coefficients for the other predictors changes (what it is often referred as the “main effect” as opposed to the interaction effect). You cannot retain the interpretation we introduced earlier. The typical table of results helps you to understand whether the effects are significant but offers little of interest that will help you to meaningfully interpret what the effects are. For this, it is better you use some of the graphical displays we have covered.
Essentially what happens is that the regression coefficients that get printed are interpretable only for certain groups. So now:
-
The intercept still represents the predicted score of homicide for southern counties that have a score of 0 in resource deprivation (as before).
-
The coefficient of SOUTH_f1 now can be thought of as the difference between the predicted score of homicide rate for southern counties that have a score of 0 in resource deprivation and northern counties that have a score of 0 in resource deprivation.
-
The coefficient of RD90 now becomes the comparison of mean homicide rate for southern counties who differ by one point in resource deprivation.
-
The coefficient for the interaction term represents the difference in the slope for RD90 comparing southern and northern counties, the difference in the slope of the two lines that we visualised above.
