Econometrics Interactive
Instrumental Variables
Isolate causal effects when there's confounding. Use an "instrument" that affects treatment but not outcome directlyโrevealing true causal impact.
๐ The Endogeneity Problem
When X and Y share a common cause (confounder), OLS is biased. We can't tell if X causes Y or if both are driven by the confounder.
Example
Does advertising increase revenue, or do successful companies advertise more? "Success" is a confounder affecting both.
The IV Solution
Find Z that:
- Relevance: Z affects X
- Exclusion: Z only affects Y through X
- Independence: Z uncorrelated with confounder
Parameters
0.1 1
0 10
50 200
๐ Estimates
True Effect 2.00
OLS (biased) 4.38
Bias: 2.38
IV (unbiased) 2.78
Error: 0.78
IV Diagnostics
First Stage F-stat
140.9
โ Strong instrument
OLS Bias
+119%
Overestimating effect
โ Good setup. IV is closer to truth than OLS.
Causal Diagram
Z
Instrument
โ
X
Treatment
โ
Y
Outcome
U
Confounder (unobserved)
๐ Betting IV Examples
Promo Effect
Q: Do promos increase LTV?
IV: Random promo assignment (A/B test)
Line Movement
Q: Do sharp bets cause line moves?
IV: Sharp bettor availability (travel schedule)
Live Betting
Q: Does live betting increase engagement?
IV: Staggered state rollout
R Code Equivalent
# Instrumental variables with 2SLS
library(AER)
# Simulate data
set.seed(42)
n <- 100
confounder <- rnorm(n, 0, 10)
z <- rnorm(n, 50, 15) # Instrument
x <- 10 + 0.7 * z + 0.8 * confounder + rnorm(n, 0, 5)
y <- 100 + 2 * x + 5 * confounder + rnorm(n, 0, 20)
# OLS (biased)
ols_model <- lm(y ~ x)
cat("OLS estimate:", coef(ols_model)["x"], "\n")
# 2SLS (unbiased)
iv_model <- ivreg(y ~ x | z)
cat("IV estimate:", coef(iv_model)["x"], "\n")
# First stage F-stat
first_stage <- lm(x ~ z)
cat("First stage F:", summary(first_stage)$fstatistic[1], "\n")โ Key Takeaways
- โข IV solves endogeneity (confounding)
- โข Need valid instrument: affects X, not Y directly
- โข Check first-stage F greater than 10 (strong instrument)
- โข 2SLS: regress X on Z, then Y on predicted X
- โข Common IVs: randomization, policy changes
- โข IV estimate has higher variance than OLS