-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathchild-labor.Rmd
79 lines (66 loc) · 2.5 KB
/
child-labor.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
---
output: html_document
editor_options:
chunk_output_type: console
---
# Child Labor Laws as an IV
2SLS estimates of the returns to schooling using child labor laws as instruments for years of schooling [@AcemogluAngrist2000].
This replicates Table 6.3 of *Mastering 'Metrics*.
```{r setup,message=FALSE}
library("AER")
library("sandwich")
library("clubSandwich")
library("tidyverse")
library("broom")
```
Load the `child_labor` data.
```{r child_labor}
data("child_labor", package = "masteringmetrics")
child_labor <- mutate(child_labor,
year = factor(year),
yob_fct = factor(yob),
sob = factor(sob))
```
## First stages and reduced forms
Column 1. Years of Schooling.
```{r mod1}
mod1 <- lm(indEduc ~ year + yob_fct + sob + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod1, vcov = vcovCR(mod1, cluster = child_labor[["sob"]]))
```
Column 2. Years of Schooling. State of birth dummies x linear year of birth trends.
```{r mod2}
mod2 <- lm(indEduc ~ year + yob_fct + sob + sob:yob + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod2, vcov = vcovCR(mod2, cluster = child_labor[["sob"]]))
```
Column 3. Log weekly wages.
```{r mod3}
mod3 <- lm(lnwkwage ~ year + yob_fct + sob + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod3, vcov = vcovCR(mod1), cluster = child_labor[["state"]])
```
Column 4. Log weekly wages. State of birth dummies x linear year of birth trends.
```{r mod4}
mod4 <- lm(lnwkwage ~ year + yob_fct + sob + sob:yob + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod4, vcov = vcovCR(mod2), cluster = child_labor[["state"]])
```
## IV returns
Column 3. Log weekly wages.
```{r mod5}
mod5 <- ivreg(lnwkwage ~ year + yob_fct + sob + indEduc |
. - indEduc + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod5, vcov = vcovCR(mod1), cluster = child_labor[["state"]])
```
Column 4. Log weekly wages. State of birth dummies x linear year of birth trends.
```{r mod6}
mod6 <- ivreg(lnwkwage ~ year + yob_fct + sob + sob:yob + indEduc |
. - indEduc + cl7 + cl8 + cl9,
data = child_labor, weights = weight)
# coef_test(mod6, vcov = vcovCR(mod2), cluster = child_labor[["state"]])
```
## References {-}
- <http://masteringmetrics.com/wp-content/uploads/2015/02/ReadMe_ChildLaborLaws.txt>
- <http://masteringmetrics.com/wp-content/uploads/2015/02/AA_regs.do>