-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathADHapplication.do
119 lines (98 loc) · 6.06 KB
/
ADHapplication.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
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
version 14.0
clear all
set more off
set scheme s1color
capture log close
cd "D:/Dropbox/RA_Princeton/RA_Morales/BartikSEStata"
log using "output/logfiles/AKM.log", replace
prog main
**** AKM OLS examples
* (1) AKM, no cluster
timer on 1
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl_mfg, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05)
timer off 1
timer list 1
* (2) AKM0, no cluster
timer on 2
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl_mfg, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0)
timer off 2
timer list 2
* (3) AKM, cluster
timer on 3
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl_mfg, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
timer off 3
timer list 3
* (4) AKM0, cluster
timer on 4
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl_mfg, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
timer off 4
timer list 4
**** AKM IV examples
* (1) AKM, no cluster
timer on 5
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl_mfg, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1)
timer off 5
timer list 5
* (2) AKM0, no cluster
timer on 6
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl_mfg, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0) beta0(0)
timer off 6
timer list 6
* (3) AKM, cluster
timer on 7
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl_mfg, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
timer off 7
timer list 7
* (4) AKM0, cluster
timer on 8
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl_mfg, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0) beta0(0) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
timer off 8
timer list 8
** Use d_sh_empl as outcome
* (1) OLS AKM cluster
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
* (2) OLS AKM0 cluster
use "data/ADH_derived.dta", clear
reg_ss d_sh_empl, shiftshare_var(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0) path_cluster("data/sector_derived.dta") cluster_var(sec_3d)
* (3) IV AKM cluster
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(1) beta0(0) path_cluster("data/sector_derived.dta") cluster_var(sec_3d) firststage(1)
* (4) IV AKM0 cluster
use "data/ADH_derived.dta", clear
ivreg_ss d_sh_empl, endogenous_var(d_tradeusch_pw) shiftshare_iv(d_tradeotch_pw_lag) ///
control_varlist(t2 l_shind_manuf_cbp reg_encen reg_escen reg_midatl reg_mount reg_pacif reg_satl reg_wncen reg_wscen l_sh_popedu_c l_sh_popfborn l_sh_empl_f l_sh_routine33 l_task_outsource) ///
share_varlist(emp_share1-emp_share770) weight_var(weight) alpha(0.05) akmtype(0) beta0(0) path_cluster("data/sector_derived.dta") cluster_var(sec_3d) firststage(1)
end
cap log close
main