-
Notifications
You must be signed in to change notification settings - Fork 1
/
Figure7_Event_Study.do
408 lines (347 loc) · 10.7 KB
/
Figure7_Event_Study.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
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
* This do file replicates Figure 7 in Serrato & Zidar (2018).
* Author: Ian Ho
* Date: Nov 16, 2023
* Stata Version: 18
clear all
********************************************************************************
**# Data Wrangling
********************************************************************************
use "Data/state_taxes_analysis.dta", clear
* Keep only 50 states in 1980-2010
drop if fips_state == 0 | fips_state == 11 | fips_state > 56
keep if inrange(year, 1980, 2010)
* Generate outcome variables
gen log_rev_corptax = 100*ln(rev_corptax)
gen log_gdp = 100*ln(GDP)
gen r_g = 100*rev_corptax/GDP
* Indicate rate changes with a threshold (i.e., 0.5)
xtset fips_state year
gen ch_corporate_rate = corporate_rate - L1.corporate_rate
replace ch_corporate_rate = 0 if abs(ch_corporate_rate) <= 0.5
gen ch_corporate_rate_ind = (ch_corporate_rate != 0 & !missing(ch_corporate_rate))
gen ch_corporate_rate_inc = (ch_corporate_rate > 0 & !missing(ch_corporate_rate))
gen ch_corporate_rate_dec = (ch_corporate_rate < 0)
* Select control variables
local baserules = "FederalIncomeasStateTaxBase sales_wgt throwback FedIncomeTaxDeductible Losscarryforward FranchiseTax"
foreach var in `baserules' {
gen abs_`var' = abs(`var' - L1.`var')
gen ch_`var' = (abs_`var' != 0 & abs_`var'!=.)
drop abs_`var'
}
tempfile dataset
save `dataset', replace
********************************************************************************
**# Impacts of Decrease in Corporate Rate
********************************************************************************
use `dataset', clear
* Set up event
g e = year if ch_corporate_rate_dec == 1
sum year
scalar years = `r(max)' - `r(min)' + 1
* Determine the event time for each observation
** Fill up
local i = 0
while `i' < years {
qui replace e = e[_n+1] if fips_state == fips_state[_n+1] & abs(year - e[_n+1]) < abs(year - e)
local ++i
}
** Fill down
local i = 0
while `i' < years {
qui replace e = e[_n-1] if fips_state == fips_state[_n-1] & abs(year - e[_n-1]) < abs(year - e)
local ++i
}
* Generate relative time dummies
gen Dn5 = year<=e-5
gen Dn4 = year==e-4
gen Dn3 = year==e-3
gen Dn2 = year==e-2
gen D0 = year==e
gen D1 = year==e+1
gen D2 = year==e+2
gen D3 = year==e+3
gen D4 = year==e+4
gen D5 = year==e+5
gen D6 = year>=e+6
* Generate adjusted control variables
local controls = "FederalIncomeasStateTaxBase sales_wgt throwback FedIncomeTaxDeductible Losscarryforward FranchiseTax"
local x = 1
foreach control in `controls' {
g temp_e = year if ch_`control' != 0
* Fill up
local i = 0
while `i' < years {
qui replace temp_e = temp_e[_n+1] if fips_state == fips_state[_n+1] & abs(year - temp_e[_n+1]) < abs(year - temp_e)
local ++i
}
* Fill down
local i = 0
while `i' < years {
qui replace temp_e = temp_e[_n-1] if fips_state == fips_state[_n-1] & abs(year - temp_e[_n-1]) < abs(year - temp_e)
local ++i
}
* Generate variables
g control`x' = year <= temp_e-5
local ++x
g control`x' = year == temp_e-4
local ++x
g control`x' = year == temp_e-3
local ++x
g control`x' = year == temp_e-2
local ++x
g control`x' = year == temp_e
local ++x
g control`x' = year == temp_e+1
local ++x
g control`x' = year == temp_e+2
local ++x
g control`x' = year == temp_e+3
local ++x
g control`x' = year == temp_e+4
local ++x
g control`x' = year == temp_e+5
local ++x
g control`x' = year >= temp_e+6
local ++x
drop temp_e
}
* Run regressions
local ylist = "r_g log_rev_corptax log_gdp"
foreach y in `ylist' {
* No controls
qui areg `y' Dn5-D6 i.fips_state, absorb(year) cluster(fips_state)
preserve
regsave
drop if substr(var,1,1) != "D"
drop N r2
export delimited "Figures/dec_`y'.csv", replace
restore
* With controls
qui areg `y' Dn5-D6 control* i.fips_state, absorb(year) cluster(fips_state)
preserve
regsave
drop if substr(var,1,1) != "D"
drop N r2
export delimited "Figures/dec_`y'_control.csv", replace
restore
}
* Visualization
foreach y in `ylist' {
* Construct a dataset for plotting
import delim "Figures/dec_`y'.csv", clear
rename (coef stderr) (b1 se1)
gen t = 95 + _n
replace t = t+1 if t>=100
set obs 12
replace t = 100 in 12
replace b1 = 0 in 12
replace se1 = 0 in 12
sort t
tempfile data
save `data', replace
import delim "Figures/dec_`y'_control.csv", clear
rename (coef stderr) (b2 se2)
gen t = 94.85 + _n
replace t = t+1 if t>99.8
set obs 12
replace t=99.85 in 12
replace b2=0 in 12
replace se2=0 in 12
sort t
merge 1:1 t using `data', nogen
gen fig_upper1 = b1+1.96*se1
gen fig_lower1 = b1-1.96*se1
gen fig_upper2 = b2+1.96*se2
gen fig_lower2 = b2-1.96*se2
gen fig_t = t-101
rename b1 fig_b1
rename b2 fig_b2
* Plot
if "`y'" == "r_g" {
local panel = "A"
local rawti = "Corp Tax Revenue Share of GDP"
local yti = "Percentage points"
}
if "`y'" == "log_rev_corptax" {
local panel = "B"
local rawti = "Log Corporate Tax Revenue"
local yti = "Percent"
}
if "`y'" == "log_gdp" {
local panel = "C"
local rawti = "Log State GDP"
local yti = "Percent"
}
twoway (scatter fig_b1 fig_t if fig_t<=5 & fig_t>-5, c(l) lc(dknavy) mc(dknavy) msymbol(smtriangle)) ///
(rcap fig_upper1 fig_lower1 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(solid) lc(dknavy)) ///
(scatter fig_b2 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(dash) lc(maroon) mc(maroon) msymbol(smdiamond)) ///
(rcap fig_upper2 fig_lower2 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(dash) lc(maroon)), ///
xline(0, lc(gs11) lp(shortdash)) ///
yline(0, lc(gs11) lp(shortdash)) ///
title("`panel') `rawti'", size(medium)) ///
xtitle("Years since decrease in corprate rate", size(medsmall)) ///
ytitle("`yti'", size(medsmall)) ///
xlab(-4(1)5, nogrid) ///
legend(label(1 "No Tax Base Controls") label(2 "95% CI") label(3 "Tax Base Controls") label(4 "95% CI") rows(2) position(6) span region(lc(black))) ///
name(panel`panel', replace)
}
********************************************************************************
**# Impacts of Increase in Corporate Rate
********************************************************************************
use `dataset', clear
* Set up event
g e = year if ch_corporate_rate_inc == 1 // this is the only difference from the above
sum year
scalar years = `r(max)' - `r(min)' + 1
* Determine the event time for each observation
** Fill up
local i = 0
while `i' < years {
qui replace e = e[_n+1] if fips_state == fips_state[_n+1] & abs(year - e[_n+1]) < abs(year - e)
local ++i
}
** Fill down
local i = 0
while `i' < years {
qui replace e = e[_n-1] if fips_state == fips_state[_n-1] & abs(year - e[_n-1]) < abs(year - e)
local ++i
}
* Generate relative time dummies
gen Dn5 = year<=e-5
gen Dn4 = year==e-4
gen Dn3 = year==e-3
gen Dn2 = year==e-2
gen D0 = year==e
gen D1 = year==e+1
gen D2 = year==e+2
gen D3 = year==e+3
gen D4 = year==e+4
gen D5 = year==e+5
gen D6 = year>=e+6
* Generate adjusted control variables
local controls = "FederalIncomeasStateTaxBase sales_wgt throwback FedIncomeTaxDeductible Losscarryforward FranchiseTax"
local x = 1
foreach control in `controls' {
g temp_e = year if ch_`control' != 0
* Fill up
local i = 0
while `i' < years {
qui replace temp_e = temp_e[_n+1] if fips_state == fips_state[_n+1] & abs(year - temp_e[_n+1]) < abs(year - temp_e)
local ++i
}
* Fill down
local i = 0
while `i' < years {
qui replace temp_e = temp_e[_n-1] if fips_state == fips_state[_n-1] & abs(year - temp_e[_n-1]) < abs(year - temp_e)
local ++i
}
* Generate variables
g control`x' = year <= temp_e-5
local ++x
g control`x' = year == temp_e-4
local ++x
g control`x' = year == temp_e-3
local ++x
g control`x' = year == temp_e-2
local ++x
g control`x' = year == temp_e
local ++x
g control`x' = year == temp_e+1
local ++x
g control`x' = year == temp_e+2
local ++x
g control`x' = year == temp_e+3
local ++x
g control`x' = year == temp_e+4
local ++x
g control`x' = year == temp_e+5
local ++x
g control`x' = year >= temp_e+6
local ++x
drop temp_e
}
* Run regressions
local ylist = "r_g log_rev_corptax log_gdp"
foreach y in `ylist' {
* No controls
qui areg `y' Dn5-D6 i.fips_state, absorb(year) cluster(fips_state)
preserve
regsave
drop if substr(var,1,1) != "D"
drop N r2
export delimited "Figures/inc_`y'.csv", replace
restore
* With controls
qui areg `y' Dn5-D6 control* i.fips_state, absorb(year) cluster(fips_state)
preserve
regsave
drop if substr(var,1,1) != "D"
drop N r2
export delimited "Figures/inc_`y'_control.csv", replace
restore
}
* Visualization
foreach y in `ylist' {
* Construct a dataset for plotting
import delim "Figures/inc_`y'.csv", clear
rename (coef stderr) (b1 se1)
gen t = 95 + _n
replace t = t+1 if t>=100
set obs 12
replace t = 100 in 12
replace b1 = 0 in 12
replace se1 = 0 in 12
sort t
tempfile data
save `data', replace
import delim "Figures/inc_`y'_control.csv", clear
rename (coef stderr) (b2 se2)
gen t = 94.85 + _n
replace t = t+1 if t>99.8
set obs 12
replace t=99.85 in 12
replace b2=0 in 12
replace se2=0 in 12
sort t
merge 1:1 t using `data', nogen
gen fig_upper1 = b1+1.96*se1
gen fig_lower1 = b1-1.96*se1
gen fig_upper2 = b2+1.96*se2
gen fig_lower2 = b2-1.96*se2
gen fig_t = t-101
rename b1 fig_b1
rename b2 fig_b2
* Plot
if "`y'" == "r_g" {
local panel = "D"
local rawti = "Corp Tax Revenue Share of GDP"
local yti = "Percentage points"
}
if "`y'" == "log_rev_corptax" {
local panel = "E"
local rawti = "Log Corporate Tax Revenue"
local yti = "Percent"
}
if "`y'" == "log_gdp" {
local panel = "F"
local rawti = "Log State GDP"
local yti = "Percent"
}
twoway (scatter fig_b1 fig_t if fig_t<=5 & fig_t>-5, c(l) lc(dknavy) mc(dknavy) msymbol(smtriangle)) ///
(rcap fig_upper1 fig_lower1 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(solid) lc(dknavy)) ///
(scatter fig_b2 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(dash) lc(maroon) mc(maroon) msymbol(smdiamond)) ///
(rcap fig_upper2 fig_lower2 fig_t if fig_t<=5 & fig_t>-5, c(l) lpattern(dash) lc(maroon)), ///
xline(0, lc(gs11) lp(shortdash)) ///
yline(0, lc(gs11) lp(shortdash)) ///
title("`panel') `rawti'", size(medium)) ///
xtitle("Years since increase in corprate rate", size(medsmall)) ///
ytitle("`yti'", size(medsmall)) ///
xlab(-4(1)5, nogrid) ///
legend(label(1 "No Tax Base Controls") label(2 "95% CI") label(3 "Tax Base Controls") label(4 "95% CI") rows(2) position(6) span region(lc(black))) ///
name(panel`panel', replace)
}
********************************************************************************
**# Combine Graphs and Export
********************************************************************************
grc1leg panelA panelB panelC panelD panelE panelF, col(3) iscale(0.6)
graph export "Figures/Figure7.svg", replace