-
Notifications
You must be signed in to change notification settings - Fork 0
/
Final Regressions.do
265 lines (191 loc) · 12.1 KB
/
Final Regressions.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
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
// Final LPM Regressions //
** Load Data **
import excel "\Users\averyatencio\Documents\Master's Thesis\Thesis\Code and Excel\final.xlsx", sheet("Sheet 1") firstrow clear
** Generate Relevant Variables **
encode State, gen(state)
encode County, gen(county)
gen FORk = FOR/100000
gen popdenk = PopDen/100000
gen loginc = ln(HH_Income)
gen exposurek = exposure/100000
gen povertyk = Poverty/100000
gen TAAk = TAA/100000
* Generate percentile ranks
xtile percentile = exposure, nquantiles(4)
* Create categorical variable based on percentiles
generate exposurep = .
replace exposurep = 1 if percentile == 1
replace exposurep = 2 if percentile == 2
replace exposurep = 3 if percentile == 3
replace exposurep = 4 if percentile == 4
xtile percentile1 = exposure_est, nquantiles(4)
generate exposurep1 = .
replace exposurep1 = 1 if percentile1 == 1
replace exposurep1 = 2 if percentile1 == 2
replace exposurep1 = 3 if percentile1 == 3
replace exposurep1 = 4 if percentile1 == 4
gen exposure_med = .
replace exposure_med = 0 if percentile <= 2
replace exposure_med = 1 if percentile > 2
duplicates list Year county_fips
***************************************************************************
**************************** // Baseline Regressions // *******************
***************************************************************************
** Original LPM **
reg shoot_count exposure_est i.Year
reg shoot exposure prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Baseline LPM.doc", replace title("Baseline LPM") keep ( exposure prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "No", "State FE", "No", "County FE", "No")
** Correlation **
* Poverty *
* no controls
reg Percent_Poverty exposure if Year >= 2001, r
outreg2 using "Associations.doc", replace title("Associations") label addtext("Controls", "No")
* controls
reg Percent_Poverty exposure FORk Law_Rank popdenk if Year >= 2001, t
outreg2 using "Associations.doc", append title("Associations") label addtext("Controls", "Yes")
* Inequality *
* no controls
reg gini exposure, r
outreg2 using "Associations.doc", append title("Associations") label addtext("Controls", "No")
*controls
reg gini exposure FORk Law_Rank popdenk, r
outreg2 using "Associations.doc", append title("Associations") label addtext("Controls", "Yes")
* Suicides *
* no controls *
reg Suicide_Est_Rate exposure if Year >= 2001, r
outreg2 using "Associations death.doc", replace title("Associations") label addtext("Controls", "No")
*controls *
reg Suicide_Est_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Associations death.doc", append title("Associations") label addtext("Controls", "Yes")
* Opioid Deaths *
* no controls
reg Deaths_Est_Rate exposure if Year >= 2001, r
outreg2 using "Associations death.doc", append title("Associations") label addtext("Controls", "No")
* controls
reg Deaths_Est_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Associations death.doc", append title("Associations") label addtext("Controls", "Yes")
** Associations with shoot **
reg shoot Percent_Poverty prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Association LPM.doc", replace title("LPM with factors") label addtext("Controls", "Yes")
reg shoot gini prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Association LPM.doc", append title("LPM with factors") label addtext("Controls", "Yes")
reg shoot Deaths_Est_Rate prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Association LPM.doc", append title("LPM with factors") label addtext("Controls", "Yes")
reg shoot Suicide_Est_Rate prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "Association LPM.doc", append title("LPM with factors") label addtext("Controls", "Yes")
****************************************************************************
*************************** // Robustness Checks // ************************
************************** // Baseline Regressions //***********************
****************************************************************************
** LPM with Year FE **
reg shoot exposure prevshoot FORk Law_Rank popdenk i.Year if Year >= 2001, r
outreg2 using "Baseline LPM.doc", append title("Baseline LPM") keep ( exposure prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "No", "County FE", "No")
** LPM with State FE **
reg shoot exposure prevshoot FORk Law_Rank popdenk i.state i.Year if Year >= 2001, r
outreg2 using "Baseline LPM.doc", append title("Baseline LPM") keep ( exposure prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "Yes", "County FE", "No")
** LPM with County FE **
reghdfe shoot exposure prevshoot FORk Law_Rank popdenk if Year >= 2001, absorb(county_fips Year)
outreg2 using "Baseline LPM.doc", append title("Baseline LPM") keep ( exposure prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "No", "County FE", "Yes ")
****************************************************************************
*************************** // Robustness Checks // ************************
************************** // 1990-2022 Regressions //**********************
****************************************************************************
** Baseline LPM **
reg shoot exposure_est prevshoot FORk Law_Rank popdenk, r
outreg2 using "LPM.doc", replace title("1990-2022 LPM") keep ( exposure_est prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "No", "State FE", "No", "County FE", "No")
** LPM with Year FE **
reg shoot exposure_est prevshoot FORk Law_Rank popdenk i.Year, r
outreg2 using "LPM.doc", append title("1990-2022 LPM") keep ( exposure_est prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "No", "County FE", "No")
** LPM with State FE **
reg shoot exposure_est prevshoot FORk Law_Rank popdenk i.state i.Year, r
outreg2 using "LPM.doc", append title("1990-2022 LPM") keep ( exposure_est prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "Yes", "County FE", "No")
** LPM with County FE **
reghdfe shoot exposure_est prevshoot FORk Law_Rank popdenk, absorb(county_fips Year)
outreg2 using "LPM.doc", append title("1990-2022 LPM") keep ( exposure_est prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes", "State FE", "No", "County FE", "Yes ")
****************************************************************************
*************************** // Robustness Checks // ************************
****************************** // Further RC //*****************************
****************************************************************************
** Original LPM with percentiles **
reg shoot i.exposurep1 prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "RC.doc", replace title("RC LPM") keep (i.exposurep1 prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "No")
reg shoot i.exposurep1 prevshoot FORk Law_Rank popdenk i.Year if Year >= 2001, r
outreg2 using "RC.doc", append title("RC LPM") keep (i.exposurep1 prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes")
** Original LPM with median **
reg shoot exposure_med prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "RC.doc", append title("RC LPM") keep (exposure_med prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "No")
reg shoot exposure_med prevshoot FORk Law_Rank popdenk i.Year if Year >= 2001, r
outreg2 using "RC.doc", append title("RC LPM") keep (exposure_med prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes", "Year FE", "Yes")
** LPM with anyshoot == 1 **
reg shoot exposure prevshoot FORk Law_Rank popdenk if Year >= 2001 & anyshoot == 1
outreg2 using "RC.doc", append title("RC LPM") keep (exposure prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes")
********************************************************************************
******************************* Further Analysis *******************************
********************************************************************************
* no controls *
reg shoot exposure TAA_total if Year >= 2009, r
outreg2 using "TAA.doc", replace title("TAA LPM") keep (exposure TAAk) label addtext("Controls", "No")
* controls *
reg shoot exposure TAAk prevshoot FORk Law_Rank popdenk if Year >= 2009, r
outreg2 using "TAA.doc", append title("TAA LPM") keep (exposure TAAk prevshoot FORk Law_Rank popdenk) label addtext("Controls", "Yes")
* associations
reg Percent_Poverty TAAk if Year >= 2009, r
outreg2 using "TAA1.doc", replace title("TAA LPM") label addtext("Controls", "No")
reg gini TAAk i.Year if Year >= 2009, r
outreg2 using "TAA1.doc", append title("TAA LPM") label addtext("Controls", "No")
reg Deaths_Est_Rate TAAk if Year >= 2009, r
outreg2 using "TAA1.doc", append title("TAA LPM") label addtext("Controls", "No")
reg Suicide_Est_Rate TAAk if Year >= 2009, r
outreg2 using "TAA1.doc", append title("TAA LPM") label addtext("Controls", "No")
*Voting*
*no controls
reg class exposure, r
outreg2 using "voting.doc", replace title("voting") label addtext("Controls", "No")
reg class exposure FORk Law_Rank popdenk, r
outreg2 using "voting.doc", append title("voting") label addtext("Controls", "Yes")
* TAA assocations *
reg class TAAk if Year >= 2009, r
outreg2 using "voting TAA.doc", replace title("voting") label addtext("Controls", "No")
reg class TAAk FORk Law_Rank popdenk if Year >= 2009, r
outreg2 using "voting TAA.doc", append title("voting") label addtext("Controls", "Yes")
*******************************************************************************
******************************** Deaths RC Baseline ****************************
*******************************************************************************
** Opioid Deaths **
** Max Estimate **
reg Death_Max_Rate exposure if Year >= 2001, r
outreg2 using "opioid RC.doc", replace title("Opioid RC") label addtext("Controls Check", "No")
** Max Estimate with controls **
reg Death_Max_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "opioid RC.doc", append title("Opioid RC") label addtext("Controls Check", "Yes")
** Min Estimate **
reg Death_Min_Rate exposure if Year >= 2001, r
outreg2 using "opioid RC.doc", append title("Opioid RC") label addtext("Controls Check", "No")
** Min Estimate with controls **
reg Death_Min_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "opioid RC.doc", append title("Opioid RC") label addtext("Controls Check", "Yes")
** Suicides **
* Max Estimate *
reg Suicide_Max_Rate exposure if Year >= 2001, r
outreg2 using "suicide RC.doc", replace title("Opioid RC") label addtext("Controls Check", "No")
** Max Estimate with controls **
reg Suicide_Max_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "suicide RC.doc", append title("Opioid RC") label addtext("Controls Check", "Yes")
* Min Estimate *
reg Suicide_Min_Rate exposure if Year >= 2001. r
outreg2 using "suicide RC.doc", append title("Opioid RC") label addtext("Controls Check", "No")
** Min Estimate with controls **
reg Suicide_Min_Rate exposure FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "suicide RC.doc", append title("Opioid RC") label addtext("Controls Check", "Yes")
********************************************************************************
****************************** Casualties **************************************
********************************************************************************
* Causualties *
reg casualties exposure if Year >= 2001, r
outreg2 using "causaulties.doc", replace title("table 7") label addtext("Controls", "No")
reg casualties exposure prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "causualties.doc", append title("table 7") label addtext("Controls", "Yes")
poisson casualties exposure if Year >= 2001, r
outreg2 using "causualties.doc", append title("table 7") label addtext("Controls", "No")
poisson casualties exposure prevshoot FORk Law_Rank popdenk if Year >= 2001, r
outreg2 using "causualties.doc", append title("table 7") label addtext("Controls", "Yes")