2026-06-08

Definition

An interaction model is a Second-Order Model that is used to test whether the outcome of one variable is affected by another variable.

For this presentation, a data set of US arrests is used to show the relationship between how Assault rate and Urban population percentage affect the murder rate with and without an interaction term.

How it looks

It’s a linear regression model with an additional product term of the two variables that are assumed to be dependent on each other.

\[Y = \beta_0 + \beta_1x_1 + \beta_2x_2 + \beta_3(x_1 \cdot x_2) + \epsilon\]

In this study:

  • \(Y\) = Murder rate

  • \(x_1\) = Assault rate

  • \(x_2\) = Urban population percentage

  • \(\beta_3(x_1 \cdot x_2)\) = Interaction term

First Order Model

Second Order Model

Benefits of an Interaction Term

  • More accurately predicts any outcome/result
  • Captures any relationship that a typical linear regression model might miss
  • Cleaner graphs

Scatterplot

Code for Scatterplot

library(scatterplot3d) model <- lm(Murder ~ Assault * UrbanPop, data = USArrests)

scatterplot3d(USArrests\(Assault, USArrests\)UrbanPop, USArrests$Murder, pch = 16, color = “darkgreen”,

xlab = “Assault”, ylab = “Urban Pop”, zlab = “Murder”,

main = “3D Perspective”)

Results

It seems like as \(x_1\) (Assault) increases, \(Y\) (Murder) increases, which confirms a positive relationship between them

It also seems like the urban population alone doesn’t do much to the murder rate, which is captured by

\[\frac{\partial Y}{\partial x_1} = \beta_1 + \beta_3 x_2\]