Ξ²β is the synergy bonus β the extra value from having both.
Quick Check
In the model Salary = Ξ²β + Ξ²βGPA + Ξ²βMIS + Ξ²βStats + Ξ²β(MIS Γ Stats), if Ξ²β = 5000 and Ξ²β = 3500, what is the salary boost for someone with BOTH an MIS concentration AND a Statistics minor (compared to someone with neither)?
Phase I β’ Interaction Effects
When Do We Need Interactions?
Three clues that you should add an interaction term.
π§
Theoretical Reason
You believe variables modify each other's effects. Training should reduce the impact
of inexperience.
π
Different Slopes in Plots
The relationship between X and Y is steeper for one group than another.
πΌ
Common Business Scenarios
Gender Γ Experience
Training Γ Experience
Marketing Γ Region
Two Types of Interactions
Dummy Γ Dummy
MIS (0/1) Γ Statistics (0/1)
Continuous Γ Continuous
Experience Γ Training
Phase II β’ R Lab
R Lab: Six Examples
We'll build models together in RStudio. Here's tonight's roadmap.
π
Ex 1: MIS Salary
Dummy Γ Dummy
π¦
Ex 2: Pick Errors
Continuous Γ Continuous
π«
Ex 3: Gender Gap
Dummy Γ Continuous
π°
Ex 4: Wages
Quadratic model
π
Ex 5: Rent
Log transformations
π₯
Ex 6: Health
Cross-validation
π‘
Follow Along
Open RStudio now. We'll write code together β each example builds on the last.
Phase II β’ R Lab
Example 1: MIS Salary β Without Interaction
Does MIS or a Statistics minor boost starting salary?
π
Salary Prediction (MIS.xlsx)
Y = Salary, X1 = GPA, X2 = MIS, X3 = Statistics
Model 1: No Interaction
MIS<-read_excel(
"Data/MIS.xlsx")
Model1<-lm(
Salary ~ GPA + MIS + Statistics, data = MIS)
summary(Model1)
Two Predictions: Same GPA, Different Qualifications
# No MIS, No Stats minor, GPA = 3.5
Salary1<-predict(Model1,
data.frame(GPA = 3.5, MIS = 0, Statistics = 0))
# With MIS AND Stats minor, GPA = 3.5
Salary2<-predict(Model1,
data.frame(GPA = 3.5, MIS = 1, Statistics = 1))
In this model, the combined boost is simply Ξ²β + Ξ²β. The model assumes no synergy.
β
The Limitation
Model 1 assumes the value of MIS is the same whether or not you have a Statistics minor. Is
that realistic? Let's add the interaction and find out.
Phase II β’ R Lab
Example 1: MIS Salary β With Interaction
Adding the interaction term reveals the synergy effect.
Model 2: With Interaction
Model2<-lm(
Salary ~ GPA + MIS + Statistics + MIS*Statistics,
data = MIS)
summary(Model2)
MIS*Statistics automatically includes MIS + Statistics + MIS:Statistics
The MIS:Statistics interaction coefficient
β +3,492
All else being equal, the value of an MIS concentration is enhanced by about 3,492 when
accompanied by a Statistics minor.
Predictions with Model 2 (GPA = 3.5)
Salary00<-predict(Model2,
data.frame(GPA = 3.5, MIS = 0, Statistics = 0))
Salary21<-predict(Model2,
data.frame(GPA = 3.5, MIS = 1, Statistics = 0))
Salary11<-predict(Model2,
data.frame(GPA = 3.5, MIS = 1, Statistics = 1))
Compare Salary11 vs Salary21: the difference is more than just the Statistics coefficient β
it includes the interaction bonus.
π‘
Business Insight
Complementary skills create extra value. Encourage both technical skills (MIS) and quantitative
foundations (Statistics) β the combination is worth more than the sum.
Phase II β’ R Lab
Example 2: Pick Errors β Continuous Γ Continuous
Does training reduce the impact of inexperience on warehouse errors?
π¦
Warehouse Pick Errors (Pick_errors.xlsx)
Y = Errors, X1 = Experience, X2 = Training
Compare Models
myData<-read_excel(
"Pick_errors.xlsx")
# Model 1: No interaction
Model1<-lm(
Errors ~ Exper + Train, data = myData)
The effect of one more year of experience depends on training, and the effect of one more
hour of training depends on experience. The interaction coefficient tells you how the slope
of one changes with the other.
Phase II β’ R Lab
Example 3: The Gender Pay Gap
Does experience affect salaries differently for men and women?