# Understanding Interaction Effects in Data Analysis

This tutorial introduces the basic idea of interaction effects in data analysis. This tutorial includes what an interaction effect is, examples of an interaction effect, and the statistical methods to do the analysis.

## What are interaction effects? (The definition)

An interaction effect is when the effect of one variable (e.g., X) on another variable (e.g., Y) is dependent on a third variable (e.g., Y). The following is the visual illustration.

Y=β01X+β2M+β3X×M

## Examples of Interaction Effects

I am going to provide two examples of interactions to help you understand interaction effects.

## Example 1

Suppose that you would like to how Brand A and Brand B are different in Sales. Thus, Brand (Brand A and Brand B) is the X, and Sales are the Y.

You calculate and find that Brand A has \$45M sales and Brand B has \$101M sales. Thus, you see the difference in sales. (Such difference can be called an effect.)

However, you realize that there is another variable (region) that you need to consider such as West Coast and East Coast.

In particular, the difference between Brand A and Brand B occurs mainly on East Coast (25M vs. 80M). In contrast, the sales numbers on West Coast are roughly the same (20M vs. 21M).

Thus, you can see the importance of considering the third variable M, as it provides further insights into the basic effect of X on Y.

## Example 2

Suppose that you find that there is a relationship between temperature and ice cream sales, such that higher temperatures will lead to more ice cream sales. Thus, the temperature is X, and ice cream sales are Y.

However, you then find out that Brand A ice cream sales increase much more than Brand B when the temperature goes up. Thus, Brand is the third variable M.