Course contentsShow
← Data Science
Lesson 648 of 2,14517. Categorical Predictors and InteractionsFree lesson

What are Interaction Terms?

Define interactions as when the effect of one predictor on the outcome depends on the value of another predictor.

What are Interaction Terms?

You'll learn: How interaction terms capture scenarios where one predictor's effect on the outcome changes depending on another predictor's value.

The Core Idea

An interaction term represents a relationship where the effect of one predictor on your outcome variable depends on the level or value of another predictor. In other words, the two predictors don't just add their effects independently—they work together in a multiplicative way.

Think of it like coffee and sugar. Sugar makes coffee sweeter, and coffee makes you more alert. But the enjoyment you get from sweetness might depend on whether you're drinking coffee or tea—the effect of sugar interacts with the type of beverage. Similarly, in regression, the impact of one variable can change based on another.

Why This Matters

Without interaction terms, standard multiple regression assumes that each predictor's effect is constant regardless of other predictors' values. For example, if you're predicting house prices with both square footage and location (urban vs. suburban), a basic model assumes each extra square foot adds the same value everywhere.

But what if square footage matters more in urban areas where space is premium? That's an interaction: the effect of square footage on price depends on location. An interaction term lets you model this reality.

Plain English Example

Imagine predicting exam scores using study hours and whether someone had a tutor. The tutor might help, but perhaps tutoring is especially helpful when combined with many study hours. The effect of having a tutor interacts with study hours—they amplify each other.

Key Takeaway: Interaction terms model situations where the effect of one predictor on the outcome changes depending on the value of another predictor, capturing non-additive relationships between variables.