-
Notifications
You must be signed in to change notification settings - Fork 1
/
Table1_Summary_Stats.do
267 lines (234 loc) · 8.39 KB
/
Table1_Summary_Stats.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
* This do file replicates Table 1 in Serrato & Zidar (2018).
* Author: Ian Ho
* Date: Nov 15, 2023
clear all
********************************************************************************
**# Clean Data
********************************************************************************
use "Data/state_taxes_analysis.dta", clear
* Keep only 50 states in 1980-2010
drop if fips==11 | fips==0 | fips>56
keep if inrange(year, 1980, 2010)
* Generate corporate tax revenue as share of GDP
gen r_gdp = (rev_corptax)/GDP*100
local sumlist = "r_gdp throwback combined investment_credit rec_val Losscarryback Losscarryforward FranchiseTax FedIncomeTaxDeductible FederalIncomeasStateTaxBase AllowFedAccDep ACRSDepreciation FederalBonusDepreciation sales_wgt incr_fixed incr_ma"
********************************************************************************
**# Summary Statistics: 1980-2010 Pooled Sample
********************************************************************************
preserve
foreach var in `sumlist'{
qui{
sum `var'
local num_`var' = `r(N)'
local m_`var' = `r(mean)'
local sd_`var' = `r(sd)'
if inlist("`var'", "investment_credit", "rec_val") {
local m_`var' = 100*`r(mean)'
local sd_`var' = 100*`r(sd)'
}
}
}
* Customize labels
g labels = ""
local row = 1
replace labels = "Corp Tax Revenue as Share of GDP (\%)" in `row'
local ++row
replace labels = "Throwback Rules" in `row'
local ++row
replace labels = "Combined Reporting" in `row'
local ++row
replace labels = "Investment Tax Credit" in `row'
local ++row
replace labels = "R\&D Tax Credit" in `row'
local ++row
replace labels = "Loss Carryback Rules" in `row'
local ++row
replace labels = "Loss Carryforward Rules" in `row'
local ++row
replace labels = "Franchise Tax" in `row'
local ++row
replace labels = "Fed Income Tax Deductible" in `row'
local ++row
replace labels = "Fed Income as State Tax Base" in `row'
local ++row
replace labels = "Fed Accelerated Depreciation" in `row'
local ++row
replace labels = "ACRS Depreciation" in `row'
local ++row
replace labels = "Federal Bonus Depreciation" in `row'
local ++row
replace labels = "Sales Apportionment Weight" in `row'
local ++row
replace labels = "Incremental R\&D Credit, Base is Fixed" in `row'
local ++row
replace labels = "Incremental R\&D Credit, Base is Moving Average" in `row'
local ++row
* Store summary statistics in table format
foreach var in num m sd{
qui{
local row = 1
if "`var'"=="num" {
local decimal = 0
}
else{
local decimal = 3
}
g `var' = ""
replace `var' = string(``var'_r_gdp', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_throwback', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_combined', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_investment_credit', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_rec_val', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_Losscarryback', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_Losscarryforward', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FranchiseTax', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FedIncomeTaxDeductible', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FederalIncomeasStateTaxBase', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_AllowFedAccDep', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_ACRSDepreciation', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FederalBonusDepreciation', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_sales_wgt', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_incr_fixed', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_incr_ma', "%12.`decimal'f") in `row'
local ++row
}
}
* Export as a TeX file
g tab = "\begin{tabular}{l*{3}{c}}" in 1
g titlerow = " & Observations & Mean & Std. Dev." in 1
g panelA = "\multicolumn{4}{l}{\textit{Panel A. 1980-2010 Pooled Sample}}" in 1
g hline = "\hline" in 1
g end = "\end{tabular}" in 1
listtex tab if _n == 1 using "Tables/Table1.tex", replace
listtex hline if _n == 1, appendto("Tables/Table1.tex")
listtex hline if _n == 1, appendto("Tables/Table1.tex")
listtex titlerow if _n==1, appendto("Tables/Table1.tex") rstyle(tabular)
listtex hline if _n == 1, appendto("Tables/Table1.tex")
listtex panelA if _n==1, appendto("Tables/Table1.tex") rstyle(tabular)
listtex labels num m sd if _n<=16, appendto("Tables/Table1.tex") rstyle(tabular)
listtex labels num m sd if _n==18, appendto("Tables/Table1.tex") rstyle(tabular)
restore
********************************************************************************
**# Summary Statistics: 2010 Cross Section
********************************************************************************
preserve
keep if year==2010
foreach var in `sumlist'{
qui{
sum `var'
local num_`var' = `r(N)'
local m_`var' = `r(mean)'
local sd_`var' = `r(sd)'
if inlist("`var'", "investment_credit", "rec_val") {
local m_`var' = 100*`r(mean)'
local sd_`var' = 100*`r(sd)'
}
}
}
* Customize labels
g labels = ""
local row = 1
replace labels = "Corp Tax Revenue as Share of GDP (\%)" in `row'
local ++row
replace labels = "Throwback Rules" in `row'
local ++row
replace labels = "Combined Reporting" in `row'
local ++row
replace labels = "Investment Tax Credit" in `row'
local ++row
replace labels = "R\&D Tax Credit" in `row'
local ++row
replace labels = "Loss Carryback Rules" in `row'
local ++row
replace labels = "Loss Carryforward Rules" in `row'
local ++row
replace labels = "Franchise Tax" in `row'
local ++row
replace labels = "Fed Income Tax Deductible" in `row'
local ++row
replace labels = "Fed Income as State Tax Base" in `row'
local ++row
replace labels = "Fed Accelerated Depreciation" in `row'
local ++row
replace labels = "ACRS Depreciation" in `row'
local ++row
replace labels = "Federal Bonus Depreciation" in `row'
local ++row
replace labels = "Sales Apportionment Weight" in `row'
local ++row
replace labels = "Incremental R\&D Credit, Base is Fixed" in `row'
local ++row
replace labels = "Incremental R\&D Credit, Base is Moving Average" in `row'
local ++row
* Store summary statistics in table format
foreach var in num m sd{
qui{
local row = 1
if "`var'"=="num" {
local decimal = 0
}
else{
local decimal = 3
}
g `var' = ""
replace `var' = string(``var'_r_gdp', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_throwback', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_combined', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_investment_credit', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_rec_val', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_Losscarryback', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_Losscarryforward', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FranchiseTax', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FedIncomeTaxDeductible', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FederalIncomeasStateTaxBase', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_AllowFedAccDep', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_ACRSDepreciation', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_FederalBonusDepreciation', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_sales_wgt', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_incr_fixed', "%12.`decimal'f") in `row'
local ++row
replace `var' = string(``var'_incr_ma', "%12.`decimal'f") in `row'
local ++row
}
}
* Export as a TeX file
g tab = "\begin{tabular}{l*{3}{c}}" in 1
g titlerow = " & Observations & Mean & Std. Dev." in 1
g panelB = "\multicolumn{4}{l}{\textit{Panel B. 2010 Cross Section}}" in 1
g hline = "\hline" in 1
g end = "\end{tabular}" in 1
listtex panelB if _n==1, appendto("Tables/Table1.tex") rstyle(tabular)
listtex labels num m sd if _n<=16, appendto("Tables/Table1.tex") rstyle(tabular)
listtex hline if _n == 1, appendto("Tables/Table1.tex")
listtex hline if _n == 1, appendto("Tables/Table1.tex")
listtex end if _n == 1, appendto("Tables/Table1.tex")
restore