01 / 21

Interaction
Terms

Learn how two predictors can work together to influence an outcome: when the effect of one variable depends on the level of another.

Business Statistics

What Is an Interaction?

In regression, an interaction occurs when the effect of one independent variable on the dependent variable changes depending on the value of another independent variable. The two predictors are not just additive: they modify each other's influence.

Additive vs. Interactive Effects

Additive Model Advertising Sales Summer Holiday Same slope: parallel lines Interactive Model Advertising Summer Holiday Different slopes: lines diverge

Why Interactions Matter in Business

Pricing Strategy
A discount's effect on demand may depend on brand loyalty: loyal customers respond differently than new ones.
Marketing ROI
Digital ad effectiveness often depends on the target demographic: age moderates the ad-to-purchase relationship.
Operations
Training's effect on productivity may depend on experience level: novices benefit more than veterans.

The Interaction Model Equation

A regression with two predictors and their interaction is written:

\(\beta_1, \beta_2\)
Main effects: the individual contributions of each predictor.
\(\beta_3\)
Interaction coefficient: how much the slope of \(X_1\) changes per unit of \(X_2\).
\(X_1 \cdot X_2\)
Interaction term: the product of the two predictors, creating a new variable.

Interpreting \(\beta_3\)

The interaction coefficient \(\beta_3\) tells us how the slope of one predictor changes as the other predictor increases. We can rewrite the model to see this clearly:

The effective slope of \(X_1\) is now \(\beta_1 + \beta_3 X_2\). This slope is not a fixed number: it depends on the current value of \(X_2\).

Main Effects vs. Interaction

Main Effects Only With Interaction
Model Form \(\beta_0 + \beta_1 X_1 + \beta_2 X_2\) \(\beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_3 X_1 X_2\)
Slope of \(X_1\) Constant: \(\beta_1\) Varies: \(\beta_1 + \beta_3 X_2\)
Graph Lines Parallel Non-parallel (may cross)
Assumption Effects are independent Effects are synergistic
Parameters 3 (\(\beta_0, \beta_1, \beta_2\)) 4 (\(\beta_0, \beta_1, \beta_2, \beta_3\))

Continuous × Categorical Interactions

A very common business scenario: one predictor is continuous (e.g., price) and the other is categorical (e.g., region: East vs. West). The categorical variable is coded as a dummy (\(D = 0\) or \(1\)).

When \(D = 0\) (East)
\(Y = \beta_0 + \beta_1 \cdot \text{Price}\)
Intercept: \(\beta_0\), Slope: \(\beta_1\)
When \(D = 1\) (West)
\(Y = (\beta_0 + \beta_2) + (\beta_1 + \beta_3) \cdot \text{Price}\)
Intercept shifts by \(\beta_2\), slope shifts by \(\beta_3\)

Continuous × Continuous Interactions

When both predictors are continuous, the interaction creates a surface rather than distinct lines. The effect of \(X_1\) varies smoothly as \(X_2\) changes.

Advertising Spend (\(X_1\))
Revenue (\(Y\))
\(X_2\) = Low
\(X_2\) = Med
\(X_2\) = High
Slopes steepen as \(X_2\) increases

How to Build an Interaction Model

1
Start with main effects. Fit the additive model \(Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2\) first.
2
Create the interaction variable. Compute a new column: \(X_3 = X_1 \times X_2\).
3
Add it to the regression. Fit \(Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_3 X_3\).
4
Test significance. Check if \(\beta_3\) is statistically significant (\(p\)-value < 0.05).
5
Interpret in context. Explain what the interaction means for the business decision.

Example 1: Coffee Shop Sales

A coffee shop studies how temperature (\(X_1\), in \(^{\circ}\text{F}\)) and whether it's a weekday or weekend (\(D = 0\) weekday, \(D = 1\) weekend) affect daily iced coffee sales (\(Y\)).

Weekday (\(D=0\))
\(\hat{Y} = 10 + 0.8 \cdot \text{Temp}\)
Each \(1^{\circ}\text{F}\) increase adds 0.8 sales.
Weekend (\(D=1\))
\(\hat{Y} = 15 + 1.1 \cdot \text{Temp}\)
Each \(1^{\circ}\text{F}\) increase adds 1.1 sales.

Example 1: Visualized

Temperature (\(^{\circ}\text{F}\))
Iced Coffee Sales 60 70 80 90 50 75 100 125 Weekday Weekend
Gap grows
(\(\beta_3\) effect)

Example 2: Online Retail Revenue

An online retailer models revenue (\(Y\), in $1000s) using ad spend (\(X_1\), in $1000s) and customer satisfaction score (\(X_2\), scale 1-10). Both are continuous.

Interpretation: Each additional $1000 in ad spend increases revenue by \(3 + 0.5 X_2\) thousand dollars. If satisfaction is \(X_2 = 4\), the marginal effect is \(3 + 2 = 5\). If satisfaction is \(X_2 = 8\), the marginal effect is \(3 + 4 = 7\).

Example 3: Full Calculation

Using the retail model \(\hat{Y} = 20 + 3X_1 + 4X_2 + 0.5X_1 X_2\), predict revenue when ad spend is \(X_1 = 10\) ($10,000) and satisfaction is \(X_2 = 7\).

1
Plug in values: \(\hat{Y} = 20 + 3(10) + 4(7) + 0.5(10)(7)\)
2
Compute each term: \(20 + 30 + 28 + 35\)
3
Result: \(\hat{Y} = 113\) ($113,000 in revenue)

Common Mistakes

✕ Dropping Main Effects
Including \(X_1 X_2\) without \(X_1\) and \(X_2\) separately violates the hierarchy principle and produces biased estimates.
✕ Ignoring Significance
Adding an interaction "just in case" without testing \(\beta_3\)'s p-value leads to overfitting and reduced predictive accuracy.
✕ Misreading \(\beta_1\)
In a model with interaction, \(\beta_1\) is the effect of \(X_1\) only when \(X_2 = 0\): not the "overall" effect.

Summary of Key Concepts

Concept Definition Key Signal
Main Effect Direct effect of one predictor alone Significant \(\beta_1\) or \(\beta_2\)
Interaction Term Product of two predictors (\(X_1 \cdot X_2\)) Significant \(\beta_3\)
No Interaction Effects are purely additive Parallel regression lines
Positive Interaction Variables amplify each other Lines diverge (fan out)
Negative Interaction Variables dampen each other Lines converge (narrow)
Hierarchy Principle Always keep main effects with interaction Never drop \(X_1\) or \(X_2\)

Question 1 of 5

In the model $$Y = \beta_0 + \beta_1 X_1 + \beta_2 X_2 + \beta_3 X_1 X_2 + \varepsilon$$, what does \(\beta_3\) represent?

Question 2 of 5

When you plot predicted \(Y\) against \(X_1\) at different levels of \(X_2\), an interaction is present if:

Question 3 of 5

Given $$\hat{Y} = 5 + 2X_1 + 3X_2 + 0.4X_1 X_2$$, what is the marginal effect of \(X_1\) when \(X_2 = 5\)?

Question 4 of 5

The hierarchy principle in regression states that when you include an interaction \(X_1 X_2\), you should:

Question 5 of 5

A model gives $$\hat{Y} = 10 + 0.8\,\text{Temp} + 5D + 0.3(\text{Temp} \cdot D)$$ where \(D = 1\) for weekends. What is the predicted sales when \(\text{Temp} = 80\) and it is a weekend?