-
Notifications
You must be signed in to change notification settings - Fork 315
/
Figure 4-1-1.do
55 lines (46 loc) · 2.66 KB
/
Figure 4-1-1.do
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
clear all
set more off
/* Stata code for Figure 4-1-1 */
/* Download data */
shell curl -o asciiqob.zip http://economics.mit.edu/files/397
unzipfile asciiqob.zip, replace
/* Import data */
infile lwklywge educ yob qob pob using asciiqob.txt, clear
/* Use Stata date formats */
gen yqob = yq(1900 + yob, qob)
format yqob %tq
/* Collapse by quarter of birth */
collapse (mean) educ (mean) lwklywge (mean) qob, by(yqob)
/* Plot data */
graph twoway (line educ yqob, lcolor(black)) ///
(scatter educ yqob if qob == 1, ///
mlabel(qob) msize(small) msymbol(S) mcolor(black)) ///
(scatter educ yqob if qob != 1, ///
mlabel(qob) msize(small) msymbol(Sh) mcolor(black)), ///
xlabel(, format(%tqY)) ///
title("A. Average education by quarter of birth (first stage)") ///
ytitle("Years of education") ///
xtitle("Year of birth") ///
legend(off) ///
name(educ) ///
scheme(s1mono)
graph twoway (line lwklywge yqob, lcolor(black)) ///
(scatter lwklywge yqob if qob == 1, ///
mlabel(qob) msize(small) msymbol(S) mcolor(black)) ///
(scatter lwklywge yqob if qob != 1, ///
mlabel(qob) msize(small) msymbol(Sh) mcolor(black)), ///
xlabel(, format(%tqY)) ///
title("B. Average weekly wage by quarter of birth (reduced form)") ///
ytitle("Log weekly earnings") ///
xtitle("Year of birth") ///
legend(off) ///
name(lwklywge) ///
scheme(s1mono)
/* Compare graphs */
graph combine educ lwklywge, ///
col(1) ///
xsize(4) ysize(6) ///
graphregion(margin(zero)) ///
scheme(s1mono)
graph export "Figure 4-1-1-Stata.pdf", replace
/* End of file */