-
Notifications
You must be signed in to change notification settings - Fork 11
/
iv.Rmd
518 lines (391 loc) · 17.3 KB
/
iv.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
# Instrumental Variables
## IV in DAGs
The following graph is a DAG of an instrumental variable:
```{r}
DiagrammeR::grViz(here::here("diagrams", "iv-dag.gv"))
```
- $Y$ is outcome
- $Z$ is instrument
- $D$ is treatment
- $U$ is unmeasured confounder
The **exclusion restriction**
- No common causes of the instrument ($Z$) and outcome ($Y$).
Note that $U$ does not point to $Z$.
- No direct or effect of the the instrument $Z$ on $Y$ except through the treatment $Z$.
In the DAG, there is not a path from $Z$ to $U$ (indirect effect), or $Z$ to $Y$ (direct effect).
The only path from $Z$ to $Y$ goes through $D$.
The **first stage** relationship is $Z \leftarrow D$.
IV is as good as its assumptions
- Hard to find a believe instrument with believable exclusion restrictions.
- When effects vary, the IV is only a local ATE, local to the instrument.
Examples of IVs
|Paper | Treatment | IV | Outcome |
|----|----|----|---|
| Angrist (1990) | Military service | Draft lottery | Income |
| Acemoglue et al. (2001) | Instutional quality | Settler mortality | GDP per capita |
| Levitt (1997) | Police force size | election year | crime |
| Kern and Heinmueller (2009) | West German TV watching | Having West German TV Reception in East Berlin | Support for East German regime |
| Nunn and Wantchekon (2011) | slave raiding of ethnic group | distance from coast | trust attitudes today |
| Acharya, Blackwell, Senn (2015) | slave proportion in 1860 | cotton suitability | white attitudes today |
## IV with Constant Treatment Effects
Causal model for $Y_i$ with unmeasured confounder $U_i$
$$
Y_i(d, u) = \alpha + \tau d + \gamma u + \eta_i
$$
Given an consistency assumption, the regression form is,
$$
Y_i = \alpha + \tau D_i + \gamma U_i + \eta_i
$$
- Assume $\E(D_i \eta_i) = 0$.
If we could observe $U_i$ could identify $\tau$.
- $\Cov(\gamma U_i + \eta_i, D_i) \neq 0$ since $U$ is common cause of $D$ and $Y$
What does the instrument do?
Suppose there is an instrument that satisfies the exclusion restriction.
$$
\Cov(\gamma U_i + \eta_i, Z_i) = 0
$$
If must be independent of $U$, and is not correlated with $\eta_i$.
$$
\begin{aligned}[t]
\Cov(\gamma U_i + \eta_i, Z_i) &= \Cov(\alpha + \tau D_i + \gamma U_i + \eta_i, Z_i) \\
&= \Cov(\alpha, Z_i) + \Cov(\tau D_i, Z_i) + \Cov(\gamma U_i + \eta_i, Z_i) \\
&= 0 + \tau \Cov(D_i, Z_i) + 0
\end{aligned}
$$
The average treatment effect is
$$
\tau = \frac{\Cov(Y_i, Z_i)}{\Cov(D_i, Z_i)} = \frac{\Cov(Y_i, Z_i) / \Var(Z_i)}{\Cov(D_i, Z_i) / \Var(Z_i)}
$$
- **reduced form** is $\Cov(Y_i, Z_i) / \Var(Z_i)$
- **first stage** is $\Cov(D_i, Z_i) / \Var(Z_i)$
The natural estimator for $\tau$ is
$$
\widehat{\tau}_{IV} = \frac{\widehat{\Cov}(Y_i, Z_i)}{\widehat{\Cov}(D_i, Z_i)}
$$
**weak first stage**: If $\Cov(Z_i, D_i)$ is small, then even small violations in exclusion restriction $\Cov(Z_i, U_i) \neq 0$.
Convey strength of first-stage via a $t$-test or $F$-test with multiple instruments.
With binary instrument, it is the Wald estimator:
$$
\begin{aligned}[t]
\tau &= \frac{\Cov(Y_i, Z_i)}{\Cov(D_i, Z_i)} \\
&= \frac{\E(Y_i | Z_i = 1) - \E(Y_i | Z_i = 0)}{\E(D_i | Z_i = 1) - \E(D_i | Z_i = 0)} \\
&= \frac{\text{effect of instrument on outcome}}{\text{effect of instrument on treatment}}
\end{aligned}
$$
## With Covariates?
What if there is a set of covariates $X_i$ that need to be conditioned on?
Start with linear models of outcome and treatment.
$$
\begin{aligned}
Y_i &= X'_i \beta + \tau D_i + \epsilon_i \\
D_i &= X'_i \alpha + \gamma Z_i + \nu_i
\end{aligned}
$$
Assume that $X_i$ and $Z_i$ are exogenous:
$$
\begin{aligned}[t]
\E(Z_i \nu_i) &= 0 & \E(Z_i \epsilon_i) &= 0 \\
\E(X_i \nu_i) &= 0 & \E(X_i \epsilon_i) &= 0
\end{aligned}
$$
But $D_i$ is endogenous,
$$
\E(D_i \epsilon_i) \neq 0
$$
Plug the treatment equation into the outcome,
$$
\begin{aligned}[t]
Y_i &= X'_i \beta + \tau(X'_i \alpha + \gamma Z_i + \nu_i) + \epsilon_i \\
&= X'_i \beta + \tau(X'_i \alpha + \gamma Z_i) + (\tau \nu_i + \epsilon_i) \\
&= X'_i + \tau (X'_i \alpha + \gamma Z_i) + \epsilon^*_i \\
&= X'_i \beta + \tau \underbrace{E(D_i | X_i, Z_i)}_{\text{first stage}} + \epsilon_i^*
\end{aligned}
$$
The treatment effect is the predicted value from the first stage,
$$
\E(D_i | X_i, Z_i) = X'_i \alpha + \gamma Z_i .
$$
Estimate $\widehat{\alpha}$ and $\widehat{\gamma}$ from OLS,
$$
\widehat{\E}(D_i | X_i, Z_i) = \hat{D}_i = X'_i \hat{\alpha} + \hat{\gamma} Z_i
$$
Regress $Y_i$ on $X_i$ and $\hat{D}_i$.
## Two-Stage Least Squares
Heuristic procedure
1. Regress treatment on covariates and instrument
1. Construct fitted values of treatment
1. Regress outcome on covariates and fitted values of treatment
Actual 2SLS estimation is different in order to get standard errors correct.
## Overidentification
- **Just identified:** Number of instruments equals endogenous variables.
- **Overidentified:** More instruments than endogenous variables
If overidentified and **constant effects** can use Sargan-Hausman overidentification test
- Null hypothesis: valid instruments and constant effects, using all instruments vs. a subset should produce the same estimate (differing only by sampling variation)
- If rejected:
- Either constant effects assumption is true and at least one instrument fails its exclusion restriction
- or not constant effects
# IV and Potential Outcomes
- Idea of IV
- $D_i$ not randomized
- $Z_i$ is randomized
- $Z_i$ only affects $Y_i$ through $D_i$
- $D_i$ now depends on potential outcomes through $Z_i$
- Consistency
$$
D_i = Z_i D_i(1) + (1 - Z_i) D_i(0)
$$
- Outcome depends on treatment and instrument:
$Y_i(d, z)$ is the potential outcome if unit $i$ received the
treatment $D_i = d$ and instrument value $Z_i = z$.
## Assumptions
1. Randomization
1. Exclusion Restriction
1. First-stage relationship
1. Monotonicity
### Randomization
- Instrument must be randomized
$$
$$
- Can weaken to conditional ignorability (conditioning on other covariates). But why trust conditional ignorability for
instrument but not treatment?
- Best instruments are truly randomized
- This identifies **intent-to-treat (ITT)** effect:
$$
E(Y_i | Z_i = 1) - E(Y_i | Z_i = 0) = E(Y_i(D_i(1)), 1) - Y_i(D_i(0), 0)
$$
Intent-to-treat is the causal effect of the instrument
### Exclusion restriction
Instrument has no direct effect on outcome, once the value of the treatment is fixed.
$$
Y_i(d, 1) = Y_i(d, 0) \text{ for } d = 0, 1 .
$$
Potential outcomes for each treatment only depend on the treatment, not the instrument.
$$
\begin{aligned}[t]
Y_i(1) = Y_i(1, 1) = Y_i(1, 0) \\
Y_i(0) = Y_i(0, 1) = Y_i(0, 0)
\end{aligned}
$$
Rewrite $Y_i$ as a regression using consistency:
$$
\begin{aligned}[t]
Y_i &= Y_i(0) + (Y_i(1) - Y_i(0)) D_i \\
&= \alpha_0 + \tau_i D_i + \eta_i
\end{aligned}
$$
where
$$
\begin{aligned}[t]
\alpha_0 &= E(Y_i(0)) \\
\tau_i &= Y_i(1) - Y_i(0)
\end{aligned}
$$
### First Stage
Obvious, but important. The instrument must have an effect on the treatment.
$$
E(D_i(1) - D_i(0)) \neq 0
$$
or
$$
\Cov(D_i, Z_i) \neq 0 .
$$
### Monotonicity
The presence of the instrument never dissuades someone from taking the treatment.
Alternatively, the treatment always at least weaky improves the probability of someone taking the treatment.
$$
D_i(1) - D_i(0) \geq 0
$$
or the alternative direction depending on the scale of $D$.
But it always needs to be in the same direction.
Called **no defiers**
With binary treatment and binary instrument, there are four combinations (called **prinicpal strata**):
| Name | $D_i(1)$ | $D_i(0)$ |
|---------------|----------|----------|
| Always takers | 1 | 1 |
| Never Takers | 0 | 0 |
| Compliers | 1 | 0 |
| Defiers | 0 | 1 |
**Monotonicity** assumption is that there are **no defiers**.
Given the values of $Z_i$ and $D_i$, the possible (unobserved)
stata for $i$ are:
| $Z_i$ | $D_i$ | Possible Strata |
|----------|----------|------------------------|
| 1 | 1 | Always taker, Complier |
| 0 | 0 | Never taker, Complier |
| 1 | 0 | Never taker |
| 0 | 1 | Always taker |
In particular, if someone receives the instrument and takes treatment, they could be a complier who only took the treatment because they received the instrument and would have not taken the treatment if they had not, or an always-taker and would have taken the treatment regardless of whether they received the treatment or not.
### Local Average Treatment Effect (LATE)
With those assumptions, the Wald estimator is equal to the local average treatment effecte (LATE) or the complier average treatment effect (CATE)
The LATE is the ATE averaged over compliers only.
$$
\frac{\E(Y_i | Z_i = 1) - \E(Y_i | Z_i = 0)}{\E(D_i | Z_i = 1) - \E(D_i | Z_i = 0)} = E(Y_i(1) - Y_i(0) | D_i(1) > D_i(0))
$$
- This is **big**. Once we allow for heterogeneous effects, the IV only estimates a causal effect among compliers.
- This subset is unknown:
- treated units are mix of always takers and compliers
- control units are mix of never takers and compliers
- With no further assumptions: $\tau_{LATE} \neq \tau_{ATE}$
- Complier group varies with instrument. Different instruments mean different complier groups.
- 2SLS assumes that the effect is constant and thus ignores this.
### One-sided noncopliance
When non-compliance is one-sided, then LATE is equal to the ATT
Randomized experiment
- Randomized treatement assignment is the instrument $Z_i$
- Non-random actual treatment take is the treatment $D_i$
One-sided non-compliance because only those assigned to treatment can actually take the treatment:
$$
\Pr(D_i = 1 | Z_i = 0) = 0
$$
If one-sided compliance, then the IV estimates the average treatment on the treated (ATT),
$$
\frac{E(Y_i | Z_i = 1) - E(Y_i | Z_i = 0)}{\Pr(D_i = 1 | Z_i = 1)} = \E(Y_i(1) - Y_i(0) | D_i = 1) .
$$
### Extensions
- Falsification tests
- Cannot identify who is a complier, can estimate the size
of the complier group, and features of the complier group
- Multiple instruments. This means multiple LATEs
- When 2SLS used with multiple instruments it is a
weighted average of the LATEs from each instrument.
## Instrumental Variables
Challenges with using IV
- Hard to find IV that satisfies the assumptions
- IV estimates have high variance
## IV Assumptions
1. *First stage*: Instrument is correlated with the treatment
2. *Independence assumption*: Instrument is "as good as randomly assigned".
It is not correlated with any unmeasured confounders that cause $Y$
3. *Exclusion restriction*: There are no indirect or direct effects of the
instrument on $Y_i$ except through the treatment $D_i$.
## LATE
**First stage** is the effect of the instrument on the treatment.
$$
\phi = \E(D_i | Z_i = 1) - \E(D_i | Z_i = 0)
$$
**Reduced form** is the effect of the instrument on the outcome,
$$
\rho = \E(Y_i | Z_i = 1) - \E(Y_i | Z_i = 0)
$$
**Local average treatment effect** is the ratio of the reduced form to the first stage,
$$
\lambda = \frac{\rho}{\phi} = \frac{\E(Y_i | Z_i = 1) - \E(Y_i|Z_i = 0)}{\E(D_i| Z_i = 1) - \E(D_i |Z_i = 0)} .
$$
Why is this a local average treatment effect? What is the local?
Let's consider who this is being averaged over.
There are four unobserved groups in the population called the principal strata.
They are determined by whether an individual would have taken the treatment
after both the instrument and not (recall we only observe at most one of these).
The following table shows for a given instrument assignment, the value of the treatment $D_i$.
| | $Z_i = 0$ | $Z_i = 1$ |
|---------------|------------|-----------|
| Always-takers | 1 | 1 |
| Never-takers | 0 | 0 |
| Compliers | 0 | 1 |
| Deniers | 1 | 0 |
Given observing $Z_i$ and $D_i$ what strata are individuals?
We will make one more assumption,
**Monotonicity**: the instrument always increases the probability of receiving
the treatment. It does not decrease the probability of receiving the treatment.
With monotonicity, what can we say about what strata individuals are in
given the observed values of the instrument and treatment?
| $Z_i$ | $D_i$ | Possible Strata |
|-------|-------|------------------------|
| 0 | 0 | Never-taker, complier |
| 0 | 1 | Always-taker |
| 1 | 0 | Never-taker |
| 1 | 1 | Always-taker, complier |
Given monotonicity, the Wald estimator estimates the local average treatment effect (LATE) or complier average treatment effect (CATE).
This is the treatment effect from averaging the causal effects over the compliers only
$$
\lambda = \frac{\rho}{\phi} = \E(Y_i(1) - Y_i(0) | C_i = 1)
$$
Implications
- Generally, $LATE \neq ATE$
- The ATE of always-takers and never-takers could be different
- Since different instruments have different strata, the LATE of different instruments can be different.
### One-sided non-compliance
The reduced form estimates the intent-to-treat (ITT) effects.
$$
\E(Y_i | Z_i = 1) - \E(Y_i | Z_i = 0)
$$
One sided non-compliance occurs when only some subset receive the possibility of having the treatment.
This means that there are no always-takers ($\Pr(D_i = 1 | Z_i = 0)) = 0$.
In this case the treated are **always** compliers.
With no always takers IV estimates the ATT (Average treatment on the treated) or TOT (treatment on the treated),
$$
\lambda = \E(Y_{i}(1) - Y_{i}(0) | D_i = 1, Z_i = 1) = \E(Y_i(1) - Y_i(0) | D_i = 1) .
$$
Since all treated ($D_i = 1$) are assumed to be compliers, there is no ambiguity.
## Two-stage least squares
The reduced form regression is the regression of the outcome on the instrument.
$$
Y_i = \alpha + \rho Z_i + \epsilon_{0i}
$$
The coefficient on $Z_i$ is
$$
\rho = \E(Y_i | Z_i = 1) - \E(Y_i | Z_i = 0)
$$
## Quasi Instruments and Weak Instruments
For 2SLS, the estimator converges in probability to:
$$
\plim \hat{\beta}_{2SLS} = \beta + \frac{\Cor(Z, \epsilon)}{\Cor(Z, D)} \times \frac{\sigma_{\epsilon}}{\sigma_{D}}
$$
If the instrument is uncorrelated with the errors (which means the exclusion restriction holds), then $\plim \hat{\beta}_{2SLS} = \beta$ and the 2SLS
estimator is unbiased.
If the exclusion restriction does not hold, it is biased.
Instruments are **Weak** if $\Cor(Z, X)$ is low, meaning the instruments explain a small part of $D$.
Technically, the 2SLS estimator is consistent but biases.
As the sample size gets larger, on average it converges to the true parameter value.
However, for finite samples it is biased.
The bias bias of 2SLS increases with the number of instruments, so there is a trade-off between how well the instruments explain the treatment and the number.
The **rule of thumb** for weak instruments: the F-test of the first stage should be larger than 10.
## Precision of 2SLS
The 2SLS has a higher variance than OLS, though if its assumptions hold it is
unbiased.
The direct application of the heuristic 2SLS regression will not produce the
correct standard errors. Generally let the software do this for you.
However, the equation for 2SLS standard errors provides a few insights.
Consider the regression with outcome $Y$, treatment $D$, instrumental variable
$Z$, and other covariates $X$.
$$
\Var(\hat{\beta}) = \frac{\hat{\sigma}^2}{n \Var(\hat{D})(1 - R^2_{D})}
$$
where
$$
\hat{\sigma}^2 = \frac{\sum Y_i - \hat{Y}}{n -k }
$$
using the 2SLS fitted values,
and $R^2_{D}$ is the $R^2$ of the regression of $\hat{D}$ on $X$.
Some implications:
- When $\Var{\hat{D}}$ is small, the regression does not explain much,
the standard errors are large.
- When $R^{2}_{D}$ is high, meaning most of the $\hat{D}$ is explained
by the other covariates $X$, then $\hat{D}$ is explained by $X$ and
not $Z$ and the standard errors are larger.
Note: $R^2$ is meaningless in instrumental variable regressions.
## R packages
The most common are:
- `sem::tsls`
- `AER::ivreg`
The function `ivreg` in **AER** seems easier to use for causal inference problems.
Be sure to use robust standard errors; there are several functions that allow them to be applied to 2SLS models, notably in the **ivpack** package.
## Other uses of IV
Instrumental variables have and are used in several different ways, with
different models justifying their use. It helps to be aware of that so
as not to be confused when you encounter it.
In particular, the structural equation/simulataneous equation approach to
IV will look much different than the modern econometric/statistical
justification and use of IVs.
- Instrumental variables occur often in panel and time-series with
lags used as instruments. This often is highly model dependent,
and should be viewed with some skepticism.
- Instrumental variables are closely related to (are a special case of)
structural equation models (which is why there is an IV command in the
R package `sem`) and in particular simultaneous
equations models. These uses tend to be a little older. Don't be confused
by it.
- In econometrics, IV was first used for estimating supply-and-demand equations.
This is often presented as a structural equation model.
- IV can also be used in a slightly different way to estimate covariates
measured with error.