Mathwords logoMathwords

Interaction Effect — Definition, Formula & Example

An interaction effect is present when the effect of one factor on an outcome changes depending on the level of a second factor. For example, a fertilizer might boost a crop a lot when plants get plenty of water but barely help when water is scarce.

In a factorial design with factors AA and BB, an interaction exists when the population mean response is not additive in the two factors. That is, the difference in mean response between levels of AA is not the same at every level of BB. For a 2×22 \times 2 design with cell means μij\mu_{ij}, the interaction contrast is (μ11−μ01)−(μ10−μ00)(\mu_{11} - \mu_{01}) - (\mu_{10} - \mu_{00}), and there is no interaction exactly when this contrast equals 00. In the regression model y=β0+β1x1+β2x2+β3x1x2+εy = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_1 x_2 + \varepsilon, if x1x_1 and x2x_2 are indicator variables coded 00 and 11, then β3\beta_3 equals this contrast. Under other codings, such as ±1\pm 1, β3\beta_3 is a constant multiple of the contrast rather than equal to it. Under any of these codings, β3=0\beta_3 = 0 still means no interaction.

Key Formula

Interaction=(μ11−μ01)−(μ10−μ00)\text{Interaction} = (\mu_{11} - \mu_{01}) - (\mu_{10} - \mu_{00})
Where:
  • μij\mu_{ij} = Mean response when factor A is at level i and factor B is at level j (each level is 0 or 1)
  • μ11−μ01\mu_{11} - \mu_{01} = Effect of changing A from level 0 to level 1 while B is at level 1
  • μ10−μ00\mu_{10} - \mu_{00} = Effect of changing A from level 0 to level 1 while B is at level 0

Worked Example

Problem: A gardener runs a 2×22 \times 2 experiment on tomato plants. Factor A is fertilizer (none or used). Factor B is watering (low or high). The mean yields per plant are: no fertilizer with low water, 4 pounds; no fertilizer with high water, 6 pounds; fertilizer with low water, 5 pounds; fertilizer with high water, 11 pounds. Find the interaction effect.
Step 1: Find the fertilizer effect under low water. Compare the fertilizer and no-fertilizer means at that level.
μ10−μ00=5−4=1 pound\mu_{10} - \mu_{00} = 5 - 4 = 1 \text{ pound}
Step 2: Find the fertilizer effect under high water.
μ11−μ01=11−6=5 pounds\mu_{11} - \mu_{01} = 11 - 6 = 5 \text{ pounds}
Step 3: Subtract the two effects. The result is the difference of differences.
Interaction=5−1=4 pounds\text{Interaction} = 5 - 1 = 4 \text{ pounds}
Answer: The interaction effect is 4 pounds per plant. Fertilizer adds 4 more pounds with high water than with low water. The contrast is symmetric, so you get the same value if you compare the water effects instead: (11−5)−(6−4)=6−2=4(11 - 5) - (6 - 4) = 6 - 2 = 4. With 0/1 coding, this is the coefficient β3=4\beta_3 = 4 on the product term. These are sample means, so you still need a hypothesis test to decide whether the true interaction differs from 0.

Visualization

Why It Matters

When an interaction is present, a single main effect misrepresents both conditions. In the example, the average fertilizer effect is 3 pounds, which matches neither the 1-pound nor the 5-pound effect. The same issue shows up in pharmacology, where two drugs together can act differently than either drug alone. It also shows up in A/B testing, where a website redesign might raise sales on phones but not on laptops.

Common Mistakes

Mistake: Thinking an interaction means the two factors are correlated or related to each other.
Correction: Interaction describes how the factors jointly affect the response, not how the factors relate to one another. In a balanced, randomly assigned factorial experiment, the factors are independent by design, yet they can still interact. Check whether one factor's effect changes across levels of the other. Nonparallel lines on an interaction plot signal this.

Related Terms

  • Two-Way ANOVA — Tests whether an observed interaction is statistically significant
  • Response Variable — The outcome whose mean the interacting factors change
  • Mean — Cell means are the building blocks of the contrast
  • Hypothesis Testing — Decides if a sample interaction reflects a real one
  • Null Hypothesis — States the interaction contrast equals zero in the population
  • Random Assignment — Lets factorial experiments attribute interactions to the factors themselves
  • Factorial Experiment — Design that crosses factors to detect interactions