Commit
·
3403298
1
Parent(s):
39a18a8
add 39
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- 39/paper.pdf +3 -0
- 39/replication_package/Do/Appendix.do +38 -0
- 39/replication_package/Do/Figure1.do +40 -0
- 39/replication_package/Do/Figure2.do +142 -0
- 39/replication_package/Do/FigureA1.do +166 -0
- 39/replication_package/Do/FigureA10.do +603 -0
- 39/replication_package/Do/FigureA11.do +527 -0
- 39/replication_package/Do/FigureA12.do +53 -0
- 39/replication_package/Do/FigureA13.do +954 -0
- 39/replication_package/Do/FigureA2.do +133 -0
- 39/replication_package/Do/FigureA3.do +87 -0
- 39/replication_package/Do/FigureA4.do +69 -0
- 39/replication_package/Do/FigureA5.do +120 -0
- 39/replication_package/Do/FigureA6.do +87 -0
- 39/replication_package/Do/FigureA7.do +437 -0
- 39/replication_package/Do/FigureA8.do +389 -0
- 39/replication_package/Do/FigureA9.do +600 -0
- 39/replication_package/Do/Main.do +22 -0
- 39/replication_package/Do/Table1.do +29 -0
- 39/replication_package/Do/Table2.do +56 -0
- 39/replication_package/Do/Table3.do +33 -0
- 39/replication_package/Do/Table4.do +25 -0
- 39/replication_package/Do/Table5.do +23 -0
- 39/replication_package/Do/Table6.do +93 -0
- 39/replication_package/Do/Table7.do +1170 -0
- 39/replication_package/Do/TableA1.do +9 -0
- 39/replication_package/Do/TableA10.do +21 -0
- 39/replication_package/Do/TableA11.do +41 -0
- 39/replication_package/Do/TableA12.do +96 -0
- 39/replication_package/Do/TableA13.do +18 -0
- 39/replication_package/Do/TableA2.do +33 -0
- 39/replication_package/Do/TableA3.do +78 -0
- 39/replication_package/Do/TableA4.do +27 -0
- 39/replication_package/Do/TableA5.do +22 -0
- 39/replication_package/Do/TableA6.do +103 -0
- 39/replication_package/Do/TableA7.do +11 -0
- 39/replication_package/Do/TableA8.do +86 -0
- 39/replication_package/Do/TableA9.do +17 -0
- 39/replication_package/Do/preparing_abrahamsun.do +2845 -0
- 39/replication_package/Do/preparing_abrahamsun_es.do +3168 -0
- 39/replication_package/Readme.pdf +3 -0
- 39/replication_package/data/allcandidates_rallies.dta +3 -0
- 39/replication_package/data/allcandidates_words.dta +3 -0
- 39/replication_package/data/blm.dta +3 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.cpg +1 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.dbf +3 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.prj +1 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp +3 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp.ea.iso.xml +404 -0
- 39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp.iso.xml +539 -0
39/paper.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:aafb2d39f391bab3089a8e02d16c4661a689243939626b446abbc6d8b0c0d355
|
3 |
+
size 548612
|
39/replication_package/Do/Appendix.do
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**********************************************************************
|
2 |
+
*** Replication File for "Inflammatory Political Campaigns and
|
3 |
+
*** Racial Bias in Policing" by Pauline Grosjean, Federico Masera, and
|
4 |
+
*** Hasin Yousaf. For Publication at The Quarterly Journal of Economics
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
*** Define your own course directory.
|
8 |
+
set more off
|
9 |
+
cd "SET YOUR OWN PATH"
|
10 |
+
|
11 |
+
do "Do\TableA1.do"
|
12 |
+
do "Do\TableA2.do"
|
13 |
+
do "Do\TableA3.do"
|
14 |
+
do "Do\TableA4.do"
|
15 |
+
do "Do\TableA5.do"
|
16 |
+
do "Do\TableA6.do"
|
17 |
+
do "Do\TableA7.do"
|
18 |
+
do "Do\TableA8.do"
|
19 |
+
do "Do\TableA9.do"
|
20 |
+
do "Do\TableA10.do"
|
21 |
+
do "Do\TableA11.do"
|
22 |
+
do "Do\TableA12.do"
|
23 |
+
do "Do\TableA13.do"
|
24 |
+
|
25 |
+
|
26 |
+
do "Do\FigureA1.do"
|
27 |
+
do "Do\FigureA2.do"
|
28 |
+
do "Do\FigureA3.do"
|
29 |
+
do "Do\FigureA4.do"
|
30 |
+
do "Do\FigureA5.do"
|
31 |
+
do "Do\FigureA6.do"
|
32 |
+
do "Do\FigureA7.do"
|
33 |
+
do "Do\FigureA8.do"
|
34 |
+
do "Do\FigureA9.do"
|
35 |
+
do "Do\FigureA10.do"
|
36 |
+
do "Do\FigureA11.do"
|
37 |
+
do "Do\FigureA12.do"
|
38 |
+
do "Do\FigureA13.do"
|
39/replication_package/Do/Figure1.do
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE 1
|
4 |
+
*** Counties with Campaign Events and Police Stops
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
shp2dta using "Data\county shapefile\cb_2016_us_county_500k", replace data("Data\county shapefile\county_data") coor("Data\county shapefile\county_coordinates")
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
collapse trumpcounties, by(county_fips)
|
11 |
+
g stopsdata=1
|
12 |
+
|
13 |
+
merge n:1 county_fips using "Data\allcandidates_rallies.dta"
|
14 |
+
drop _merge
|
15 |
+
replace stopsdata=0 if stopsdata==.
|
16 |
+
replace trumpcounties=0 if trumpcounties==.
|
17 |
+
g stopsNtrump=(stopsdata==1 & trumpcounties==1)
|
18 |
+
g stopsNONtrump=(stopsdata==1 & trumpcounties==0)
|
19 |
+
g category=0 if stopsdata==0
|
20 |
+
replace category=1 if trumpcounties==1
|
21 |
+
replace category=2 if stopsNONtrump==1
|
22 |
+
g county_fips2=string(county_fips)
|
23 |
+
replace county_fips2="0"+county_fips2 if length(county_fips2)==4
|
24 |
+
drop if county_fips>72000
|
25 |
+
label define category 0 "Not In Sample" 1 "Stops Data with Trump Rally" 2 "Stops Data without Trump Rally", modify
|
26 |
+
|
27 |
+
g GEOID=string(county_fips)
|
28 |
+
replace GEOID="0"+GEOID if length(GEOID)==4
|
29 |
+
drop if county_fips>72000
|
30 |
+
merge 1:1 GEOID using "Data\county shapefile\county_data"
|
31 |
+
replace category=0 if _merge==2
|
32 |
+
*keep if _merge==3
|
33 |
+
drop if STATEFP=="02" | STATEFP=="15" | STATEFP=="72" | STATEFP=="60" | STATEFP=="66" | STATEFP=="69" | STATEFP=="78"
|
34 |
+
keep county_fips category GEOID GEOID2 _ID
|
35 |
+
|
36 |
+
label values category category
|
37 |
+
spmap category using "Data\county shapefile\county_coordinates", id(_ID) ///
|
38 |
+
clmethod(unique) fcolor(Greys) ocolor(Black) ///
|
39 |
+
legstyle(3) legend(ring(1) position(3)) ///
|
40 |
+
plotregion(margin(vlarge)) legenda(on) legtitle("Legend")
|
39/replication_package/Do/Figure2.do
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE 2
|
4 |
+
*** Impact of Trump Rallies on the Probability of a Black Stop: Event-study Results
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
global start = -105
|
8 |
+
global end = 105
|
9 |
+
global bin_l = 15
|
10 |
+
|
11 |
+
use "Data\stoplevel_data.dta", clear
|
12 |
+
|
13 |
+
g n_stops = 1
|
14 |
+
foreach var of varlist black hispanic white api {
|
15 |
+
replace `var' = `var'/100
|
16 |
+
}
|
17 |
+
|
18 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
19 |
+
|
20 |
+
g black_ps = 100*black / n_stops
|
21 |
+
g hispanic_ps = 100*hispanic / n_stops
|
22 |
+
g white_ps = 100*white / n_stops
|
23 |
+
g asian_ps = 100*api / n_stops
|
24 |
+
g ln_stops = ln(n_stops)
|
25 |
+
|
26 |
+
g TRUMP_0 = 0
|
27 |
+
forval ii = 1/9 {
|
28 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
29 |
+
}
|
30 |
+
|
31 |
+
forval ii = 1($bin_l)$end{
|
32 |
+
local jj = `ii' + $bin_l - 1
|
33 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
34 |
+
forval ee = 1/9 {
|
35 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
g TRUMP_POST_M$end = 0
|
40 |
+
forval ii = 1/9 {
|
41 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
42 |
+
}
|
43 |
+
|
44 |
+
forval ii = $start($bin_l)0 {
|
45 |
+
if `ii' < -$bin_l {
|
46 |
+
local jj = abs(`ii')
|
47 |
+
local zz = `jj' - $bin_l + 1
|
48 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
49 |
+
forval ee = 1/9 {
|
50 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
local jj = abs($start)
|
56 |
+
g TRUMP_PRE_M`jj' = 0
|
57 |
+
forval ii = 1/9 {
|
58 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
59 |
+
}
|
60 |
+
|
61 |
+
reghdfe black_ps 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
62 |
+
|
63 |
+
local temp = 1/$bin_l
|
64 |
+
local bin_neg = abs($start * `temp')
|
65 |
+
local bin_pos = $end * `temp'
|
66 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
67 |
+
|
68 |
+
mat treat = J(`range',4,1)
|
69 |
+
|
70 |
+
local Nrange = `range' - 2
|
71 |
+
|
72 |
+
forval pos = 1/`Nrange' {
|
73 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
74 |
+
if `lag' > 0 {
|
75 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
76 |
+
}
|
77 |
+
|
78 |
+
local num = abs(`lag')
|
79 |
+
|
80 |
+
if `lag' == 0 {
|
81 |
+
mat treat[`pos',1] = 0
|
82 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
83 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
84 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
85 |
+
}
|
86 |
+
else if `lag' < -$bin_l {
|
87 |
+
local num2 = `num' - $bin_l + 1
|
88 |
+
local num1 = - `num'
|
89 |
+
mat treat[`pos',1] = `num1'
|
90 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
91 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
92 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
93 |
+
}
|
94 |
+
else if `lag' == -$bin_l {
|
95 |
+
mat treat[`pos',1] = -$bin_l
|
96 |
+
mat treat[`pos',2] = 0
|
97 |
+
mat treat[`pos',3] = 0
|
98 |
+
mat treat[`pos',4] = 0
|
99 |
+
}
|
100 |
+
else {
|
101 |
+
di "**"
|
102 |
+
di `lag'
|
103 |
+
di `pos'
|
104 |
+
local num2 = `num' + $bin_l - 1
|
105 |
+
mat treat[`pos',1] = `num2'
|
106 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
107 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
108 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
109 |
+
}
|
110 |
+
}
|
111 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
112 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
113 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
114 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
115 |
+
|
116 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
117 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
118 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
119 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
120 |
+
|
121 |
+
g yy = treat[_n,1] in 1/`range'
|
122 |
+
g eff = treat[_n,2] in 1/`range'
|
123 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
124 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
125 |
+
sort yy
|
126 |
+
|
127 |
+
duplicates drop yy, force
|
128 |
+
keep eff eff_5 eff_95 yy
|
129 |
+
|
130 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-2(0.5)2) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Black Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
131 |
+
graph export "Results\Figure2.pdf", as(pdf) name("Graph") replace
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
+
|
136 |
+
|
137 |
+
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
|
142 |
+
|
39/replication_package/Do/FigureA1.do
ADDED
@@ -0,0 +1,166 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
use "Data\allcandidates_words.dta", clear
|
2 |
+
|
3 |
+
egen race2=rowtotal(racial race )
|
4 |
+
egen Race=rowtotal(race2 black african)
|
5 |
+
|
6 |
+
egen Crime2=rowtotal(crime crimin)
|
7 |
+
egen Crime=rowtotal(Crime2 drug rape)
|
8 |
+
egen Crime_strict=rowtotal(Crime2 rape)
|
9 |
+
gen Drug = drug
|
10 |
+
|
11 |
+
|
12 |
+
egen Terrorism =rowtotal(afghanistan iraq isi isis islam jihad syria syrian terror terrorist )
|
13 |
+
|
14 |
+
egen Business=rowtotal(busi businessman businessmen businesspeopl job tax manufactur manufacturing)
|
15 |
+
|
16 |
+
egen Corruption =rowtotal(rig cnn swamp media corrupt washington)
|
17 |
+
|
18 |
+
egen Trade =rowtotal(trade china nafta )
|
19 |
+
|
20 |
+
egen Mexico =rowtotal(mexican mexico )
|
21 |
+
|
22 |
+
egen OtherRace =rowtotal(gun prison riot thug urban )
|
23 |
+
|
24 |
+
egen Migration =rowtotal(migration migrat immigr migrat )
|
25 |
+
|
26 |
+
egen Police =rowtotal( polic policemen police )
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
egen Clinton = rowtotal (hilari hillari clinton email lock)
|
31 |
+
|
32 |
+
egen Implicit = rowtotal (crime crimin drug rape gun prison riot thug urban)
|
33 |
+
egen Allreferences=rowtotal(Implicit Race )
|
34 |
+
|
35 |
+
bysort candidate: su Allreferences Implicit Race Clinton Trade Terrorism Business Corruption
|
36 |
+
|
37 |
+
|
38 |
+
preserve
|
39 |
+
keep if candidate =="trump"
|
40 |
+
pwcorr Mexi Implicit
|
41 |
+
su Implicit if Mexic>0
|
42 |
+
su Implicit if Mexic==0
|
43 |
+
gen D_Mexico=(Mexic>0)
|
44 |
+
gen D_Implicit=(Implicit>0)
|
45 |
+
|
46 |
+
restore
|
47 |
+
|
48 |
+
|
49 |
+
foreach var of varlist Allreferences Implicit race2 Race Crime2 Crime Crime_strict Drug Terrorism Business Corruption Trade Mexico OtherRace Migration Police {
|
50 |
+
gen p`var'=(`var'/tot_words)*100
|
51 |
+
}
|
52 |
+
|
53 |
+
ren democrat democrat_trumpsp
|
54 |
+
|
55 |
+
gen democrat=.
|
56 |
+
replace democrat=0 if candidate == "mccain"|candidate == "romney"|candidate == "cruz" |candidate == "trump"
|
57 |
+
replace democrat=1 if candidate == "clinton"
|
58 |
+
|
59 |
+
|
60 |
+
gen pres_candidate_plot = .
|
61 |
+
replace pres_candidate_plot = 5 if candidate == "trump"
|
62 |
+
replace pres_candidate_plot = 4 if candidate == "cruz"
|
63 |
+
replace pres_candidate_plot = 3 if candidate == "clinton"
|
64 |
+
replace pres_candidate_plot = 2 if candidate == "romney"
|
65 |
+
replace pres_candidate_plot = 1 if candidate == "mccain"
|
66 |
+
|
67 |
+
label define pres_candidates 5 "Donald Trump (2016)" 4 "Ted Cruz (2016)" 3 "Hillary Clinton (2016)" 2 "Mitt Romney (2012)" 1 "John McCain (2008)"
|
68 |
+
|
69 |
+
cap drop coef* se*
|
70 |
+
cap drop u_coef* l_coef*
|
71 |
+
|
72 |
+
foreach x of varlist Allreferences Implicit race2 Race Crime2 Crime Crime_strict Drug Terrorism Business Corruption Trade Mexico OtherRace Migration Police {
|
73 |
+
|
74 |
+
bysort candidate: egen m`x'=mean(`x')
|
75 |
+
bysort candidate: egen sd`x'=sd(`x')
|
76 |
+
|
77 |
+
gen coef`x'=.
|
78 |
+
gen se`x'=.
|
79 |
+
|
80 |
+
bysort candidate: replace coef`x'=m`x'
|
81 |
+
}
|
82 |
+
|
83 |
+
foreach x of varlist Allreferences Implicit race2 Race Crime2 Crime Crime_strict Drug Terrorism Business Corruption Trade Mexico OtherRace Migration Police {
|
84 |
+
replace se`x'=(1.960*sd`x')/13.78 if candidate=="trump"
|
85 |
+
replace se`x'=(1.960*sd`x')/2.45 if candidate=="cruz"
|
86 |
+
replace se`x'=(1.960*sd`x')/13.93 if candidate=="clinton"
|
87 |
+
replace se`x'=(1.960*sd`x')/10.05 if candidate=="romney"
|
88 |
+
replace se`x'=(1.960*sd`x')/13.229 if candidate=="mccain"
|
89 |
+
}
|
90 |
+
|
91 |
+
collapse (mean) coef* democrat se*, by(pres_candidate_plot candidate)
|
92 |
+
|
93 |
+
foreach x in Allreferences Implicit race2 Race Crime2 Crime Crime_strict Drug Terrorism Business Corruption Trade Mexico OtherRace Migration Police {
|
94 |
+
*foreach x of varlist addict-weapon race2 race3 Race Crime Mexico Migration Crime2{
|
95 |
+
bysort candidate: gen u_coef`x' = coef`x' + se`x'
|
96 |
+
bysort candidate: gen l_coef`x' = coef`x' - se`x'
|
97 |
+
}
|
98 |
+
|
99 |
+
label values pres_candidate_plot pres_candidates
|
100 |
+
|
101 |
+
* Do plot
|
102 |
+
foreach x in Allreferences Implicit Race Crime {
|
103 |
+
*foreach x of varlist addict-weapon race2 race3 Race Crime Mexico Migration Crime2{
|
104 |
+
|
105 |
+
twoway (bar coef`x' pres_candidate_plot if democrat == 0, bcolor(black) ///
|
106 |
+
barwidth(0.9) horizontal) (bar coef`x' pres_candidate_plot if democrat == 1, ///
|
107 |
+
lcolor(black) fcolor(white) lwidth(medthick) barwidth(0.9) horizontal) (rcap l_coef`x' u_coef`x' ///
|
108 |
+
pres_candidate_plot, horizontal lcolor(black)) , xlabel(0(3)12) ylabel(1(1)5, ///
|
109 |
+
angle(horizontal) valuelabel labsize(*.8)) ytitle("") legend(off) ///
|
110 |
+
title("Mentions of words: `x'", size(medium) color(black)) ///
|
111 |
+
graphregion(fcolor(white) lcolor(white))
|
112 |
+
|
113 |
+
graph save Results/`x'_words.gph, replace
|
114 |
+
graph export Results/`x'_words.eps, replace
|
115 |
+
|
116 |
+
}
|
117 |
+
|
118 |
+
twoway (bar coefAllreferences pres_candidate_plot if democrat == 0, bcolor(black) ///
|
119 |
+
barwidth(0.9) horizontal) (bar coefAllreferences pres_candidate_plot if democrat == 1, ///
|
120 |
+
lcolor(black) fcolor(white) lwidth(medthick) barwidth(0.9) horizontal) (rcap l_coefAllreferences u_coefAllreferences ///
|
121 |
+
pres_candidate_plot, horizontal lcolor(black)) , xlabel(0(3)12) ylabel(1(1)5, ///
|
122 |
+
angle(horizontal) valuelabel labsize(*.8)) ytitle("") legend(off) ///
|
123 |
+
title("Explicit and Implicit Racial Mentions", size(medium) color(black)) ///
|
124 |
+
graphregion(fcolor(white) lcolor(white))
|
125 |
+
|
126 |
+
graph save Results/Allreferences_words.gph, replace
|
127 |
+
graph export Results/Allreferences_words.eps, replace
|
128 |
+
|
129 |
+
twoway (bar coefImplicit pres_candidate_plot if democrat == 0, bcolor(black) ///
|
130 |
+
barwidth(0.9) horizontal) (bar coefImplicit pres_candidate_plot if democrat == 1, ///
|
131 |
+
lcolor(black) fcolor(white) lwidth(medthick) barwidth(0.9) horizontal) (rcap l_coefImplicit u_coefImplicit ///
|
132 |
+
pres_candidate_plot, horizontal lcolor(black)) , xlabel(0(3)12) ylabel(1(1)5, ///
|
133 |
+
angle(horizontal) valuelabel labsize(*.8)) ytitle("") legend(off) ///
|
134 |
+
title("Implicit Racial Mentions", size(medium) color(black)) ///
|
135 |
+
graphregion(fcolor(white) lcolor(white))
|
136 |
+
|
137 |
+
graph save Results/Implicit_words.gph, replace
|
138 |
+
graph export Results/Implicit_words.eps, replace
|
139 |
+
|
140 |
+
twoway (bar coefRace pres_candidate_plot if democrat == 0, bcolor(black) ///
|
141 |
+
barwidth(0.9) horizontal) (bar coefRace pres_candidate_plot if democrat == 1, ///
|
142 |
+
lcolor(black) fcolor(white) lwidth(medthick) barwidth(0.9) horizontal) (rcap l_coefRace u_coefRace ///
|
143 |
+
pres_candidate_plot, horizontal lcolor(black)) , xlabel(0(3)12) ylabel(1(1)5, ///
|
144 |
+
angle(horizontal) valuelabel labsize(*.8)) ytitle("") legend(off) ///
|
145 |
+
title("Explicit Racial Mentions", size(medium) color(black)) ///
|
146 |
+
graphregion(fcolor(white) lcolor(white))
|
147 |
+
|
148 |
+
graph save Results/Race_words.gph, replace
|
149 |
+
graph export Results/Race_words.eps, replace
|
150 |
+
|
151 |
+
twoway (bar coefCrime_strict pres_candidate_plot if democrat == 0, bcolor(black) ///
|
152 |
+
barwidth(0.9) horizontal) (bar coefCrime_strict pres_candidate_plot if democrat == 1, ///
|
153 |
+
lcolor(black) fcolor(white) lwidth(medthick) barwidth(0.9) horizontal) (rcap l_coefCrime_strict u_coefCrime_strict ///
|
154 |
+
pres_candidate_plot, horizontal lcolor(black)) , xlabel(0(3)12) ylabel(1(1)5, ///
|
155 |
+
angle(horizontal) valuelabel labsize(*.8)) ytitle("") legend(off) ///
|
156 |
+
title("Crime", size(medium) color(black)) ///
|
157 |
+
graphregion(fcolor(white) lcolor(white))
|
158 |
+
|
159 |
+
graph save Results/Crime_strict_words.gph, replace
|
160 |
+
graph export Results/Crime_strict_words.eps, replace
|
161 |
+
|
162 |
+
graph combine Results/Allreferences_words.gph Results/Race_words.gph Results/Implicit_words.gph Results/Crime_strict_words.gph , scheme(s1mono)
|
163 |
+
|
164 |
+
graph export Results/FigureA1.pdf, replace
|
165 |
+
graph export Results/FigureA1.png, replace
|
166 |
+
|
39/replication_package/Do/FigureA10.do
ADDED
@@ -0,0 +1,603 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A10
|
4 |
+
*** Impact of Trump Rallies on the Number of Stops: Event-study Results
|
5 |
+
*** Without County-specific Linear Trends
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
global start = -105
|
9 |
+
global end = 105
|
10 |
+
global bin_l = 15
|
11 |
+
global var = "ihs_black"
|
12 |
+
global trend = 0
|
13 |
+
|
14 |
+
use "Data\stoplevel_data.dta", clear
|
15 |
+
|
16 |
+
g n_stops = 1
|
17 |
+
foreach var of varlist black hispanic white api {
|
18 |
+
replace `var' = `var'/100
|
19 |
+
}
|
20 |
+
|
21 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
22 |
+
|
23 |
+
g black_ps = 100*black / n_stops
|
24 |
+
g hispanic_ps = 100*hispanic / n_stops
|
25 |
+
g white_ps = 100*white / n_stops
|
26 |
+
g asian_ps = 100*api / n_stops
|
27 |
+
g ln_stops = ln(n_stops)
|
28 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
29 |
+
g white_nbps = 100*white / (n_stops-black)
|
30 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
31 |
+
|
32 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
33 |
+
g ln_black = ln(black +1)
|
34 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
35 |
+
g ln_hispanic = ln(hispanic+1)
|
36 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
37 |
+
g ln_white = ln(white+1)
|
38 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
39 |
+
g ln_asian = ln(api+1)
|
40 |
+
|
41 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
42 |
+
|
43 |
+
g TRUMP_0 = 0
|
44 |
+
forval ii = 1/9 {
|
45 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
46 |
+
}
|
47 |
+
|
48 |
+
forval ii = 1($bin_l)$end{
|
49 |
+
local jj = `ii' + $bin_l - 1
|
50 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
51 |
+
forval ee = 1/9 {
|
52 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
53 |
+
}
|
54 |
+
}
|
55 |
+
g TRUMP_POST_M$end = 0
|
56 |
+
forval ii = 1/9 {
|
57 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
58 |
+
}
|
59 |
+
*
|
60 |
+
|
61 |
+
forval ii = $start($bin_l)0 {
|
62 |
+
if `ii' < -$bin_l {
|
63 |
+
local jj = abs(`ii')
|
64 |
+
local zz = `jj' - $bin_l + 1
|
65 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
66 |
+
forval ee = 1/9 {
|
67 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
68 |
+
}
|
69 |
+
}
|
70 |
+
}
|
71 |
+
*
|
72 |
+
local jj = abs($start)
|
73 |
+
g TRUMP_PRE_M`jj' = 0
|
74 |
+
forval ii = 1/9 {
|
75 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
76 |
+
}
|
77 |
+
|
78 |
+
if $trend==1 {
|
79 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
80 |
+
}
|
81 |
+
else {
|
82 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
83 |
+
}
|
84 |
+
local temp = 1/$bin_l
|
85 |
+
local bin_neg = abs($start * `temp')
|
86 |
+
local bin_pos = $end * `temp'
|
87 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
88 |
+
|
89 |
+
mat treat = J(`range',4,1)
|
90 |
+
|
91 |
+
local Nrange = `range' - 2
|
92 |
+
|
93 |
+
forval pos = 1/`Nrange' {
|
94 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
95 |
+
if `lag' > 0 {
|
96 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
97 |
+
}
|
98 |
+
|
99 |
+
local num = abs(`lag')
|
100 |
+
|
101 |
+
if `lag' == 0 {
|
102 |
+
mat treat[`pos',1] = 0
|
103 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
104 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
105 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
106 |
+
}
|
107 |
+
else if `lag' < -$bin_l {
|
108 |
+
local num2 = `num' - $bin_l + 1
|
109 |
+
local num1 = - `num'
|
110 |
+
mat treat[`pos',1] = `num1'
|
111 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
112 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
113 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
114 |
+
}
|
115 |
+
else if `lag' == -$bin_l {
|
116 |
+
mat treat[`pos',1] = -$bin_l
|
117 |
+
mat treat[`pos',2] = 0
|
118 |
+
mat treat[`pos',3] = 0
|
119 |
+
mat treat[`pos',4] = 0
|
120 |
+
}
|
121 |
+
else {
|
122 |
+
di "**"
|
123 |
+
di `lag'
|
124 |
+
di `pos'
|
125 |
+
local num2 = `num' + $bin_l - 1
|
126 |
+
mat treat[`pos',1] = `num2'
|
127 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
128 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
129 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
130 |
+
}
|
131 |
+
}
|
132 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
133 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
134 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
135 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
136 |
+
|
137 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
138 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
139 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
140 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
141 |
+
|
142 |
+
g yy = treat[_n,1] in 1/`range'
|
143 |
+
g eff = treat[_n,2] in 1/`range'
|
144 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
145 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
146 |
+
sort yy
|
147 |
+
|
148 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
149 |
+
duplicates drop yy, force
|
150 |
+
keep eff eff_5 eff_95 yy
|
151 |
+
|
152 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Black Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
153 |
+
graph export "Results\FigureA10A.pdf", as(pdf) replace
|
154 |
+
|
155 |
+
******************************************************************************************************************************************************************
|
156 |
+
|
157 |
+
global start = -105
|
158 |
+
global end = 105
|
159 |
+
global bin_l = 15
|
160 |
+
global var = "ihs_hispanic"
|
161 |
+
global trend = 0
|
162 |
+
|
163 |
+
use "Data\stoplevel_data.dta", clear
|
164 |
+
|
165 |
+
g n_stops = 1
|
166 |
+
foreach var of varlist black hispanic white api {
|
167 |
+
replace `var' = `var'/100
|
168 |
+
}
|
169 |
+
|
170 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
171 |
+
g black_ps = 100*black / n_stops
|
172 |
+
g hispanic_ps = 100*hispanic / n_stops
|
173 |
+
g white_ps = 100*white / n_stops
|
174 |
+
g asian_ps = 100*api / n_stops
|
175 |
+
g ln_stops = ln(n_stops)
|
176 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
177 |
+
g white_nbps = 100*white / (n_stops-black)
|
178 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
179 |
+
|
180 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
181 |
+
g ln_black = ln(black +1)
|
182 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
183 |
+
g ln_hispanic = ln(hispanic+1)
|
184 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
185 |
+
g ln_white = ln(white+1)
|
186 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
187 |
+
g ln_asian = ln(api+1)
|
188 |
+
|
189 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
190 |
+
|
191 |
+
|
192 |
+
g TRUMP_0 = 0
|
193 |
+
forval ii = 1/9 {
|
194 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
195 |
+
}
|
196 |
+
|
197 |
+
forval ii = 1($bin_l)$end{
|
198 |
+
local jj = `ii' + $bin_l - 1
|
199 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
200 |
+
forval ee = 1/9 {
|
201 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
202 |
+
}
|
203 |
+
}
|
204 |
+
g TRUMP_POST_M$end = 0
|
205 |
+
forval ii = 1/9 {
|
206 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
207 |
+
}
|
208 |
+
*
|
209 |
+
|
210 |
+
forval ii = $start($bin_l)0 {
|
211 |
+
if `ii' < -$bin_l {
|
212 |
+
local jj = abs(`ii')
|
213 |
+
local zz = `jj' - $bin_l + 1
|
214 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
215 |
+
forval ee = 1/9 {
|
216 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
*
|
221 |
+
local jj = abs($start)
|
222 |
+
g TRUMP_PRE_M`jj' = 0
|
223 |
+
forval ii = 1/9 {
|
224 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
225 |
+
}
|
226 |
+
|
227 |
+
if $trend==1 {
|
228 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
229 |
+
}
|
230 |
+
else {
|
231 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
232 |
+
}
|
233 |
+
local temp = 1/$bin_l
|
234 |
+
local bin_neg = abs($start * `temp')
|
235 |
+
local bin_pos = $end * `temp'
|
236 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
237 |
+
|
238 |
+
mat treat = J(`range',4,1)
|
239 |
+
|
240 |
+
local Nrange = `range' - 2
|
241 |
+
|
242 |
+
forval pos = 1/`Nrange' {
|
243 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
244 |
+
if `lag' > 0 {
|
245 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
246 |
+
}
|
247 |
+
|
248 |
+
local num = abs(`lag')
|
249 |
+
|
250 |
+
if `lag' == 0 {
|
251 |
+
mat treat[`pos',1] = 0
|
252 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
253 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
254 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
255 |
+
}
|
256 |
+
else if `lag' < -$bin_l {
|
257 |
+
local num2 = `num' - $bin_l + 1
|
258 |
+
local num1 = - `num'
|
259 |
+
mat treat[`pos',1] = `num1'
|
260 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
261 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
262 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
263 |
+
}
|
264 |
+
else if `lag' == -$bin_l {
|
265 |
+
mat treat[`pos',1] = -$bin_l
|
266 |
+
mat treat[`pos',2] = 0
|
267 |
+
mat treat[`pos',3] = 0
|
268 |
+
mat treat[`pos',4] = 0
|
269 |
+
}
|
270 |
+
else {
|
271 |
+
di "**"
|
272 |
+
di `lag'
|
273 |
+
di `pos'
|
274 |
+
local num2 = `num' + $bin_l - 1
|
275 |
+
mat treat[`pos',1] = `num2'
|
276 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
277 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
278 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
279 |
+
}
|
280 |
+
}
|
281 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
282 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
283 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
284 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
285 |
+
|
286 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
287 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
288 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
289 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
290 |
+
|
291 |
+
g yy = treat[_n,1] in 1/`range'
|
292 |
+
g eff = treat[_n,2] in 1/`range'
|
293 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
294 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
295 |
+
sort yy
|
296 |
+
|
297 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
298 |
+
duplicates drop yy, force
|
299 |
+
keep eff eff_5 eff_95 yy
|
300 |
+
|
301 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanic Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
302 |
+
graph export "Results\FigureA10B.pdf", as(pdf) replace
|
303 |
+
|
304 |
+
******************************************************************************************************************************************************************
|
305 |
+
|
306 |
+
global start = -105
|
307 |
+
global end = 105
|
308 |
+
global bin_l = 15
|
309 |
+
global var = "ihs_white"
|
310 |
+
global trend = 0
|
311 |
+
|
312 |
+
use "Data\stoplevel_data.dta", clear
|
313 |
+
|
314 |
+
g n_stops = 1
|
315 |
+
foreach var of varlist black hispanic white api {
|
316 |
+
replace `var' = `var'/100
|
317 |
+
}
|
318 |
+
|
319 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
320 |
+
|
321 |
+
g black_ps = 100*black / n_stops
|
322 |
+
g hispanic_ps = 100*hispanic / n_stops
|
323 |
+
g white_ps = 100*white / n_stops
|
324 |
+
g asian_ps = 100*api / n_stops
|
325 |
+
g ln_stops = ln(n_stops)
|
326 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
327 |
+
g white_nbps = 100*white / (n_stops-black)
|
328 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
329 |
+
|
330 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
331 |
+
g ln_black = ln(black +1)
|
332 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
333 |
+
g ln_hispanic = ln(hispanic+1)
|
334 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
335 |
+
g ln_white = ln(white+1)
|
336 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
337 |
+
g ln_asian = ln(api+1)
|
338 |
+
|
339 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
340 |
+
|
341 |
+
|
342 |
+
g TRUMP_0 = 0
|
343 |
+
forval ii = 1/9 {
|
344 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
345 |
+
}
|
346 |
+
|
347 |
+
forval ii = 1($bin_l)$end{
|
348 |
+
local jj = `ii' + $bin_l - 1
|
349 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
350 |
+
forval ee = 1/9 {
|
351 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
352 |
+
}
|
353 |
+
}
|
354 |
+
g TRUMP_POST_M$end = 0
|
355 |
+
forval ii = 1/9 {
|
356 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
357 |
+
}
|
358 |
+
*
|
359 |
+
|
360 |
+
forval ii = $start($bin_l)0 {
|
361 |
+
if `ii' < -$bin_l {
|
362 |
+
local jj = abs(`ii')
|
363 |
+
local zz = `jj' - $bin_l + 1
|
364 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
365 |
+
forval ee = 1/9 {
|
366 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
367 |
+
}
|
368 |
+
}
|
369 |
+
}
|
370 |
+
*
|
371 |
+
local jj = abs($start)
|
372 |
+
g TRUMP_PRE_M`jj' = 0
|
373 |
+
forval ii = 1/9 {
|
374 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
375 |
+
}
|
376 |
+
|
377 |
+
if $trend==1 {
|
378 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
379 |
+
}
|
380 |
+
else {
|
381 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
382 |
+
}
|
383 |
+
local temp = 1/$bin_l
|
384 |
+
local bin_neg = abs($start * `temp')
|
385 |
+
local bin_pos = $end * `temp'
|
386 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
387 |
+
|
388 |
+
mat treat = J(`range',4,1)
|
389 |
+
|
390 |
+
local Nrange = `range' - 2
|
391 |
+
|
392 |
+
forval pos = 1/`Nrange' {
|
393 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
394 |
+
if `lag' > 0 {
|
395 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
396 |
+
}
|
397 |
+
|
398 |
+
local num = abs(`lag')
|
399 |
+
|
400 |
+
if `lag' == 0 {
|
401 |
+
mat treat[`pos',1] = 0
|
402 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
403 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
404 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
405 |
+
}
|
406 |
+
else if `lag' < -$bin_l {
|
407 |
+
local num2 = `num' - $bin_l + 1
|
408 |
+
local num1 = - `num'
|
409 |
+
mat treat[`pos',1] = `num1'
|
410 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
411 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
412 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
413 |
+
}
|
414 |
+
else if `lag' == -$bin_l {
|
415 |
+
mat treat[`pos',1] = -$bin_l
|
416 |
+
mat treat[`pos',2] = 0
|
417 |
+
mat treat[`pos',3] = 0
|
418 |
+
mat treat[`pos',4] = 0
|
419 |
+
}
|
420 |
+
else {
|
421 |
+
di "**"
|
422 |
+
di `lag'
|
423 |
+
di `pos'
|
424 |
+
local num2 = `num' + $bin_l - 1
|
425 |
+
mat treat[`pos',1] = `num2'
|
426 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
427 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
428 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
429 |
+
}
|
430 |
+
}
|
431 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
432 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
433 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
434 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
435 |
+
|
436 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
437 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
438 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
439 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
440 |
+
|
441 |
+
g yy = treat[_n,1] in 1/`range'
|
442 |
+
g eff = treat[_n,2] in 1/`range'
|
443 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
444 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
445 |
+
sort yy
|
446 |
+
|
447 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
448 |
+
duplicates drop yy, force
|
449 |
+
keep eff eff_5 eff_95 yy
|
450 |
+
|
451 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on White Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
452 |
+
graph export "Results\FigureA10D.pdf", as(pdf) replace
|
453 |
+
|
454 |
+
******************************************************************************************************************************************************************
|
455 |
+
|
456 |
+
global start = -105
|
457 |
+
global end = 105
|
458 |
+
global bin_l = 15
|
459 |
+
global var = "ihs_asian"
|
460 |
+
global trend = 0
|
461 |
+
|
462 |
+
use "Data\stoplevel_data.dta", clear
|
463 |
+
|
464 |
+
g n_stops = 1
|
465 |
+
foreach var of varlist black hispanic white api {
|
466 |
+
replace `var' = `var'/100
|
467 |
+
}
|
468 |
+
|
469 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
470 |
+
|
471 |
+
g black_ps = 100*black / n_stops
|
472 |
+
g hispanic_ps = 100*hispanic / n_stops
|
473 |
+
g white_ps = 100*white / n_stops
|
474 |
+
g asian_ps = 100*api / n_stops
|
475 |
+
g ln_stops = ln(n_stops)
|
476 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
477 |
+
g white_nbps = 100*white / (n_stops-black)
|
478 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
479 |
+
|
480 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
481 |
+
g ln_black = ln(black +1)
|
482 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
483 |
+
g ln_hispanic = ln(hispanic+1)
|
484 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
485 |
+
g ln_white = ln(white+1)
|
486 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
487 |
+
g ln_asian = ln(api+1)
|
488 |
+
|
489 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
490 |
+
|
491 |
+
|
492 |
+
g TRUMP_0 = 0
|
493 |
+
forval ii = 1/9 {
|
494 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
495 |
+
}
|
496 |
+
|
497 |
+
forval ii = 1($bin_l)$end{
|
498 |
+
local jj = `ii' + $bin_l - 1
|
499 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
500 |
+
forval ee = 1/9 {
|
501 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
502 |
+
}
|
503 |
+
}
|
504 |
+
g TRUMP_POST_M$end = 0
|
505 |
+
forval ii = 1/9 {
|
506 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
507 |
+
}
|
508 |
+
*
|
509 |
+
|
510 |
+
forval ii = $start($bin_l)0 {
|
511 |
+
if `ii' < -$bin_l {
|
512 |
+
local jj = abs(`ii')
|
513 |
+
local zz = `jj' - $bin_l + 1
|
514 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
515 |
+
forval ee = 1/9 {
|
516 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
517 |
+
}
|
518 |
+
}
|
519 |
+
}
|
520 |
+
*
|
521 |
+
local jj = abs($start)
|
522 |
+
g TRUMP_PRE_M`jj' = 0
|
523 |
+
forval ii = 1/9 {
|
524 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
525 |
+
}
|
526 |
+
|
527 |
+
if $trend==1 {
|
528 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
529 |
+
}
|
530 |
+
else {
|
531 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
532 |
+
}
|
533 |
+
local temp = 1/$bin_l
|
534 |
+
local bin_neg = abs($start * `temp')
|
535 |
+
local bin_pos = $end * `temp'
|
536 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
537 |
+
|
538 |
+
mat treat = J(`range',4,1)
|
539 |
+
|
540 |
+
local Nrange = `range' - 2
|
541 |
+
|
542 |
+
forval pos = 1/`Nrange' {
|
543 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
544 |
+
if `lag' > 0 {
|
545 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
546 |
+
}
|
547 |
+
|
548 |
+
local num = abs(`lag')
|
549 |
+
|
550 |
+
if `lag' == 0 {
|
551 |
+
mat treat[`pos',1] = 0
|
552 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
553 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
554 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
555 |
+
}
|
556 |
+
else if `lag' < -$bin_l {
|
557 |
+
local num2 = `num' - $bin_l + 1
|
558 |
+
local num1 = - `num'
|
559 |
+
mat treat[`pos',1] = `num1'
|
560 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
561 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
562 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
563 |
+
}
|
564 |
+
else if `lag' == -$bin_l {
|
565 |
+
mat treat[`pos',1] = -$bin_l
|
566 |
+
mat treat[`pos',2] = 0
|
567 |
+
mat treat[`pos',3] = 0
|
568 |
+
mat treat[`pos',4] = 0
|
569 |
+
}
|
570 |
+
else {
|
571 |
+
di "**"
|
572 |
+
di `lag'
|
573 |
+
di `pos'
|
574 |
+
local num2 = `num' + $bin_l - 1
|
575 |
+
mat treat[`pos',1] = `num2'
|
576 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
577 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
578 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
579 |
+
}
|
580 |
+
}
|
581 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
582 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
583 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
584 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
585 |
+
|
586 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
587 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
588 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
589 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
590 |
+
|
591 |
+
g yy = treat[_n,1] in 1/`range'
|
592 |
+
g eff = treat[_n,2] in 1/`range'
|
593 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
594 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
595 |
+
sort yy
|
596 |
+
|
597 |
+
duplicates drop yy, force
|
598 |
+
keep eff eff_5 eff_95 yy
|
599 |
+
|
600 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on API Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
601 |
+
graph export "Results\FigureA10C.pdf", as(pdf) replace
|
602 |
+
|
603 |
+
|
39/replication_package/Do/FigureA11.do
ADDED
@@ -0,0 +1,527 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A11
|
4 |
+
*** The Differential Effect of Trump and Other Political Rallies on the Probability
|
5 |
+
*** of a Black Stop: Event-study Results With and Without County-specific Linear Trends
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
g n_stops = 1
|
11 |
+
replace black = black/100
|
12 |
+
|
13 |
+
collapse (sum) n_stops black (first) dist_event*, by(county_fips day_id)
|
14 |
+
|
15 |
+
merge n:1 county_fips using "Data\allcandidates_rallies.dta"
|
16 |
+
drop if _merge==2
|
17 |
+
|
18 |
+
g black_ps = black / n_stops
|
19 |
+
|
20 |
+
local start = -105
|
21 |
+
local end = 105
|
22 |
+
local bin_l = 15
|
23 |
+
|
24 |
+
g TRUMP_0 = 0
|
25 |
+
forval ii = 1/9 {
|
26 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
27 |
+
}
|
28 |
+
|
29 |
+
forval ii = 1(`bin_l')`end'{
|
30 |
+
local jj = `ii' + `bin_l' - 1
|
31 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
32 |
+
forval ee = 1/9 {
|
33 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
34 |
+
}
|
35 |
+
}
|
36 |
+
g TRUMP_POST_M`end' = 0
|
37 |
+
forval ii = 1/9 {
|
38 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
39 |
+
}
|
40 |
+
*
|
41 |
+
|
42 |
+
forval ii = `start'(`bin_l')0 {
|
43 |
+
if `ii' < -`bin_l' {
|
44 |
+
local jj = abs(`ii')
|
45 |
+
local zz = `jj' - `bin_l' + 1
|
46 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
47 |
+
forval ee = 1/9 {
|
48 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
*
|
53 |
+
local jj = abs(`start')
|
54 |
+
g TRUMP_PRE_M`jj' = 0
|
55 |
+
forval ii = 1/9 {
|
56 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
57 |
+
}
|
58 |
+
|
59 |
+
drop dist_event*
|
60 |
+
|
61 |
+
forval ii = 1/4 {
|
62 |
+
g dist_event`ii' = day_id - event_day_Cruz_`ii'
|
63 |
+
}
|
64 |
+
|
65 |
+
g CRUZ_0 = 0
|
66 |
+
forval ii = 1/4 {
|
67 |
+
replace CRUZ_0 = 1 if dist_event`ii' == 0
|
68 |
+
}
|
69 |
+
|
70 |
+
forval ii = 1(`bin_l')`end'{
|
71 |
+
local jj = `ii' + `bin_l' - 1
|
72 |
+
g CRUZ_POST_`ii'_`jj' = 0
|
73 |
+
forval ee = 1/4 {
|
74 |
+
replace CRUZ_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
75 |
+
}
|
76 |
+
}
|
77 |
+
g CRUZ_POST_M`end' = 0
|
78 |
+
forval ii = 1/4 {
|
79 |
+
replace CRUZ_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
80 |
+
}
|
81 |
+
*
|
82 |
+
|
83 |
+
forval ii = `start'(`bin_l')0 {
|
84 |
+
if `ii' < -`bin_l' {
|
85 |
+
local jj = abs(`ii')
|
86 |
+
local zz = `jj' - `bin_l' + 1
|
87 |
+
g CRUZ_PRE_`jj'_`zz' = 0
|
88 |
+
forval ee = 1/4 {
|
89 |
+
replace CRUZ_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
90 |
+
}
|
91 |
+
}
|
92 |
+
}
|
93 |
+
*
|
94 |
+
local jj = abs(`start')
|
95 |
+
g CRUZ_PRE_M`jj' = 0
|
96 |
+
forval ii = 1/4 {
|
97 |
+
replace CRUZ_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
98 |
+
}
|
99 |
+
|
100 |
+
drop dist_event*
|
101 |
+
|
102 |
+
forval ii = 1/10 {
|
103 |
+
g dist_event`ii' = day_id - event_day_Clinton_`ii'
|
104 |
+
}
|
105 |
+
g CLINTON_0 = 0
|
106 |
+
forval ii = 1/10 {
|
107 |
+
replace CLINTON_0 = 1 if dist_event`ii' == 0
|
108 |
+
}
|
109 |
+
|
110 |
+
forval ii = 1(`bin_l')`end'{
|
111 |
+
local jj = `ii' + `bin_l' - 1
|
112 |
+
g CLINTON_POST_`ii'_`jj' = 0
|
113 |
+
forval ee = 1/10 {
|
114 |
+
replace CLINTON_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
115 |
+
}
|
116 |
+
}
|
117 |
+
g CLINTON_POST_M`end' = 0
|
118 |
+
forval ii = 1/10 {
|
119 |
+
replace CLINTON_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
120 |
+
}
|
121 |
+
*
|
122 |
+
|
123 |
+
forval ii = `start'(`bin_l')0 {
|
124 |
+
if `ii' < -`bin_l' {
|
125 |
+
local jj = abs(`ii')
|
126 |
+
local zz = `jj' - `bin_l' + 1
|
127 |
+
g CLINTON_PRE_`jj'_`zz' = 0
|
128 |
+
forval ee = 1/10 {
|
129 |
+
replace CLINTON_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
*
|
134 |
+
local jj = abs(`start')
|
135 |
+
g CLINTON_PRE_M`jj' = 0
|
136 |
+
forval ii = 1/10 {
|
137 |
+
replace CLINTON_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
138 |
+
}
|
139 |
+
|
140 |
+
g ANYCANDIDATE_0 = (TRUMP_0==1) | (CRUZ_0==1) | (CLINTON_0==1)
|
141 |
+
|
142 |
+
forval ii = 1(`bin_l')`end'{
|
143 |
+
local jj = `ii' + `bin_l' - 1
|
144 |
+
g ANYCANDIDATE_POST_`ii'_`jj' = (TRUMP_POST_`ii'_`jj'==1) | (CRUZ_POST_`ii'_`jj'==1) | (CLINTON_POST_`ii'_`jj'==1)
|
145 |
+
}
|
146 |
+
g ANYCANDIDATE_POST_M`end' = (TRUMP_POST_M`end'==1) | (CRUZ_POST_M`end'==1) | (CLINTON_POST_M`end'==1)
|
147 |
+
|
148 |
+
forval ii = `start'(`bin_l')0 {
|
149 |
+
if `ii' < -`bin_l' {
|
150 |
+
local jj = abs(`ii')
|
151 |
+
local zz = `jj' - `bin_l' + 1
|
152 |
+
g ANYCANDIDATE_PRE_`jj'_`zz' = (TRUMP_PRE_`jj'_`zz'==1) | (CRUZ_PRE_`jj'_`zz'==1) | (CLINTON_PRE_`jj'_`zz'==1)
|
153 |
+
}
|
154 |
+
}
|
155 |
+
*
|
156 |
+
local jj = abs(`start')
|
157 |
+
g ANYCANDIDATE_PRE_M`jj' = (TRUMP_PRE_M`jj'==1) | (CRUZ_PRE_M`jj'==1) | (CLINTON_PRE_M`jj'==1)
|
158 |
+
|
159 |
+
reghdfe black_ps 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.ANYCANDIDATE_* 1.ANYCANDIDATE_0 1.ANYCANDIDATE_* [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id )
|
160 |
+
|
161 |
+
local temp = 1/`bin_l'
|
162 |
+
local bin_neg = abs(`start' * `temp')
|
163 |
+
local bin_pos = `end' * `temp'
|
164 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
165 |
+
|
166 |
+
mat treat = J(`range',7,1)
|
167 |
+
|
168 |
+
local Nrange = `range' - 2
|
169 |
+
|
170 |
+
forval pos = 1/`Nrange' {
|
171 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
172 |
+
if `lag' > 0 {
|
173 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
174 |
+
}
|
175 |
+
|
176 |
+
local num = abs(`lag')
|
177 |
+
|
178 |
+
if `lag' == 0 {
|
179 |
+
mat treat[`pos',1] = 0
|
180 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_0]
|
181 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_0] + _se[1.ANYCANDIDATE_0]*invttail(e(N),0.05)
|
182 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_0] - _se[1.ANYCANDIDATE_0]*invttail(e(N),0.05)
|
183 |
+
|
184 |
+
|
185 |
+
lincom _b[1.ANYCANDIDATE_0] + _b[1.TRUMP_0]
|
186 |
+
mat treat[`pos',5] = r(estimate)
|
187 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
188 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
189 |
+
|
190 |
+
}
|
191 |
+
else if `lag' < -`bin_l' {
|
192 |
+
local num2 = `num' - `bin_l' + 1
|
193 |
+
local num1 = - `num'
|
194 |
+
mat treat[`pos',1] = `num1'
|
195 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_PRE_`num'_`num2']
|
196 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_PRE_`num'_`num2'] + _se[1.ANYCANDIDATE_PRE_`num'_`num2']*invttail(e(N),0.05)
|
197 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_PRE_`num'_`num2'] - _se[1.ANYCANDIDATE_PRE_`num'_`num2']*invttail(e(N),0.05)
|
198 |
+
|
199 |
+
lincom _b[1.ANYCANDIDATE_PRE_`num'_`num2'] + _b[1.TRUMP_PRE_`num'_`num2']
|
200 |
+
mat treat[`pos',5] = r(estimate)
|
201 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
202 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
203 |
+
|
204 |
+
}
|
205 |
+
else if `lag' == -`bin_l' {
|
206 |
+
mat treat[`pos',1] = -`bin_l'
|
207 |
+
mat treat[`pos',2] = 0
|
208 |
+
mat treat[`pos',3] = 0
|
209 |
+
mat treat[`pos',4] = 0
|
210 |
+
|
211 |
+
mat treat[`pos',5] = 0
|
212 |
+
mat treat[`pos',6] = 0
|
213 |
+
mat treat[`pos',7] = 0
|
214 |
+
|
215 |
+
}
|
216 |
+
else {
|
217 |
+
di "**"
|
218 |
+
di `lag'
|
219 |
+
di `pos'
|
220 |
+
local num2 = `num' + `bin_l' - 1
|
221 |
+
mat treat[`pos',1] = `num2'
|
222 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_POST_`num'_`num2']
|
223 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_POST_`num'_`num2'] + _se[1.ANYCANDIDATE_POST_`num'_`num2']*invttail(e(N),0.05)
|
224 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_POST_`num'_`num2'] - _se[1.ANYCANDIDATE_POST_`num'_`num2']*invttail(e(N),0.05)
|
225 |
+
|
226 |
+
lincom _b[1.ANYCANDIDATE_POST_`num'_`num2'] + _b[1.TRUMP_POST_`num'_`num2']
|
227 |
+
mat treat[`pos',5] = r(estimate)
|
228 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
229 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
230 |
+
}
|
231 |
+
}
|
232 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
233 |
+
mat treat[`range'-1,2] = _b[1.ANYCANDIDATE_PRE_M`jj']
|
234 |
+
mat treat[`range'-1,3] = _b[1.ANYCANDIDATE_PRE_M`jj'] + _se[1.ANYCANDIDATE_PRE_M`jj']*invttail(e(N),0.05)
|
235 |
+
mat treat[`range'-1,4] = _b[1.ANYCANDIDATE_PRE_M`jj'] - _se[1.ANYCANDIDATE_PRE_M`jj']*invttail(e(N),0.05)
|
236 |
+
|
237 |
+
lincom _b[1.ANYCANDIDATE_PRE_M`jj'] + _b[1.TRUMP_PRE_M`jj']
|
238 |
+
mat treat[`range'-1,5] = r(estimate)
|
239 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
240 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
241 |
+
|
242 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
243 |
+
mat treat[`range',2] = _b[1.ANYCANDIDATE_POST_M`end']
|
244 |
+
mat treat[`range',3] = _b[1.ANYCANDIDATE_POST_M`end'] + _se[1.ANYCANDIDATE_POST_M`end']*invttail(e(N),0.05)
|
245 |
+
mat treat[`range',4] = _b[1.ANYCANDIDATE_POST_M`end'] - _se[1.ANYCANDIDATE_POST_M`end']*invttail(e(N),0.05)
|
246 |
+
|
247 |
+
lincom _b[1.ANYCANDIDATE_POST_M`end'] + _b[1.TRUMP_POST_M`end']
|
248 |
+
mat treat[`range',5] = r(estimate)
|
249 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
250 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
251 |
+
|
252 |
+
g yy = treat[_n,1] in 1/`range'
|
253 |
+
g eff_any = treat[_n,2] in 1/`range'
|
254 |
+
g eff_any_10 = treat[_n,3] in 1/`range'
|
255 |
+
g eff_any_90 = treat[_n,4] in 1/`range'
|
256 |
+
g eff_tr = treat[_n,5] in 1/`range'
|
257 |
+
g eff_tr_10 = treat[_n,6] in 1/`range'
|
258 |
+
g eff_tr_90 = treat[_n,7] in 1/`range'
|
259 |
+
sort yy
|
260 |
+
|
261 |
+
duplicates drop yy, force
|
262 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
263 |
+
|
264 |
+
twoway (rcap eff_tr_10 eff_tr_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_tr yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_tr yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Probabilty Black Stop") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.02) saving(track,replace)
|
265 |
+
graph export "Results\FigureA11A.pdf", as(pdf) name("Graph") replace
|
266 |
+
|
267 |
+
|
268 |
+
**********************************************************************
|
269 |
+
|
270 |
+
use "Data\stoplevel_data.dta", clear
|
271 |
+
|
272 |
+
g n_stops = 1
|
273 |
+
replace black = black/100
|
274 |
+
|
275 |
+
collapse (sum) n_stops black (first) dist_event*, by(county_fips day_id)
|
276 |
+
|
277 |
+
merge n:1 county_fips using "Data\allcandidates_rallies.dta"
|
278 |
+
drop if _merge==2
|
279 |
+
|
280 |
+
g black_ps = black / n_stops
|
281 |
+
|
282 |
+
local start = -105
|
283 |
+
local end = 105
|
284 |
+
local bin_l = 15
|
285 |
+
|
286 |
+
g TRUMP_0 = 0
|
287 |
+
forval ii = 1/9 {
|
288 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
289 |
+
}
|
290 |
+
|
291 |
+
forval ii = 1(`bin_l')`end'{
|
292 |
+
local jj = `ii' + `bin_l' - 1
|
293 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
294 |
+
forval ee = 1/9 {
|
295 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
296 |
+
}
|
297 |
+
}
|
298 |
+
g TRUMP_POST_M`end' = 0
|
299 |
+
forval ii = 1/9 {
|
300 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
301 |
+
}
|
302 |
+
*
|
303 |
+
|
304 |
+
forval ii = `start'(`bin_l')0 {
|
305 |
+
if `ii' < -`bin_l' {
|
306 |
+
local jj = abs(`ii')
|
307 |
+
local zz = `jj' - `bin_l' + 1
|
308 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
309 |
+
forval ee = 1/9 {
|
310 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
311 |
+
}
|
312 |
+
}
|
313 |
+
}
|
314 |
+
*
|
315 |
+
local jj = abs(`start')
|
316 |
+
g TRUMP_PRE_M`jj' = 0
|
317 |
+
forval ii = 1/9 {
|
318 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
319 |
+
}
|
320 |
+
|
321 |
+
drop dist_event*
|
322 |
+
|
323 |
+
forval ii = 1/4 {
|
324 |
+
g dist_event`ii' = day_id - event_day_Cruz_`ii'
|
325 |
+
}
|
326 |
+
|
327 |
+
g CRUZ_0 = 0
|
328 |
+
forval ii = 1/4 {
|
329 |
+
replace CRUZ_0 = 1 if dist_event`ii' == 0
|
330 |
+
}
|
331 |
+
|
332 |
+
forval ii = 1(`bin_l')`end'{
|
333 |
+
local jj = `ii' + `bin_l' - 1
|
334 |
+
g CRUZ_POST_`ii'_`jj' = 0
|
335 |
+
forval ee = 1/4 {
|
336 |
+
replace CRUZ_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
337 |
+
}
|
338 |
+
}
|
339 |
+
g CRUZ_POST_M`end' = 0
|
340 |
+
forval ii = 1/4 {
|
341 |
+
replace CRUZ_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
342 |
+
}
|
343 |
+
*
|
344 |
+
|
345 |
+
forval ii = `start'(`bin_l')0 {
|
346 |
+
if `ii' < -`bin_l' {
|
347 |
+
local jj = abs(`ii')
|
348 |
+
local zz = `jj' - `bin_l' + 1
|
349 |
+
g CRUZ_PRE_`jj'_`zz' = 0
|
350 |
+
forval ee = 1/4 {
|
351 |
+
replace CRUZ_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
352 |
+
}
|
353 |
+
}
|
354 |
+
}
|
355 |
+
*
|
356 |
+
local jj = abs(`start')
|
357 |
+
g CRUZ_PRE_M`jj' = 0
|
358 |
+
forval ii = 1/4 {
|
359 |
+
replace CRUZ_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
360 |
+
}
|
361 |
+
|
362 |
+
drop dist_event*
|
363 |
+
|
364 |
+
forval ii = 1/10 {
|
365 |
+
g dist_event`ii' = day_id - event_day_Clinton_`ii'
|
366 |
+
}
|
367 |
+
g CLINTON_0 = 0
|
368 |
+
forval ii = 1/10 {
|
369 |
+
replace CLINTON_0 = 1 if dist_event`ii' == 0
|
370 |
+
}
|
371 |
+
|
372 |
+
forval ii = 1(`bin_l')`end'{
|
373 |
+
local jj = `ii' + `bin_l' - 1
|
374 |
+
g CLINTON_POST_`ii'_`jj' = 0
|
375 |
+
forval ee = 1/10 {
|
376 |
+
replace CLINTON_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
377 |
+
}
|
378 |
+
}
|
379 |
+
g CLINTON_POST_M`end' = 0
|
380 |
+
forval ii = 1/10 {
|
381 |
+
replace CLINTON_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
382 |
+
}
|
383 |
+
*
|
384 |
+
|
385 |
+
forval ii = `start'(`bin_l')0 {
|
386 |
+
if `ii' < -`bin_l' {
|
387 |
+
local jj = abs(`ii')
|
388 |
+
local zz = `jj' - `bin_l' + 1
|
389 |
+
g CLINTON_PRE_`jj'_`zz' = 0
|
390 |
+
forval ee = 1/10 {
|
391 |
+
replace CLINTON_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
+
*
|
396 |
+
local jj = abs(`start')
|
397 |
+
g CLINTON_PRE_M`jj' = 0
|
398 |
+
forval ii = 1/10 {
|
399 |
+
replace CLINTON_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
400 |
+
}
|
401 |
+
|
402 |
+
g ANYCANDIDATE_0 = (TRUMP_0==1) | (CRUZ_0==1) | (CLINTON_0==1)
|
403 |
+
|
404 |
+
forval ii = 1(`bin_l')`end'{
|
405 |
+
local jj = `ii' + `bin_l' - 1
|
406 |
+
g ANYCANDIDATE_POST_`ii'_`jj' = (TRUMP_POST_`ii'_`jj'==1) | (CRUZ_POST_`ii'_`jj'==1) | (CLINTON_POST_`ii'_`jj'==1)
|
407 |
+
}
|
408 |
+
g ANYCANDIDATE_POST_M`end' = (TRUMP_POST_M`end'==1) | (CRUZ_POST_M`end'==1) | (CLINTON_POST_M`end'==1)
|
409 |
+
|
410 |
+
forval ii = `start'(`bin_l')0 {
|
411 |
+
if `ii' < -`bin_l' {
|
412 |
+
local jj = abs(`ii')
|
413 |
+
local zz = `jj' - `bin_l' + 1
|
414 |
+
g ANYCANDIDATE_PRE_`jj'_`zz' = (TRUMP_PRE_`jj'_`zz'==1) | (CRUZ_PRE_`jj'_`zz'==1) | (CLINTON_PRE_`jj'_`zz'==1)
|
415 |
+
}
|
416 |
+
}
|
417 |
+
*
|
418 |
+
local jj = abs(`start')
|
419 |
+
g ANYCANDIDATE_PRE_M`jj' = (TRUMP_PRE_M`jj'==1) | (CRUZ_PRE_M`jj'==1) | (CLINTON_PRE_M`jj'==1)
|
420 |
+
|
421 |
+
reghdfe black_ps 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.ANYCANDIDATE_* 1.ANYCANDIDATE_0 1.ANYCANDIDATE_* [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
422 |
+
|
423 |
+
local temp = 1/`bin_l'
|
424 |
+
local bin_neg = abs(`start' * `temp')
|
425 |
+
local bin_pos = `end' * `temp'
|
426 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
427 |
+
|
428 |
+
mat treat = J(`range',7,1)
|
429 |
+
|
430 |
+
local Nrange = `range' - 2
|
431 |
+
|
432 |
+
forval pos = 1/`Nrange' {
|
433 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
434 |
+
if `lag' > 0 {
|
435 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
436 |
+
}
|
437 |
+
|
438 |
+
local num = abs(`lag')
|
439 |
+
|
440 |
+
if `lag' == 0 {
|
441 |
+
mat treat[`pos',1] = 0
|
442 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_0]
|
443 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_0] + _se[1.ANYCANDIDATE_0]*invttail(e(N),0.05)
|
444 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_0] - _se[1.ANYCANDIDATE_0]*invttail(e(N),0.05)
|
445 |
+
|
446 |
+
|
447 |
+
lincom _b[1.ANYCANDIDATE_0] + _b[1.TRUMP_0]
|
448 |
+
mat treat[`pos',5] = r(estimate)
|
449 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
450 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
451 |
+
|
452 |
+
}
|
453 |
+
else if `lag' < -`bin_l' {
|
454 |
+
local num2 = `num' - `bin_l' + 1
|
455 |
+
local num1 = - `num'
|
456 |
+
mat treat[`pos',1] = `num1'
|
457 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_PRE_`num'_`num2']
|
458 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_PRE_`num'_`num2'] + _se[1.ANYCANDIDATE_PRE_`num'_`num2']*invttail(e(N),0.05)
|
459 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_PRE_`num'_`num2'] - _se[1.ANYCANDIDATE_PRE_`num'_`num2']*invttail(e(N),0.05)
|
460 |
+
|
461 |
+
lincom _b[1.ANYCANDIDATE_PRE_`num'_`num2'] + _b[1.TRUMP_PRE_`num'_`num2']
|
462 |
+
mat treat[`pos',5] = r(estimate)
|
463 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
464 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
465 |
+
|
466 |
+
}
|
467 |
+
else if `lag' == -`bin_l' {
|
468 |
+
mat treat[`pos',1] = -`bin_l'
|
469 |
+
mat treat[`pos',2] = 0
|
470 |
+
mat treat[`pos',3] = 0
|
471 |
+
mat treat[`pos',4] = 0
|
472 |
+
|
473 |
+
mat treat[`pos',5] = 0
|
474 |
+
mat treat[`pos',6] = 0
|
475 |
+
mat treat[`pos',7] = 0
|
476 |
+
|
477 |
+
}
|
478 |
+
else {
|
479 |
+
di "**"
|
480 |
+
di `lag'
|
481 |
+
di `pos'
|
482 |
+
local num2 = `num' + `bin_l' - 1
|
483 |
+
mat treat[`pos',1] = `num2'
|
484 |
+
mat treat[`pos',2] = _b[1.ANYCANDIDATE_POST_`num'_`num2']
|
485 |
+
mat treat[`pos',3] = _b[1.ANYCANDIDATE_POST_`num'_`num2'] + _se[1.ANYCANDIDATE_POST_`num'_`num2']*invttail(e(N),0.05)
|
486 |
+
mat treat[`pos',4] = _b[1.ANYCANDIDATE_POST_`num'_`num2'] - _se[1.ANYCANDIDATE_POST_`num'_`num2']*invttail(e(N),0.05)
|
487 |
+
|
488 |
+
lincom _b[1.ANYCANDIDATE_POST_`num'_`num2'] + _b[1.TRUMP_POST_`num'_`num2']
|
489 |
+
mat treat[`pos',5] = r(estimate)
|
490 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
491 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
492 |
+
}
|
493 |
+
}
|
494 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
495 |
+
mat treat[`range'-1,2] = _b[1.ANYCANDIDATE_PRE_M`jj']
|
496 |
+
mat treat[`range'-1,3] = _b[1.ANYCANDIDATE_PRE_M`jj'] + _se[1.ANYCANDIDATE_PRE_M`jj']*invttail(e(N),0.05)
|
497 |
+
mat treat[`range'-1,4] = _b[1.ANYCANDIDATE_PRE_M`jj'] - _se[1.ANYCANDIDATE_PRE_M`jj']*invttail(e(N),0.05)
|
498 |
+
|
499 |
+
lincom _b[1.ANYCANDIDATE_PRE_M`jj'] + _b[1.TRUMP_PRE_M`jj']
|
500 |
+
mat treat[`range'-1,5] = r(estimate)
|
501 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
502 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
503 |
+
|
504 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
505 |
+
mat treat[`range',2] = _b[1.ANYCANDIDATE_POST_M`end']
|
506 |
+
mat treat[`range',3] = _b[1.ANYCANDIDATE_POST_M`end'] + _se[1.ANYCANDIDATE_POST_M`end']*invttail(e(N),0.05)
|
507 |
+
mat treat[`range',4] = _b[1.ANYCANDIDATE_POST_M`end'] - _se[1.ANYCANDIDATE_POST_M`end']*invttail(e(N),0.05)
|
508 |
+
|
509 |
+
lincom _b[1.ANYCANDIDATE_POST_M`end'] + _b[1.TRUMP_POST_M`end']
|
510 |
+
mat treat[`range',5] = r(estimate)
|
511 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.05)
|
512 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.05)
|
513 |
+
|
514 |
+
g yy = treat[_n,1] in 1/`range'
|
515 |
+
g eff_any = treat[_n,2] in 1/`range'
|
516 |
+
g eff_any_10 = treat[_n,3] in 1/`range'
|
517 |
+
g eff_any_90 = treat[_n,4] in 1/`range'
|
518 |
+
g eff_tr = treat[_n,5] in 1/`range'
|
519 |
+
g eff_tr_10 = treat[_n,6] in 1/`range'
|
520 |
+
g eff_tr_90 = treat[_n,7] in 1/`range'
|
521 |
+
sort yy
|
522 |
+
|
523 |
+
duplicates drop yy, force
|
524 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
525 |
+
|
526 |
+
twoway (rcap eff_tr_10 eff_tr_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_tr yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_tr yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Probabilty Black Stop") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.02) saving(track,replace)
|
527 |
+
graph export "Results\FigureA11B.pdf", as(pdf) name("Graph") replace
|
39/replication_package/Do/FigureA12.do
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A12
|
4 |
+
*** Geographic Spillovers
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\distance_spillovers.dta", clear
|
8 |
+
|
9 |
+
g black_ps = black / n_stops
|
10 |
+
|
11 |
+
mat treat = J(15,4,1)
|
12 |
+
|
13 |
+
qui:{
|
14 |
+
forval kk = 10(10)150 {
|
15 |
+
|
16 |
+
noisily: di `kk' "km out of 150"
|
17 |
+
|
18 |
+
g TRUMP_POST_1_30_`kk'km = 0
|
19 |
+
forval ii = 1/30 {
|
20 |
+
replace TRUMP_POST_1_30_`kk'km = 1 if (dist_event_`kk'km_`ii' > 0 & dist_event_`kk'km_`ii'<=30 & dist_event_`kk'km_`ii'!=.)
|
21 |
+
}
|
22 |
+
g TRUMP_POST_M30_`kk'km = 0
|
23 |
+
forval ii = 1/30 {
|
24 |
+
replace TRUMP_POST_M30_`kk'km = 1 if (dist_event_`kk'km_`ii' >30 & dist_event_`kk'km_`ii'!=.)
|
25 |
+
}
|
26 |
+
|
27 |
+
g TRUMP_PRE_M30_`kk'km = 0
|
28 |
+
forval ii = 1/30 {
|
29 |
+
replace TRUMP_PRE_M30_`kk'km = 1 if (dist_event_`kk'km_`ii' <-30 & dist_event_`kk'km_`ii'!=.)
|
30 |
+
}
|
31 |
+
|
32 |
+
|
33 |
+
noisily: reghdfe black_ps 1.TRUMP_*_`kk'km [w=n_stops], a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_fips day_id )
|
34 |
+
|
35 |
+
|
36 |
+
lincom (1.TRUMP_POST_1_30_`kk'km)
|
37 |
+
|
38 |
+
local pos = `kk'/10
|
39 |
+
mat treat[`pos',1] = `kk'
|
40 |
+
mat treat[`pos',2] = r(estimate)
|
41 |
+
mat treat[`pos',3] = r(estimate) + r(se)*invttail(e(N),0.025)
|
42 |
+
mat treat[`pos',4] = r(estimate) - r(se)*invttail(e(N),0.025)
|
43 |
+
|
44 |
+
}
|
45 |
+
}
|
46 |
+
g xx = treat[_n,1] in 1/15
|
47 |
+
|
48 |
+
g eff = treat[_n,2] in 1/15
|
49 |
+
g eff10 = treat[_n,3] in 1/15
|
50 |
+
g eff90 = treat[_n,4] in 1/15
|
51 |
+
|
52 |
+
twoway (rcap eff10 eff90 xx) (scatter eff xx,yline(0,lp(-) lc(red))) , scheme(s1mono) title(" ") ytitle("Effect of Trump Rally") xtitle(Distance in Km) xlabel(10 "(0,10)" 20 "(0,20)" 30 "(0,30)" 40 "(0,40)" 50 "(0,50)" 60 "(0,60)" 70 "(0,70)" 80 "(0,80)" 90 "(0,90)" 100 "(0,100)" 110 "(0,110)" 120 "(0,120)" 130 "(0,130)" 140 "(0,140)" 150 "(0,150)", angle(45)) legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
53 |
+
graph export "Results\FigureA12.pdf", as(pdf) name("Graph") replace
|
39/replication_package/Do/FigureA13.do
ADDED
@@ -0,0 +1,954 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A13
|
4 |
+
*** Role of Local Characteristics in the Effect of Trump Rallies on the
|
5 |
+
*** Probability of a Black Stop: Event-study Results
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
g n_stops = 1
|
11 |
+
replace black = black/100
|
12 |
+
|
13 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec any_slaves_1860, by(county_fips day_id)
|
14 |
+
|
15 |
+
g black_ps = 100*black / n_stops
|
16 |
+
|
17 |
+
summ racial_resent_a [aweight=n_stops]
|
18 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
19 |
+
|
20 |
+
summ racial_resent_b [aweight=n_stops]
|
21 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
22 |
+
|
23 |
+
summ alt_cottonsui [aweight=n_stops]
|
24 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
25 |
+
|
26 |
+
su ihsbl_lynch [aweight=n_stops]
|
27 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
28 |
+
|
29 |
+
su ihsbl_exec [aweight=n_stops]
|
30 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
31 |
+
|
32 |
+
local start = -105
|
33 |
+
local end = 105
|
34 |
+
local bin_l = 15
|
35 |
+
local var_het = "racial_resent_a"
|
36 |
+
|
37 |
+
g TRUMP_0 = 0
|
38 |
+
forval ii = 1/9 {
|
39 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
40 |
+
}
|
41 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
42 |
+
|
43 |
+
forval ii = 1(`bin_l')`end'{
|
44 |
+
local jj = `ii' + `bin_l' - 1
|
45 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
46 |
+
forval ee = 1/9 {
|
47 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
48 |
+
}
|
49 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
50 |
+
}
|
51 |
+
g TRUMP_POST_M`end' = 0
|
52 |
+
forval ii = 1/9 {
|
53 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
54 |
+
}
|
55 |
+
*
|
56 |
+
|
57 |
+
forval ii = `start'(`bin_l')0 {
|
58 |
+
if `ii' < -`bin_l' {
|
59 |
+
local jj = abs(`ii')
|
60 |
+
local zz = `jj' - `bin_l' + 1
|
61 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
62 |
+
forval ee = 1/9 {
|
63 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
64 |
+
}
|
65 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
66 |
+
}
|
67 |
+
}
|
68 |
+
*
|
69 |
+
|
70 |
+
local jj = abs(`start')
|
71 |
+
g TRUMP_PRE_M`jj' = 0
|
72 |
+
forval ii = 1/9 {
|
73 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
74 |
+
}
|
75 |
+
*
|
76 |
+
g TRUMP_POST_M15 = 0
|
77 |
+
forval ii = 1/9 {
|
78 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
79 |
+
}
|
80 |
+
|
81 |
+
g TRUMP_PRE_M15 = 0
|
82 |
+
forval ii = 1/9 {
|
83 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
84 |
+
}
|
85 |
+
|
86 |
+
g TRUMP_POST_1_30 = 0
|
87 |
+
forval ii = 1/9 {
|
88 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
89 |
+
}
|
90 |
+
|
91 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
92 |
+
|
93 |
+
local temp = 1/`bin_l'
|
94 |
+
local bin_neg = abs(`start' * `temp')
|
95 |
+
local bin_pos = `end' * `temp'
|
96 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
97 |
+
|
98 |
+
mat treat = J(`range',4,1)
|
99 |
+
|
100 |
+
local Nrange = `range' - 2
|
101 |
+
|
102 |
+
forval pos = 1/`Nrange' {
|
103 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
104 |
+
if `lag' > 0 {
|
105 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
106 |
+
}
|
107 |
+
|
108 |
+
local num = abs(`lag')
|
109 |
+
|
110 |
+
if `lag' == 0 {
|
111 |
+
mat treat[`pos',1] = 0
|
112 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
113 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
114 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
115 |
+
}
|
116 |
+
else if `lag' < -`bin_l' {
|
117 |
+
local num2 = `num' - `bin_l' + 1
|
118 |
+
local num1 = - `num'
|
119 |
+
mat treat[`pos',1] = `num1'
|
120 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
121 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
122 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
123 |
+
}
|
124 |
+
else if `lag' == -`bin_l' {
|
125 |
+
mat treat[`pos',1] = -`bin_l'
|
126 |
+
mat treat[`pos',2] = 0
|
127 |
+
mat treat[`pos',3] = 0
|
128 |
+
mat treat[`pos',4] = 0
|
129 |
+
}
|
130 |
+
else {
|
131 |
+
di "**"
|
132 |
+
di `lag'
|
133 |
+
di `pos'
|
134 |
+
local num2 = `num' + `bin_l' - 1
|
135 |
+
mat treat[`pos',1] = `num2'
|
136 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
137 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
138 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
139 |
+
}
|
140 |
+
}
|
141 |
+
local jj = abs(`start')
|
142 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
143 |
+
mat treat[`range'-1,2] = 0
|
144 |
+
mat treat[`range'-1,3] = 0
|
145 |
+
mat treat[`range'-1,4] = 0
|
146 |
+
|
147 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
148 |
+
mat treat[`range',2] = 0
|
149 |
+
mat treat[`range',3] = 0
|
150 |
+
mat treat[`range',4] = 0
|
151 |
+
|
152 |
+
|
153 |
+
g yy = treat[_n,1] in 1/`range'
|
154 |
+
g eff = treat[_n,2] in 1/`range'
|
155 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
156 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
157 |
+
sort yy
|
158 |
+
|
159 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Racial Resentment A") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
160 |
+
graph export "Results\FigureA13A.pdf", as(pdf) name("Graph") replace
|
161 |
+
|
162 |
+
******************************************************************************************************************************************************************
|
163 |
+
|
164 |
+
use "Data\stoplevel_data.dta", clear
|
165 |
+
|
166 |
+
g n_stops = 1
|
167 |
+
replace black = black/100
|
168 |
+
|
169 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec, by(county_fips day_id)
|
170 |
+
|
171 |
+
g black_ps = 100*black / n_stops
|
172 |
+
|
173 |
+
summ racial_resent_a [aweight=n_stops]
|
174 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
175 |
+
|
176 |
+
summ racial_resent_b [aweight=n_stops]
|
177 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
178 |
+
|
179 |
+
summ alt_cottonsui [aweight=n_stops]
|
180 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
181 |
+
|
182 |
+
su ihsbl_lynch [aweight=n_stops]
|
183 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
184 |
+
|
185 |
+
su ihsbl_exec [aweight=n_stops]
|
186 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
187 |
+
|
188 |
+
local start = -105
|
189 |
+
local end = 105
|
190 |
+
local bin_l = 15
|
191 |
+
local var_het = "racial_resent_b"
|
192 |
+
|
193 |
+
g TRUMP_0 = 0
|
194 |
+
forval ii = 1/9 {
|
195 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
196 |
+
}
|
197 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
198 |
+
*
|
199 |
+
|
200 |
+
forval ii = 1(`bin_l')`end'{
|
201 |
+
local jj = `ii' + `bin_l' - 1
|
202 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
203 |
+
forval ee = 1/9 {
|
204 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
205 |
+
}
|
206 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
207 |
+
}
|
208 |
+
g TRUMP_POST_M`end' = 0
|
209 |
+
forval ii = 1/9 {
|
210 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
211 |
+
}
|
212 |
+
*
|
213 |
+
|
214 |
+
forval ii = `start'(`bin_l')0 {
|
215 |
+
if `ii' < -`bin_l' {
|
216 |
+
local jj = abs(`ii')
|
217 |
+
local zz = `jj' - `bin_l' + 1
|
218 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
219 |
+
forval ee = 1/9 {
|
220 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
221 |
+
}
|
222 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
223 |
+
}
|
224 |
+
}
|
225 |
+
*
|
226 |
+
|
227 |
+
local jj = abs(`start')
|
228 |
+
g TRUMP_PRE_M`jj' = 0
|
229 |
+
forval ii = 1/9 {
|
230 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
231 |
+
}
|
232 |
+
*
|
233 |
+
g TRUMP_POST_M15 = 0
|
234 |
+
forval ii = 1/9 {
|
235 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
236 |
+
}
|
237 |
+
|
238 |
+
g TRUMP_PRE_M15 = 0
|
239 |
+
forval ii = 1/9 {
|
240 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
241 |
+
}
|
242 |
+
|
243 |
+
g TRUMP_POST_1_30 = 0
|
244 |
+
forval ii = 1/9 {
|
245 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
246 |
+
}
|
247 |
+
|
248 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
249 |
+
|
250 |
+
local temp = 1/`bin_l'
|
251 |
+
local bin_neg = abs(`start' * `temp')
|
252 |
+
local bin_pos = `end' * `temp'
|
253 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
254 |
+
|
255 |
+
mat treat = J(`range',4,1)
|
256 |
+
|
257 |
+
local Nrange = `range' - 2
|
258 |
+
|
259 |
+
forval pos = 1/`Nrange' {
|
260 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
261 |
+
if `lag' > 0 {
|
262 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
263 |
+
}
|
264 |
+
|
265 |
+
local num = abs(`lag')
|
266 |
+
|
267 |
+
if `lag' == 0 {
|
268 |
+
mat treat[`pos',1] = 0
|
269 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
270 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
271 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
272 |
+
}
|
273 |
+
else if `lag' < -`bin_l' {
|
274 |
+
local num2 = `num' - `bin_l' + 1
|
275 |
+
local num1 = - `num'
|
276 |
+
mat treat[`pos',1] = `num1'
|
277 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
278 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
279 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
280 |
+
}
|
281 |
+
else if `lag' == -`bin_l' {
|
282 |
+
mat treat[`pos',1] = -`bin_l'
|
283 |
+
mat treat[`pos',2] = 0
|
284 |
+
mat treat[`pos',3] = 0
|
285 |
+
mat treat[`pos',4] = 0
|
286 |
+
}
|
287 |
+
else {
|
288 |
+
di "**"
|
289 |
+
di `lag'
|
290 |
+
di `pos'
|
291 |
+
local num2 = `num' + `bin_l' - 1
|
292 |
+
mat treat[`pos',1] = `num2'
|
293 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
294 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
295 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
296 |
+
}
|
297 |
+
}
|
298 |
+
local jj = abs(`start')
|
299 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
300 |
+
mat treat[`range'-1,2] = 0
|
301 |
+
mat treat[`range'-1,3] = 0
|
302 |
+
mat treat[`range'-1,4] = 0
|
303 |
+
|
304 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
305 |
+
mat treat[`range',2] = 0
|
306 |
+
mat treat[`range',3] = 0
|
307 |
+
mat treat[`range',4] = 0
|
308 |
+
|
309 |
+
g yy = treat[_n,1] in 1/`range'
|
310 |
+
g eff = treat[_n,2] in 1/`range'
|
311 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
312 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
313 |
+
sort yy
|
314 |
+
|
315 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Racial Resentment B") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
316 |
+
graph export "Results\FigureA13B.pdf", as(pdf) name("Graph") replace
|
317 |
+
|
318 |
+
******************************************************************************************************************************************************************
|
319 |
+
|
320 |
+
use "Data\stoplevel_data.dta", clear
|
321 |
+
|
322 |
+
g n_stops = 1
|
323 |
+
replace black = black/100
|
324 |
+
|
325 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec any_slaves_1860, by(county_fips day_id)
|
326 |
+
|
327 |
+
g black_ps = 100*black / n_stops
|
328 |
+
|
329 |
+
summ racial_resent_a [aweight=n_stops]
|
330 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
331 |
+
|
332 |
+
summ racial_resent_b [aweight=n_stops]
|
333 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
334 |
+
|
335 |
+
summ alt_cottonsui [aweight=n_stops]
|
336 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
337 |
+
|
338 |
+
su ihsbl_lynch [aweight=n_stops]
|
339 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
340 |
+
|
341 |
+
su ihsbl_exec [aweight=n_stops]
|
342 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
343 |
+
|
344 |
+
local start = -105
|
345 |
+
local end = 105
|
346 |
+
local bin_l = 15
|
347 |
+
local var_het = "any_slaves_1860"
|
348 |
+
|
349 |
+
g TRUMP_0 = 0
|
350 |
+
forval ii = 1/9 {
|
351 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
352 |
+
}
|
353 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
354 |
+
*
|
355 |
+
|
356 |
+
forval ii = 1(`bin_l')`end'{
|
357 |
+
local jj = `ii' + `bin_l' - 1
|
358 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
359 |
+
forval ee = 1/9 {
|
360 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
361 |
+
}
|
362 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
363 |
+
}
|
364 |
+
g TRUMP_POST_M`end' = 0
|
365 |
+
forval ii = 1/9 {
|
366 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
367 |
+
}
|
368 |
+
*
|
369 |
+
|
370 |
+
forval ii = `start'(`bin_l')0 {
|
371 |
+
if `ii' < -`bin_l' {
|
372 |
+
local jj = abs(`ii')
|
373 |
+
local zz = `jj' - `bin_l' + 1
|
374 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
375 |
+
forval ee = 1/9 {
|
376 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
377 |
+
}
|
378 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
379 |
+
}
|
380 |
+
}
|
381 |
+
*
|
382 |
+
|
383 |
+
local jj = abs(`start')
|
384 |
+
g TRUMP_PRE_M`jj' = 0
|
385 |
+
forval ii = 1/9 {
|
386 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
387 |
+
}
|
388 |
+
*
|
389 |
+
g TRUMP_POST_M15 = 0
|
390 |
+
forval ii = 1/9 {
|
391 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
392 |
+
}
|
393 |
+
|
394 |
+
g TRUMP_PRE_M15 = 0
|
395 |
+
forval ii = 1/9 {
|
396 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
397 |
+
}
|
398 |
+
|
399 |
+
g TRUMP_POST_1_30 = 0
|
400 |
+
forval ii = 1/9 {
|
401 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
402 |
+
}
|
403 |
+
|
404 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
405 |
+
|
406 |
+
local temp = 1/`bin_l'
|
407 |
+
local bin_neg = abs(`start' * `temp')
|
408 |
+
local bin_pos = `end' * `temp'
|
409 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
410 |
+
|
411 |
+
mat treat = J(`range',4,1)
|
412 |
+
|
413 |
+
|
414 |
+
local Nrange = `range' - 2
|
415 |
+
|
416 |
+
forval pos = 1/`Nrange' {
|
417 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
418 |
+
if `lag' > 0 {
|
419 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
420 |
+
}
|
421 |
+
|
422 |
+
local num = abs(`lag')
|
423 |
+
|
424 |
+
if `lag' == 0 {
|
425 |
+
mat treat[`pos',1] = 0
|
426 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
427 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
428 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
429 |
+
}
|
430 |
+
else if `lag' < -`bin_l' {
|
431 |
+
local num2 = `num' - `bin_l' + 1
|
432 |
+
local num1 = - `num'
|
433 |
+
mat treat[`pos',1] = `num1'
|
434 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
435 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
436 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
437 |
+
}
|
438 |
+
else if `lag' == -`bin_l' {
|
439 |
+
mat treat[`pos',1] = -`bin_l'
|
440 |
+
mat treat[`pos',2] = 0
|
441 |
+
mat treat[`pos',3] = 0
|
442 |
+
mat treat[`pos',4] = 0
|
443 |
+
}
|
444 |
+
else {
|
445 |
+
di "**"
|
446 |
+
di `lag'
|
447 |
+
di `pos'
|
448 |
+
local num2 = `num' + `bin_l' - 1
|
449 |
+
mat treat[`pos',1] = `num2'
|
450 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
451 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
452 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
453 |
+
}
|
454 |
+
}
|
455 |
+
local jj = abs(`start')
|
456 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
457 |
+
mat treat[`range'-1,2] = 0
|
458 |
+
mat treat[`range'-1,3] = 0
|
459 |
+
mat treat[`range'-1,4] = 0
|
460 |
+
|
461 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
462 |
+
mat treat[`range',2] = 0
|
463 |
+
mat treat[`range',3] = 0
|
464 |
+
mat treat[`range',4] = 0
|
465 |
+
|
466 |
+
|
467 |
+
g yy = treat[_n,1] in 1/`range'
|
468 |
+
g eff = treat[_n,2] in 1/`range'
|
469 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
470 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
471 |
+
sort yy
|
472 |
+
|
473 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Presence of Slaves") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
474 |
+
graph export "Results\FigureA13C.pdf", as(pdf) name("Graph") replace
|
475 |
+
|
476 |
+
|
477 |
+
******************************************************************************************************************************************************************
|
478 |
+
|
479 |
+
use "Data\stoplevel_data.dta", clear
|
480 |
+
|
481 |
+
g n_stops = 1
|
482 |
+
replace black = black/100
|
483 |
+
|
484 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec, by(county_fips day_id)
|
485 |
+
|
486 |
+
g black_ps = 100*black / n_stops
|
487 |
+
|
488 |
+
summ racial_resent_a [aweight=n_stops]
|
489 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
490 |
+
|
491 |
+
summ racial_resent_b [aweight=n_stops]
|
492 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
493 |
+
|
494 |
+
summ alt_cottonsui [aweight=n_stops]
|
495 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
496 |
+
|
497 |
+
su ihsbl_lynch [aweight=n_stops]
|
498 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
499 |
+
|
500 |
+
su ihsbl_exec [aweight=n_stops]
|
501 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
502 |
+
|
503 |
+
local start = -105
|
504 |
+
local end = 105
|
505 |
+
local bin_l = 15
|
506 |
+
local var_het = "alt_cottonsui"
|
507 |
+
|
508 |
+
g TRUMP_0 = 0
|
509 |
+
forval ii = 1/9 {
|
510 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
511 |
+
}
|
512 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
513 |
+
*
|
514 |
+
|
515 |
+
forval ii = 1(`bin_l')`end'{
|
516 |
+
local jj = `ii' + `bin_l' - 1
|
517 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
518 |
+
forval ee = 1/9 {
|
519 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
520 |
+
}
|
521 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
522 |
+
}
|
523 |
+
g TRUMP_POST_M`end' = 0
|
524 |
+
forval ii = 1/9 {
|
525 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
526 |
+
}
|
527 |
+
*
|
528 |
+
|
529 |
+
forval ii = `start'(`bin_l')0 {
|
530 |
+
if `ii' < -`bin_l' {
|
531 |
+
local jj = abs(`ii')
|
532 |
+
local zz = `jj' - `bin_l' + 1
|
533 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
534 |
+
forval ee = 1/9 {
|
535 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
536 |
+
}
|
537 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
538 |
+
}
|
539 |
+
}
|
540 |
+
*
|
541 |
+
|
542 |
+
local jj = abs(`start')
|
543 |
+
g TRUMP_PRE_M`jj' = 0
|
544 |
+
forval ii = 1/9 {
|
545 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
546 |
+
}
|
547 |
+
*
|
548 |
+
g TRUMP_POST_M15 = 0
|
549 |
+
forval ii = 1/9 {
|
550 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
551 |
+
}
|
552 |
+
|
553 |
+
g TRUMP_PRE_M15 = 0
|
554 |
+
forval ii = 1/9 {
|
555 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
556 |
+
}
|
557 |
+
|
558 |
+
g TRUMP_POST_1_30 = 0
|
559 |
+
forval ii = 1/9 {
|
560 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
561 |
+
}
|
562 |
+
|
563 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
564 |
+
|
565 |
+
local temp = 1/`bin_l'
|
566 |
+
local bin_neg = abs(`start' * `temp')
|
567 |
+
local bin_pos = `end' * `temp'
|
568 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
569 |
+
|
570 |
+
mat treat = J(`range',4,1)
|
571 |
+
|
572 |
+
local Nrange = `range' - 2
|
573 |
+
|
574 |
+
forval pos = 1/`Nrange' {
|
575 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
576 |
+
if `lag' > 0 {
|
577 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
578 |
+
}
|
579 |
+
|
580 |
+
local num = abs(`lag')
|
581 |
+
|
582 |
+
if `lag' == 0 {
|
583 |
+
mat treat[`pos',1] = 0
|
584 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
585 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
586 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
587 |
+
}
|
588 |
+
else if `lag' < -`bin_l' {
|
589 |
+
local num2 = `num' - `bin_l' + 1
|
590 |
+
local num1 = - `num'
|
591 |
+
mat treat[`pos',1] = `num1'
|
592 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
593 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
594 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
595 |
+
}
|
596 |
+
else if `lag' == -`bin_l' {
|
597 |
+
mat treat[`pos',1] = -`bin_l'
|
598 |
+
mat treat[`pos',2] = 0
|
599 |
+
mat treat[`pos',3] = 0
|
600 |
+
mat treat[`pos',4] = 0
|
601 |
+
}
|
602 |
+
else {
|
603 |
+
di "**"
|
604 |
+
di `lag'
|
605 |
+
di `pos'
|
606 |
+
local num2 = `num' + `bin_l' - 1
|
607 |
+
mat treat[`pos',1] = `num2'
|
608 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
609 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
610 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
611 |
+
}
|
612 |
+
}
|
613 |
+
local jj = abs(`start')
|
614 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
615 |
+
mat treat[`range'-1,2] = 0
|
616 |
+
mat treat[`range'-1,3] = 0
|
617 |
+
mat treat[`range'-1,4] = 0
|
618 |
+
|
619 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
620 |
+
mat treat[`range',2] = 0
|
621 |
+
mat treat[`range',3] = 0
|
622 |
+
mat treat[`range',4] = 0
|
623 |
+
|
624 |
+
|
625 |
+
g yy = treat[_n,1] in 1/`range'
|
626 |
+
g eff = treat[_n,2] in 1/`range'
|
627 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
628 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
629 |
+
sort yy
|
630 |
+
|
631 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Cotton Suitability") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
632 |
+
graph export "Results\FigureA13D.pdf", as(pdf) name("Graph") replace
|
633 |
+
|
634 |
+
******************************************************************************************************************************************************************
|
635 |
+
|
636 |
+
use "Data\stoplevel_data.dta", clear
|
637 |
+
|
638 |
+
g n_stops = 1
|
639 |
+
replace black = black/100
|
640 |
+
|
641 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec, by(county_fips day_id)
|
642 |
+
|
643 |
+
g black_ps = 100*black / n_stops
|
644 |
+
|
645 |
+
summ racial_resent_a [aweight=n_stops]
|
646 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
647 |
+
|
648 |
+
summ racial_resent_b [aweight=n_stops]
|
649 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
650 |
+
|
651 |
+
summ alt_cottonsui [aweight=n_stops]
|
652 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
653 |
+
|
654 |
+
su ihsbl_lynch [aweight=n_stops]
|
655 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
656 |
+
|
657 |
+
su ihsbl_exec [aweight=n_stops]
|
658 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
659 |
+
|
660 |
+
local start = -105
|
661 |
+
local end = 105
|
662 |
+
local bin_l = 15
|
663 |
+
local var_het = "ihsbl_lynch"
|
664 |
+
|
665 |
+
g TRUMP_0 = 0
|
666 |
+
forval ii = 1/9 {
|
667 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
668 |
+
}
|
669 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
670 |
+
*
|
671 |
+
|
672 |
+
forval ii = 1(`bin_l')`end'{
|
673 |
+
local jj = `ii' + `bin_l' - 1
|
674 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
675 |
+
forval ee = 1/9 {
|
676 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
677 |
+
}
|
678 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
679 |
+
}
|
680 |
+
g TRUMP_POST_M`end' = 0
|
681 |
+
forval ii = 1/9 {
|
682 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
683 |
+
}
|
684 |
+
*
|
685 |
+
|
686 |
+
forval ii = `start'(`bin_l')0 {
|
687 |
+
if `ii' < -`bin_l' {
|
688 |
+
local jj = abs(`ii')
|
689 |
+
local zz = `jj' - `bin_l' + 1
|
690 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
691 |
+
forval ee = 1/9 {
|
692 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
693 |
+
}
|
694 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
695 |
+
}
|
696 |
+
}
|
697 |
+
*
|
698 |
+
|
699 |
+
local jj = abs(`start')
|
700 |
+
g TRUMP_PRE_M`jj' = 0
|
701 |
+
forval ii = 1/9 {
|
702 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
703 |
+
}
|
704 |
+
*
|
705 |
+
g TRUMP_POST_M15 = 0
|
706 |
+
forval ii = 1/9 {
|
707 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
708 |
+
}
|
709 |
+
|
710 |
+
g TRUMP_PRE_M15 = 0
|
711 |
+
forval ii = 1/9 {
|
712 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
713 |
+
}
|
714 |
+
|
715 |
+
g TRUMP_POST_1_30 = 0
|
716 |
+
forval ii = 1/9 {
|
717 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
718 |
+
}
|
719 |
+
|
720 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
721 |
+
|
722 |
+
local temp = 1/`bin_l'
|
723 |
+
local bin_neg = abs(`start' * `temp')
|
724 |
+
local bin_pos = `end' * `temp'
|
725 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
726 |
+
|
727 |
+
mat treat = J(`range',4,1)
|
728 |
+
|
729 |
+
local Nrange = `range' - 2
|
730 |
+
|
731 |
+
forval pos = 1/`Nrange' {
|
732 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
733 |
+
if `lag' > 0 {
|
734 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
735 |
+
}
|
736 |
+
|
737 |
+
local num = abs(`lag')
|
738 |
+
|
739 |
+
if `lag' == 0 {
|
740 |
+
mat treat[`pos',1] = 0
|
741 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
742 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
743 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
744 |
+
}
|
745 |
+
else if `lag' < -`bin_l' {
|
746 |
+
local num2 = `num' - `bin_l' + 1
|
747 |
+
local num1 = - `num'
|
748 |
+
mat treat[`pos',1] = `num1'
|
749 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
750 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
751 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
752 |
+
}
|
753 |
+
else if `lag' == -`bin_l' {
|
754 |
+
mat treat[`pos',1] = -`bin_l'
|
755 |
+
mat treat[`pos',2] = 0
|
756 |
+
mat treat[`pos',3] = 0
|
757 |
+
mat treat[`pos',4] = 0
|
758 |
+
}
|
759 |
+
else {
|
760 |
+
di "**"
|
761 |
+
di `lag'
|
762 |
+
di `pos'
|
763 |
+
local num2 = `num' + `bin_l' - 1
|
764 |
+
mat treat[`pos',1] = `num2'
|
765 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
766 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
767 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
768 |
+
}
|
769 |
+
}
|
770 |
+
local jj = abs(`start')
|
771 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
772 |
+
mat treat[`range'-1,2] = 0
|
773 |
+
mat treat[`range'-1,3] = 0
|
774 |
+
mat treat[`range'-1,4] = 0
|
775 |
+
|
776 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
777 |
+
mat treat[`range',2] = 0
|
778 |
+
mat treat[`range',3] = 0
|
779 |
+
mat treat[`range',4] = 0
|
780 |
+
|
781 |
+
|
782 |
+
g yy = treat[_n,1] in 1/`range'
|
783 |
+
g eff = treat[_n,2] in 1/`range'
|
784 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
785 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
786 |
+
sort yy
|
787 |
+
|
788 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Lynchings") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
789 |
+
graph export "Results\FigureA13E.pdf", as(pdf) name("Graph") replace
|
790 |
+
|
791 |
+
******************************************************************************************************************************************************************
|
792 |
+
|
793 |
+
use "Data\stoplevel_data.dta", clear
|
794 |
+
|
795 |
+
g n_stops = 1
|
796 |
+
replace black = black/100
|
797 |
+
|
798 |
+
collapse (sum) n_stops black (first) dist_event* racial_resent_a racial_resent_b alt_cottonsui ihsbl_lynch ihsbl_exec, by(county_fips day_id)
|
799 |
+
|
800 |
+
g black_ps = 100*black / n_stops
|
801 |
+
|
802 |
+
summ racial_resent_a [aweight=n_stops]
|
803 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
804 |
+
|
805 |
+
summ racial_resent_b [aweight=n_stops]
|
806 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
807 |
+
|
808 |
+
summ alt_cottonsui [aweight=n_stops]
|
809 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
810 |
+
|
811 |
+
su ihsbl_lynch [aweight=n_stops]
|
812 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
813 |
+
|
814 |
+
su ihsbl_exec [aweight=n_stops]
|
815 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
816 |
+
|
817 |
+
local start = -105
|
818 |
+
local end = 105
|
819 |
+
local bin_l = 15
|
820 |
+
local var_het = "ihsbl_exec"
|
821 |
+
|
822 |
+
g TRUMP_0 = 0
|
823 |
+
forval ii = 1/9 {
|
824 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
825 |
+
}
|
826 |
+
g INT_TRUMP_0 = TRUMP_0 * `var_het'
|
827 |
+
*
|
828 |
+
|
829 |
+
forval ii = 1(`bin_l')`end'{
|
830 |
+
local jj = `ii' + `bin_l' - 1
|
831 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
832 |
+
forval ee = 1/9 {
|
833 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
834 |
+
}
|
835 |
+
g INT_TRUMP_POST_`ii'_`jj' = TRUMP_POST_`ii'_`jj' * `var_het'
|
836 |
+
}
|
837 |
+
g TRUMP_POST_M`end' = 0
|
838 |
+
forval ii = 1/9 {
|
839 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
840 |
+
}
|
841 |
+
*
|
842 |
+
|
843 |
+
forval ii = `start'(`bin_l')0 {
|
844 |
+
if `ii' < -`bin_l' {
|
845 |
+
local jj = abs(`ii')
|
846 |
+
local zz = `jj' - `bin_l' + 1
|
847 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
848 |
+
forval ee = 1/9 {
|
849 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
850 |
+
}
|
851 |
+
g INT_TRUMP_PRE_`jj'_`zz' = TRUMP_PRE_`jj'_`zz' * `var_het'
|
852 |
+
}
|
853 |
+
}
|
854 |
+
*
|
855 |
+
|
856 |
+
local jj = abs(`start')
|
857 |
+
g TRUMP_PRE_M`jj' = 0
|
858 |
+
forval ii = 1/9 {
|
859 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
860 |
+
}
|
861 |
+
*
|
862 |
+
g TRUMP_POST_M15 = 0
|
863 |
+
forval ii = 1/9 {
|
864 |
+
replace TRUMP_POST_M15 = 1 if (dist_event`ii' >15 & dist_event`ii'!=.)
|
865 |
+
}
|
866 |
+
|
867 |
+
g TRUMP_PRE_M15 = 0
|
868 |
+
forval ii = 1/9 {
|
869 |
+
replace TRUMP_PRE_M15 = 1 if (dist_event`ii' <-15 & dist_event`ii'!=.)
|
870 |
+
}
|
871 |
+
|
872 |
+
g TRUMP_POST_1_30 = 0
|
873 |
+
forval ii = 1/9 {
|
874 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
875 |
+
}
|
876 |
+
|
877 |
+
reghdfe black_ps 1.TRUMP_PRE_M15 1.TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M15 INT_* c.day_id#c.`var_het' [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
878 |
+
|
879 |
+
local temp = 1/`bin_l'
|
880 |
+
local bin_neg = abs(`start' * `temp')
|
881 |
+
local bin_pos = `end' * `temp'
|
882 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
883 |
+
|
884 |
+
mat treat = J(`range',4,1)
|
885 |
+
|
886 |
+
local Nrange = `range' - 2
|
887 |
+
|
888 |
+
forval pos = 1/`Nrange' {
|
889 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
890 |
+
if `lag' > 0 {
|
891 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
892 |
+
}
|
893 |
+
|
894 |
+
local num = abs(`lag')
|
895 |
+
|
896 |
+
if `lag' == 0 {
|
897 |
+
mat treat[`pos',1] = 0
|
898 |
+
mat treat[`pos',2] = _b[INT_TRUMP_0]
|
899 |
+
mat treat[`pos',3] = _b[INT_TRUMP_0] + _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
900 |
+
mat treat[`pos',4] = _b[INT_TRUMP_0] - _se[INT_TRUMP_0]*invttail(e(N),0.05)
|
901 |
+
}
|
902 |
+
else if `lag' < -`bin_l' {
|
903 |
+
local num2 = `num' - `bin_l' + 1
|
904 |
+
local num1 = - `num'
|
905 |
+
mat treat[`pos',1] = `num1'
|
906 |
+
mat treat[`pos',2] = _b[INT_TRUMP_PRE_`num'_`num2']
|
907 |
+
mat treat[`pos',3] = _b[INT_TRUMP_PRE_`num'_`num2'] + _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
908 |
+
mat treat[`pos',4] = _b[INT_TRUMP_PRE_`num'_`num2'] - _se[INT_TRUMP_PRE_`num'_`num2']*invttail(e(N),0.05)
|
909 |
+
}
|
910 |
+
else if `lag' == -`bin_l' {
|
911 |
+
mat treat[`pos',1] = -`bin_l'
|
912 |
+
mat treat[`pos',2] = 0
|
913 |
+
mat treat[`pos',3] = 0
|
914 |
+
mat treat[`pos',4] = 0
|
915 |
+
}
|
916 |
+
else {
|
917 |
+
di "**"
|
918 |
+
di `lag'
|
919 |
+
di `pos'
|
920 |
+
local num2 = `num' + `bin_l' - 1
|
921 |
+
mat treat[`pos',1] = `num2'
|
922 |
+
mat treat[`pos',2] = _b[INT_TRUMP_POST_`num'_`num2']
|
923 |
+
mat treat[`pos',3] = _b[INT_TRUMP_POST_`num'_`num2'] + _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
924 |
+
mat treat[`pos',4] = _b[INT_TRUMP_POST_`num'_`num2'] - _se[INT_TRUMP_POST_`num'_`num2']*invttail(e(N),0.05)
|
925 |
+
}
|
926 |
+
}
|
927 |
+
local jj = abs(`start')
|
928 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
929 |
+
mat treat[`range'-1,2] = 0
|
930 |
+
mat treat[`range'-1,3] = 0
|
931 |
+
mat treat[`range'-1,4] = 0
|
932 |
+
|
933 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
934 |
+
mat treat[`range',2] = 0
|
935 |
+
mat treat[`range',3] = 0
|
936 |
+
mat treat[`range',4] = 0
|
937 |
+
|
938 |
+
g yy = treat[_n,1] in 1/`range'
|
939 |
+
g eff = treat[_n,2] in 1/`range'
|
940 |
+
g eff_10 = treat[_n,3] in 1/`range'
|
941 |
+
g eff_90 = treat[_n,4] in 1/`range'
|
942 |
+
sort yy
|
943 |
+
|
944 |
+
|
945 |
+
twoway (rcap eff_10 eff_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1) (scatter eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1)(line eff yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) graphregion(fcolor(white)) title("Executions") xtitle("Days From Trump") ytitle("Differential Trump Effect on Black Stops by") legend(order(1 "90% CI" 2 "Effect"))
|
946 |
+
graph export "Results\FigureA13F.pdf", as(pdf) name("Graph") replace
|
947 |
+
|
948 |
+
|
949 |
+
|
950 |
+
|
951 |
+
|
952 |
+
|
953 |
+
|
954 |
+
|
39/replication_package/Do/FigureA2.do
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A2
|
4 |
+
*** Impact of Trump Rallies on the Probability of a Black Stop: Event-study
|
5 |
+
*** Results Without County-specific Linear Trends
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
global start = -105
|
9 |
+
global end = 105
|
10 |
+
global bin_l = 15
|
11 |
+
|
12 |
+
use "Data\stoplevel_data.dta", clear
|
13 |
+
|
14 |
+
g n_stops = 1
|
15 |
+
foreach var of varlist black hispanic white api {
|
16 |
+
replace `var' = `var'/100
|
17 |
+
}
|
18 |
+
|
19 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
20 |
+
|
21 |
+
g black_ps = 100*black / n_stops
|
22 |
+
g hispanic_ps = 100*hispanic / n_stops
|
23 |
+
g white_ps = 100*white / n_stops
|
24 |
+
g asian_ps = 100*api / n_stops
|
25 |
+
g ln_stops = ln(n_stops)
|
26 |
+
|
27 |
+
g TRUMP_0 = 0
|
28 |
+
forval ii = 1/9 {
|
29 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
30 |
+
}
|
31 |
+
|
32 |
+
forval ii = 1($bin_l)$end{
|
33 |
+
local jj = `ii' + $bin_l - 1
|
34 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
35 |
+
forval ee = 1/9 {
|
36 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
g TRUMP_POST_M$end = 0
|
41 |
+
forval ii = 1/9 {
|
42 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
43 |
+
}
|
44 |
+
|
45 |
+
forval ii = $start($bin_l)0 {
|
46 |
+
if `ii' < -$bin_l {
|
47 |
+
local jj = abs(`ii')
|
48 |
+
local zz = `jj' - $bin_l + 1
|
49 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
50 |
+
forval ee = 1/9 {
|
51 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
local jj = abs($start)
|
57 |
+
g TRUMP_PRE_M`jj' = 0
|
58 |
+
forval ii = 1/9 {
|
59 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
60 |
+
}
|
61 |
+
|
62 |
+
reghdfe black_ps 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
63 |
+
|
64 |
+
local temp = 1/$bin_l
|
65 |
+
local bin_neg = abs($start * `temp')
|
66 |
+
local bin_pos = $end * `temp'
|
67 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
68 |
+
|
69 |
+
mat treat = J(`range',4,1)
|
70 |
+
|
71 |
+
local Nrange = `range' - 2
|
72 |
+
|
73 |
+
forval pos = 1/`Nrange' {
|
74 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
75 |
+
if `lag' > 0 {
|
76 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
77 |
+
}
|
78 |
+
|
79 |
+
local num = abs(`lag')
|
80 |
+
|
81 |
+
if `lag' == 0 {
|
82 |
+
mat treat[`pos',1] = 0
|
83 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
84 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
85 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
86 |
+
}
|
87 |
+
else if `lag' < -$bin_l {
|
88 |
+
local num2 = `num' - $bin_l + 1
|
89 |
+
local num1 = - `num'
|
90 |
+
mat treat[`pos',1] = `num1'
|
91 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
92 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
93 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
94 |
+
}
|
95 |
+
else if `lag' == -$bin_l {
|
96 |
+
mat treat[`pos',1] = -$bin_l
|
97 |
+
mat treat[`pos',2] = 0
|
98 |
+
mat treat[`pos',3] = 0
|
99 |
+
mat treat[`pos',4] = 0
|
100 |
+
}
|
101 |
+
else {
|
102 |
+
di "**"
|
103 |
+
di `lag'
|
104 |
+
di `pos'
|
105 |
+
local num2 = `num' + $bin_l - 1
|
106 |
+
mat treat[`pos',1] = `num2'
|
107 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
108 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
109 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
110 |
+
}
|
111 |
+
}
|
112 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
113 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
114 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
115 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
116 |
+
|
117 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
118 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
119 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
120 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
121 |
+
|
122 |
+
g yy = treat[_n,1] in 1/`range'
|
123 |
+
g eff = treat[_n,2] in 1/`range'
|
124 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
125 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
126 |
+
sort yy
|
127 |
+
|
128 |
+
duplicates drop yy, force
|
129 |
+
keep eff eff_5 eff_95 yy
|
130 |
+
|
131 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-2(0.5)2) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Black Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
132 |
+
graph export "Results\figureA2.pdf", as(pdf) name("Graph") replace
|
133 |
+
|
39/replication_package/Do/FigureA3.do
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A3
|
4 |
+
*** Distribution of Weights of the Difference-in-Differences Estimator
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
g n_stops = 1
|
10 |
+
foreach var of varlist black hispanic white api {
|
11 |
+
replace `var' = `var'/100
|
12 |
+
}
|
13 |
+
|
14 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
15 |
+
|
16 |
+
egen county_id = group(county_fips)
|
17 |
+
g black_ps = black / n_stops
|
18 |
+
keep if year==2015 | year==2016 | year==2017
|
19 |
+
|
20 |
+
g TRUMP_0 = 0
|
21 |
+
forval ii = 1/9 {
|
22 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
23 |
+
}
|
24 |
+
*
|
25 |
+
g TRUMP_POST30 = 0
|
26 |
+
forval ii = 1/9 {
|
27 |
+
replace TRUMP_POST30 = 1 if (dist_event`ii' >= 1 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
28 |
+
}
|
29 |
+
g TRUMP_PREM30 = 0
|
30 |
+
forval ii = 1/9 {
|
31 |
+
replace TRUMP_PREM30 = 1 if (dist_event`ii' < -30 & dist_event`ii'!=.)
|
32 |
+
}
|
33 |
+
g TRUMP_POSTM30 = 0
|
34 |
+
forval ii = 1/9 {
|
35 |
+
replace TRUMP_POSTM30 = 1 if (dist_event`ii' > 30 & dist_event`ii'!=.)
|
36 |
+
}
|
37 |
+
|
38 |
+
forval i = 1/1478 {
|
39 |
+
g trend_`i' = (county_id==`i') * day_id
|
40 |
+
}
|
41 |
+
twowayfeweights black_ps county_id day_id TRUMP_POST30, type(feTR) controls(TRUMP_PREM30 TRUMP_0 TRUMP_POSTM30 trend_*) path("Results\weights_u")
|
42 |
+
|
43 |
+
use "Results\weights_u",clear
|
44 |
+
hist weight if weight!=0, graphregion(color(white)) bin(50) percent graphregion(color(white)) scheme(s1mono)
|
45 |
+
graph export "Results\figureA3A.pdf", as(pdf) name("Graph") replace
|
46 |
+
|
47 |
+
***
|
48 |
+
use "Data\stoplevel_data.dta", clear
|
49 |
+
|
50 |
+
g n_stops = 1
|
51 |
+
foreach var of varlist black hispanic white api {
|
52 |
+
replace `var' = `var'/100
|
53 |
+
}
|
54 |
+
|
55 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
56 |
+
|
57 |
+
g black_ps = black / n_stops
|
58 |
+
keep if year==2015 | year==2016 | year==2017
|
59 |
+
|
60 |
+
egen county_id = group(county_fips)
|
61 |
+
|
62 |
+
g TRUMP_0 = 0
|
63 |
+
forval ii = 1/9 {
|
64 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
65 |
+
}
|
66 |
+
*
|
67 |
+
g TRUMP_POST30 = 0
|
68 |
+
forval ii = 1/9 {
|
69 |
+
replace TRUMP_POST30 = 1 if (dist_event`ii' >= 1 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
70 |
+
}
|
71 |
+
g TRUMP_PREM30 = 0
|
72 |
+
forval ii = 1/9 {
|
73 |
+
replace TRUMP_PREM30 = 1 if (dist_event`ii' < -30 & dist_event`ii'!=.)
|
74 |
+
}
|
75 |
+
g TRUMP_POSTM30 = 0
|
76 |
+
forval ii = 1/9 {
|
77 |
+
replace TRUMP_POSTM30 = 1 if (dist_event`ii' > 30 & dist_event`ii'!=.)
|
78 |
+
}
|
79 |
+
|
80 |
+
forval i = 1/1478 {
|
81 |
+
g trend_`i' = (county_id==`i') * day_id
|
82 |
+
}
|
83 |
+
twowayfeweights black_ps county_id day_id TRUMP_POST30, type(feTR) controls(TRUMP_PREM30 TRUMP_0 TRUMP_POSTM30 trend_*) weight(n_stops) path("Results\weights_w")
|
84 |
+
|
85 |
+
use "Results\weights_w",clear
|
86 |
+
hist weight if weight!=0 & weight<0.0005, graphregion(color(white)) bin(50) percent graphregion(color(white)) scheme(s1mono)
|
87 |
+
graph export "Results\figureA3B.pdf", as(pdf) name("Graph") replace
|
39/replication_package/Do/FigureA4.do
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
**********************************************************************
|
4 |
+
*** FIGURE A4
|
5 |
+
*** Distribution of the Difference-in-Differences Effects
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\county_day_data.dta", clear
|
9 |
+
|
10 |
+
keep if year==2015 | year==2016 | year==2017
|
11 |
+
|
12 |
+
rename TRUMP_POST_1_30 TRUMP_POST30
|
13 |
+
rename TRUMP_PRE_M30 TRUMP_PREM30
|
14 |
+
rename TRUMP_POST_M30 TRUMP_POSTM30
|
15 |
+
|
16 |
+
***number of counties 1,478
|
17 |
+
qui: {
|
18 |
+
forval ii = 1/1478 {
|
19 |
+
su n_stops if county_id==`ii' & TRUMP_POST30==1
|
20 |
+
if r(N) != 0 {
|
21 |
+
total n_stops if county_id==`ii' & TRUMP_POST30==1
|
22 |
+
global stops`ii' = _b[n_stops]
|
23 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
24 |
+
}
|
25 |
+
}
|
26 |
+
}
|
27 |
+
**I drop the first for collinearity
|
28 |
+
drop TREATED_COUNTY_9
|
29 |
+
|
30 |
+
reghdfe black_ps 1.TRUMP_POST30 1.TRUMP_POST30#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_PREM30 TRUMP_0 TRUMP_POSTM30) cluster(county_id day_id)
|
31 |
+
|
32 |
+
mat treat = 999* J(1478,2,1)
|
33 |
+
|
34 |
+
local numerator = 0
|
35 |
+
local denominator = 0
|
36 |
+
forval ii = 1/1478 {
|
37 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST30==1
|
38 |
+
if r(N) != 0 {
|
39 |
+
if `ii' == 9{
|
40 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST30])
|
41 |
+
mat treat[`ii',2] = (${stops`ii'})
|
42 |
+
local numerator = `numerator' + ((_b[1.TRUMP_POST30]) * ${stops`ii'})
|
43 |
+
local denominator = `denominator' + ${stops`ii'}
|
44 |
+
}
|
45 |
+
else {
|
46 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST30] + _b[1.TRUMP_POST30#1.TREATED_COUNTY_`ii'])
|
47 |
+
mat treat[`ii',2] = (${stops`ii'})
|
48 |
+
local numerator = `numerator' + ((_b[1.TRUMP_POST30] + _b[1.TRUMP_POST30#1.TREATED_COUNTY_`ii']) * ${stops`ii'})
|
49 |
+
local denominator = `denominator' + ${stops`ii'}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
local effect = `numerator' / `denominator'
|
55 |
+
|
56 |
+
di `effect'
|
57 |
+
|
58 |
+
g yy = treat[_n,1] in 1/1478
|
59 |
+
g ww = treat[_n,2] in 1/1478
|
60 |
+
replace yy = . if yy==999
|
61 |
+
replace ww = . if ww==999
|
62 |
+
|
63 |
+
graph twoway (hist yy [fweight=ww] if yy>-10 & yy<10, frac xtitle("Treatment Effects")) (scatteri 0 1.053357 0.2 1.053357, recast(line) lw(0.5)), legend(label(1 "Distribution Effects") label(2 "Average Effect")) graphregion(color(white)) scheme(s1mono)
|
64 |
+
graph export "Results\figureA4.pdf", as(pdf) name("Graph") replace
|
65 |
+
|
66 |
+
keep yy ww
|
67 |
+
drop if yy==.
|
68 |
+
save "Results\SA.dta", replace
|
69 |
+
|
39/replication_package/Do/FigureA5.do
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A5
|
4 |
+
*** Impact of Trump Rallies on the Probability of a Black Stop: Event-study
|
5 |
+
*** Results Corrected using Sun and Abraham (2021) Methodology
|
6 |
+
**********************************************************************
|
7 |
+
qui: do "Do\preparing_abrahamsun_es.do"
|
8 |
+
|
9 |
+
use "Results\SA_TRUMP_POST_1_15.dta", clear
|
10 |
+
g x = 15
|
11 |
+
|
12 |
+
append using "Results\SA_TRUMP_POST_16_30.dta"
|
13 |
+
replace x = 30 if _n == _N
|
14 |
+
|
15 |
+
append using "Results\SA_TRUMP_POST_31_45.dta"
|
16 |
+
replace x = 45 if _n == _N
|
17 |
+
|
18 |
+
append using "Results\SA_TRUMP_POST_46_60.dta"
|
19 |
+
replace x = 60 if _n == _N
|
20 |
+
|
21 |
+
append using "Results\SA_TRUMP_POST_61_75.dta"
|
22 |
+
replace x = 75 if _n == _N
|
23 |
+
|
24 |
+
append using "Results\SA_TRUMP_POST_76_90.dta"
|
25 |
+
replace x = 90 if _n == _N
|
26 |
+
|
27 |
+
append using "Results\SA_TRUMP_POST_91_105.dta"
|
28 |
+
replace x = 105 if _n == _N
|
29 |
+
|
30 |
+
append using "Results\SA_TRUMP_0.dta"
|
31 |
+
replace x = 0 if _n == _N
|
32 |
+
|
33 |
+
set obs `=_N+1'
|
34 |
+
replace x = -15 if _n == _N
|
35 |
+
replace beta = 0 if _n == _N
|
36 |
+
replace CI_lb = . if _n == _N
|
37 |
+
replace CI_ub = . if _n == _N
|
38 |
+
|
39 |
+
append using "Results\SA_TRUMP_PRE_30_16.dta"
|
40 |
+
replace x = -30 if _n == _N
|
41 |
+
|
42 |
+
append using "Results\SA_TRUMP_PRE_45_31.dta"
|
43 |
+
replace x = -45 if _n == _N
|
44 |
+
|
45 |
+
append using "Results\SA_TRUMP_PRE_60_46.dta"
|
46 |
+
replace x = -60 if _n == _N
|
47 |
+
|
48 |
+
append using "Results\SA_TRUMP_PRE_75_61.dta"
|
49 |
+
replace x = -75 if _n == _N
|
50 |
+
|
51 |
+
append using "Results\SA_TRUMP_PRE_90_76.dta"
|
52 |
+
replace x = -90 if _n == _N
|
53 |
+
|
54 |
+
append using "Results\SA_TRUMP_PRE_105_91.dta"
|
55 |
+
replace x = -105 if _n == _N
|
56 |
+
|
57 |
+
sort x
|
58 |
+
replace CI_lb = CI_lb * 100
|
59 |
+
replace CI_ub = CI_ub * 100
|
60 |
+
replace beta = beta * 100
|
61 |
+
|
62 |
+
twoway (rcap CI_lb CI_ub x) (scatter beta x)(line beta x, xline(0,lp(-)) yline(0,lc(red) lp(-))) , ylabel(-2(0.5)2.5) xtitle("Days From Trump") ytitle("Effect on Stops") legend(order(1 "95% confidence interval" 2 "Effect")) graphregion(fcolor(white))
|
63 |
+
graph export "Results\FigureA5A.pdf", as(pdf) name("Graph") replace
|
64 |
+
|
65 |
+
***
|
66 |
+
use "Results\SA_TRUMP_POST_1_15_NT.dta", clear
|
67 |
+
g x = 15
|
68 |
+
|
69 |
+
append using "Results\SA_TRUMP_POST_16_30_NT.dta"
|
70 |
+
replace x = 30 if _n == _N
|
71 |
+
|
72 |
+
append using "Results\SA_TRUMP_POST_31_45_NT.dta"
|
73 |
+
replace x = 45 if _n == _N
|
74 |
+
|
75 |
+
append using "Results\SA_TRUMP_POST_46_60_NT.dta"
|
76 |
+
replace x = 60 if _n == _N
|
77 |
+
|
78 |
+
append using "Results\SA_TRUMP_POST_61_75_NT.dta"
|
79 |
+
replace x = 75 if _n == _N
|
80 |
+
|
81 |
+
append using "Results\SA_TRUMP_POST_76_90_NT.dta"
|
82 |
+
replace x = 90 if _n == _N
|
83 |
+
|
84 |
+
append using "Results\SA_TRUMP_POST_91_105_NT.dta"
|
85 |
+
replace x = 105 if _n == _N
|
86 |
+
|
87 |
+
append using "Results\SA_TRUMP_0_NT.dta"
|
88 |
+
replace x = 0 if _n == _N
|
89 |
+
|
90 |
+
set obs `=_N+1'
|
91 |
+
replace x = -15 if _n == _N
|
92 |
+
replace beta = 0 if _n == _N
|
93 |
+
replace CI_lb = . if _n == _N
|
94 |
+
replace CI_ub = . if _n == _N
|
95 |
+
|
96 |
+
append using "Results\SA_TRUMP_PRE_30_16_NT.dta"
|
97 |
+
replace x = -30 if _n == _N
|
98 |
+
|
99 |
+
append using "Results\SA_TRUMP_PRE_45_31_NT.dta"
|
100 |
+
replace x = -45 if _n == _N
|
101 |
+
|
102 |
+
append using "Results\SA_TRUMP_PRE_60_46_NT.dta"
|
103 |
+
replace x = -60 if _n == _N
|
104 |
+
|
105 |
+
append using "Results\SA_TRUMP_PRE_75_61_NT.dta"
|
106 |
+
replace x = -75 if _n == _N
|
107 |
+
|
108 |
+
append using "Results\SA_TRUMP_PRE_90_76_NT.dta"
|
109 |
+
replace x = -90 if _n == _N
|
110 |
+
|
111 |
+
append using "Results\SA_TRUMP_PRE_105_91_NT.dta"
|
112 |
+
replace x = -105 if _n == _N
|
113 |
+
|
114 |
+
sort x
|
115 |
+
replace CI_lb = CI_lb * 100
|
116 |
+
replace CI_ub = CI_ub * 100
|
117 |
+
replace beta = beta * 100
|
118 |
+
|
119 |
+
twoway (rcap CI_lb CI_ub x) (scatter beta x)(line beta x, xline(0,lp(-)) yline(0,lc(red) lp(-))) , ylabel(-2(0.5)2.5) xtitle("Days From Trump") ytitle("Effect on Stops") legend(order(1 "95% confidence interval" 2 "Effect")) graphregion(fcolor(white))
|
120 |
+
graph export "Results\FigureA5B.pdf", as(pdf) name("Graph") replace
|
39/replication_package/Do/FigureA6.do
ADDED
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A6
|
4 |
+
*** Permutation Inference
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\county_day_data.dta", clear
|
8 |
+
|
9 |
+
keep if year==2015 | year==2016 | year==2017
|
10 |
+
drop year TRUMP_*
|
11 |
+
|
12 |
+
***number of counties 1,478
|
13 |
+
***number of rallies 196
|
14 |
+
g FAKE_EFFECT = .
|
15 |
+
forval iter = 1/1000 {
|
16 |
+
di "ITERATION " `iter'
|
17 |
+
qui: {
|
18 |
+
g random_date = floor(runiform(20256,20765))
|
19 |
+
g random_order = runiform()
|
20 |
+
g random_county = floor(runiform(1,1479))
|
21 |
+
sort random_order
|
22 |
+
|
23 |
+
g FAKE_event_day_Trump_1 = .
|
24 |
+
g FAKE_event_day_Trump_2 = .
|
25 |
+
g FAKE_event_day_Trump_3 = .
|
26 |
+
g FAKE_event_day_Trump_4 = .
|
27 |
+
g FAKE_event_day_Trump_5 = .
|
28 |
+
g FAKE_event_day_Trump_6 = .
|
29 |
+
g FAKE_event_day_Trump_7 = .
|
30 |
+
g FAKE_event_day_Trump_8 = .
|
31 |
+
g FAKE_event_day_Trump_9 = .
|
32 |
+
|
33 |
+
forval ii=1/196 {
|
34 |
+
local completed = 0
|
35 |
+
local counter = 1
|
36 |
+
while `completed' == 0 {
|
37 |
+
|
38 |
+
su FAKE_event_day_Trump_`counter' if county_id == random_county[`ii']
|
39 |
+
|
40 |
+
if r(N) == 0 {
|
41 |
+
replace FAKE_event_day_Trump_`counter' = random_date[`ii'] if county_id==random_county[`ii']
|
42 |
+
local completed = 1
|
43 |
+
}
|
44 |
+
else {
|
45 |
+
local counter = `counter' + 1
|
46 |
+
}
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
|
51 |
+
forval ii = 1/9 {
|
52 |
+
g dist_event`ii' = day_id - FAKE_event_day_Trump_`ii'
|
53 |
+
}
|
54 |
+
|
55 |
+
g TRUMP_0 = 0
|
56 |
+
forval ii = 1/9 {
|
57 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0 & dist_event`ii'!=.
|
58 |
+
}
|
59 |
+
*
|
60 |
+
|
61 |
+
g TRUMP_POST_1_30 = 0
|
62 |
+
forval ii = 1/9 {
|
63 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
g TRUMP_POST_M30 = 0
|
68 |
+
forval ii = 1/9 {
|
69 |
+
replace TRUMP_POST_M30 = 1 if (dist_event`ii' >30 & dist_event`ii'!=.)
|
70 |
+
}
|
71 |
+
|
72 |
+
g TRUMP_PRE_M30 = 0
|
73 |
+
forval ii = 1/9 {
|
74 |
+
replace TRUMP_PRE_M30 = 1 if (dist_event`ii' <-30 & dist_event`ii'!=.)
|
75 |
+
}
|
76 |
+
|
77 |
+
reghdfe black_ps 1.TRUMP_* [w=n_stops], a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
78 |
+
replace FAKE_EFFECT = _b[1.TRUMP_POST_1_30] in `iter'
|
79 |
+
|
80 |
+
drop FAKE_event_day_Trump_* random_* dist_event* TRUMP_*
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
drop if FAKE_EFFECT == .
|
85 |
+
|
86 |
+
hist FAKE_EFFECT if FAKE_EFFECT>-1.5 & FAKE_EFFECT<2, xline(1.07, lwidth(1)) percent xtitle("Coefficient on Fake Trump Rally") xlabel(-1.5(0.5)2) graphregion(color(white)) scheme(s1mono)
|
87 |
+
graph export "Results\FigureA6.pdf", as(pdf) name("Graph") replace
|
39/replication_package/Do/FigureA7.do
ADDED
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A7
|
4 |
+
*** Impact of Trump Rallies on the Relative Probability of Stop With Respect to Whites: Event-study Results
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
g n_stops = 1
|
10 |
+
foreach var of varlist black hispanic white api {
|
11 |
+
replace `var' = `var'/100
|
12 |
+
}
|
13 |
+
|
14 |
+
collapse (first) year dist* (sum) n_stops black hispanic white api, by(county_fips day_id subject_race)
|
15 |
+
|
16 |
+
g stops = black + hispanic + white + api
|
17 |
+
|
18 |
+
drop n_stops
|
19 |
+
bysort day_id county_fips: egen n_stops = total(stops)
|
20 |
+
|
21 |
+
drop if subject_race == 4
|
22 |
+
|
23 |
+
g prob_stop_race = black / n_stops if subject_race == 2
|
24 |
+
replace prob_stop_race = hispanic / n_stops if subject_race == 3
|
25 |
+
replace prob_stop_race = api / n_stops if subject_race == 1
|
26 |
+
|
27 |
+
rename black black_stops
|
28 |
+
rename hispanic hispanic_stop
|
29 |
+
rename api asian_stop
|
30 |
+
|
31 |
+
g black = (subject_race == 2)
|
32 |
+
g hispanic = (subject_race == 3)
|
33 |
+
g asian = (subject_race == 1)
|
34 |
+
|
35 |
+
local start = -105
|
36 |
+
local end = 105
|
37 |
+
local bin_l = 15
|
38 |
+
|
39 |
+
g TRUMP_0 = 0
|
40 |
+
forval ii = 1/9 {
|
41 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
42 |
+
}
|
43 |
+
|
44 |
+
forval ii = 1(`bin_l')`end'{
|
45 |
+
local jj = `ii' + `bin_l' - 1
|
46 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
47 |
+
forval ee = 1/9 {
|
48 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
49 |
+
}
|
50 |
+
}
|
51 |
+
g TRUMP_POST_M`end' = 0
|
52 |
+
forval ii = 1/9 {
|
53 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
54 |
+
}
|
55 |
+
*
|
56 |
+
|
57 |
+
forval ii = `start'(`bin_l')0 {
|
58 |
+
if `ii' < -`bin_l' {
|
59 |
+
local jj = abs(`ii')
|
60 |
+
local zz = `jj' - `bin_l' + 1
|
61 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
62 |
+
forval ee = 1/9 {
|
63 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
*
|
68 |
+
local jj = abs(`start')
|
69 |
+
g TRUMP_PRE_M`jj' = 0
|
70 |
+
forval ii = 1/9 {
|
71 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
72 |
+
}
|
73 |
+
|
74 |
+
reghdfe prob_stop_race 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.TRUMP_PRE_*#1.black 1.TRUMP_0#1.black 1.TRUMP_POST_*#1.black 1.TRUMP_PRE_*#1.asian 1.TRUMP_0#1.asian 1.TRUMP_POST_*#1.asian [w=n_stops], a(i.county_fips##i.black i.county_fips##i.asian i.day_id##i.black i.day_id##i.asian i.county_fips#c.day_id i.black#i.county_fips#c.day_id i.asian#i.county_fips#c.day_id) cluster(county_fips day_id )
|
75 |
+
|
76 |
+
local temp = 1/`bin_l'
|
77 |
+
local bin_neg = abs(`start' * `temp')
|
78 |
+
local bin_pos = `end' * `temp'
|
79 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
80 |
+
|
81 |
+
mat treat = J(`range',10,1)
|
82 |
+
|
83 |
+
local Nrange = `range' - 2
|
84 |
+
|
85 |
+
forval pos = 1/`Nrange' {
|
86 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
87 |
+
if `lag' > 0 {
|
88 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
89 |
+
}
|
90 |
+
|
91 |
+
local num = abs(`lag')
|
92 |
+
|
93 |
+
if `lag' == 0 {
|
94 |
+
mat treat[`pos',1] = 0
|
95 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
96 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
97 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
98 |
+
|
99 |
+
|
100 |
+
lincom _b[1.TRUMP_0#1.black] + _b[1.TRUMP_0]
|
101 |
+
mat treat[`pos',5] = r(estimate)
|
102 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
103 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
104 |
+
|
105 |
+
lincom _b[1.TRUMP_0#1.asian] + _b[1.TRUMP_0]
|
106 |
+
mat treat[`pos',8] = r(estimate)
|
107 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
108 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
109 |
+
}
|
110 |
+
else if `lag' < -`bin_l' {
|
111 |
+
local num2 = `num' - `bin_l' + 1
|
112 |
+
local num1 = - `num'
|
113 |
+
mat treat[`pos',1] = `num1'
|
114 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
115 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
116 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
117 |
+
|
118 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.black] + _b[1.TRUMP_PRE_`num'_`num2']
|
119 |
+
mat treat[`pos',5] = r(estimate)
|
120 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
121 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
122 |
+
|
123 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.asian] + _b[1.TRUMP_PRE_`num'_`num2']
|
124 |
+
mat treat[`pos',8] = r(estimate)
|
125 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
126 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
127 |
+
}
|
128 |
+
else if `lag' == -`bin_l' {
|
129 |
+
mat treat[`pos',1] = -`bin_l'
|
130 |
+
mat treat[`pos',2] = 0
|
131 |
+
mat treat[`pos',3] = 0
|
132 |
+
mat treat[`pos',4] = 0
|
133 |
+
|
134 |
+
mat treat[`pos',5] = 0
|
135 |
+
mat treat[`pos',6] = 0
|
136 |
+
mat treat[`pos',7] = 0
|
137 |
+
|
138 |
+
mat treat[`pos',8] = 0
|
139 |
+
mat treat[`pos',9] = 0
|
140 |
+
mat treat[`pos',10] = 0
|
141 |
+
}
|
142 |
+
else {
|
143 |
+
di "**"
|
144 |
+
di `lag'
|
145 |
+
di `pos'
|
146 |
+
local num2 = `num' + `bin_l' - 1
|
147 |
+
mat treat[`pos',1] = `num2'
|
148 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
149 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
150 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
151 |
+
|
152 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.black] + _b[1.TRUMP_POST_`num'_`num2']
|
153 |
+
mat treat[`pos',5] = r(estimate)
|
154 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
155 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
156 |
+
|
157 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.asian] + _b[1.TRUMP_POST_`num'_`num2']
|
158 |
+
mat treat[`pos',8] = r(estimate)
|
159 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
160 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
161 |
+
}
|
162 |
+
}
|
163 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
164 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
165 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
166 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
167 |
+
|
168 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.black] + _b[1.TRUMP_PRE_M`jj']
|
169 |
+
mat treat[`range'-1,5] = r(estimate)
|
170 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
171 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
172 |
+
|
173 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.asian] + _b[1.TRUMP_PRE_M`jj']
|
174 |
+
mat treat[`range'-1,8] = r(estimate)
|
175 |
+
mat treat[`range'-1,9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
176 |
+
mat treat[`range'-1,10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
177 |
+
|
178 |
+
|
179 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
180 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M`end']
|
181 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M`end'] + _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
182 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M`end'] - _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
183 |
+
|
184 |
+
lincom _b[1.TRUMP_POST_M`end'#1.black] + _b[1.TRUMP_POST_M`end']
|
185 |
+
mat treat[`range',5] = r(estimate)
|
186 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
187 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
188 |
+
|
189 |
+
lincom _b[1.TRUMP_POST_M`end'#1.asian] + _b[1.TRUMP_POST_M`end']
|
190 |
+
mat treat[`range',8] = r(estimate)
|
191 |
+
mat treat[`range',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
192 |
+
mat treat[`range',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
193 |
+
|
194 |
+
|
195 |
+
g yy = treat[_n,1] in 1/`range'
|
196 |
+
g eff_hisp = treat[_n,2] in 1/`range'
|
197 |
+
g eff_hisp_10 = treat[_n,3] in 1/`range'
|
198 |
+
g eff_hisp_90 = treat[_n,4] in 1/`range'
|
199 |
+
g eff_bl = treat[_n,5] in 1/`range'
|
200 |
+
g eff_bl_10 = treat[_n,6] in 1/`range'
|
201 |
+
g eff_bl_90 = treat[_n,7] in 1/`range'
|
202 |
+
g eff_as = treat[_n,8] in 1/`range'
|
203 |
+
g eff_as_10 = treat[_n,9] in 1/`range'
|
204 |
+
g eff_as_90 = treat[_n,10] in 1/`range'
|
205 |
+
sort yy
|
206 |
+
|
207 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
208 |
+
duplicates drop yy, force
|
209 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
210 |
+
|
211 |
+
twoway (rcap eff_hisp_10 eff_hisp_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) ) (scatter eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(green) msymbol(triangle)) (line eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanics") legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(hisp,replace)
|
212 |
+
graph export "Results\FigureA7A.pdf", as(pdf) replace
|
213 |
+
|
214 |
+
|
215 |
+
twoway (rcap eff_bl_10 eff_bl_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Blacks") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(black,replace)
|
216 |
+
graph export "Results\FigureA7B.pdf", as(pdf) replace
|
217 |
+
|
218 |
+
twoway (rcap eff_as_10 eff_as_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(red)) (scatter eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(red)) (line eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(red) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on APIs") legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(asian,replace)
|
219 |
+
graph export "Results\FigureA7C.pdf", as(pdf) replace
|
220 |
+
|
221 |
+
|
222 |
+
****************************************************************************************************************************************
|
223 |
+
|
224 |
+
use "Data\stoplevel_data.dta", clear
|
225 |
+
|
226 |
+
g n_stops = 1
|
227 |
+
foreach var of varlist black hispanic white api {
|
228 |
+
replace `var' = `var'/100
|
229 |
+
}
|
230 |
+
|
231 |
+
collapse (first) year dist* (sum) n_stops black hispanic white api, by(county_fips day_id subject_race)
|
232 |
+
|
233 |
+
g stops = black + hispanic + white + api
|
234 |
+
|
235 |
+
drop n_stops
|
236 |
+
bysort day_id county_fips: egen n_stops = total(stops)
|
237 |
+
|
238 |
+
drop if subject_race == 4
|
239 |
+
|
240 |
+
g prob_stop_race = black / n_stops if subject_race == 2
|
241 |
+
replace prob_stop_race = hispanic / n_stops if subject_race == 3
|
242 |
+
replace prob_stop_race = api / n_stops if subject_race == 1
|
243 |
+
|
244 |
+
rename black black_stops
|
245 |
+
rename hispanic hispanic_stop
|
246 |
+
rename api asian_stop
|
247 |
+
|
248 |
+
g black = (subject_race == 2)
|
249 |
+
g hispanic = (subject_race == 3)
|
250 |
+
g asian = (subject_race == 1)
|
251 |
+
|
252 |
+
local start = -105
|
253 |
+
local end = 105
|
254 |
+
local bin_l = 15
|
255 |
+
|
256 |
+
g TRUMP_0 = 0
|
257 |
+
forval ii = 1/9 {
|
258 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
259 |
+
}
|
260 |
+
|
261 |
+
forval ii = 1(`bin_l')`end'{
|
262 |
+
local jj = `ii' + `bin_l' - 1
|
263 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
264 |
+
forval ee = 1/9 {
|
265 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
266 |
+
}
|
267 |
+
}
|
268 |
+
g TRUMP_POST_M`end' = 0
|
269 |
+
forval ii = 1/9 {
|
270 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
271 |
+
}
|
272 |
+
*
|
273 |
+
|
274 |
+
forval ii = `start'(`bin_l')0 {
|
275 |
+
if `ii' < -`bin_l' {
|
276 |
+
local jj = abs(`ii')
|
277 |
+
local zz = `jj' - `bin_l' + 1
|
278 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
279 |
+
forval ee = 1/9 {
|
280 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}
|
284 |
+
*
|
285 |
+
local jj = abs(`start')
|
286 |
+
g TRUMP_PRE_M`jj' = 0
|
287 |
+
forval ii = 1/9 {
|
288 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
289 |
+
}
|
290 |
+
|
291 |
+
reghdfe prob_stop_race 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.TRUMP_PRE_*#1.black 1.TRUMP_0#1.black 1.TRUMP_POST_*#1.black 1.TRUMP_PRE_*#1.asian 1.TRUMP_0#1.asian 1.TRUMP_POST_*#1.asian [w=n_stops], a(i.county_fips##i.black i.county_fips##i.asian i.day_id##i.black i.day_id##i.asian) cluster(county_fips day_id)
|
292 |
+
|
293 |
+
|
294 |
+
local temp = 1/`bin_l'
|
295 |
+
local bin_neg = abs(`start' * `temp')
|
296 |
+
local bin_pos = `end' * `temp'
|
297 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
298 |
+
|
299 |
+
mat treat = J(`range',10,1)
|
300 |
+
|
301 |
+
local Nrange = `range' - 2
|
302 |
+
|
303 |
+
forval pos = 1/`Nrange' {
|
304 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
305 |
+
if `lag' > 0 {
|
306 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
307 |
+
}
|
308 |
+
|
309 |
+
local num = abs(`lag')
|
310 |
+
|
311 |
+
if `lag' == 0 {
|
312 |
+
mat treat[`pos',1] = 0
|
313 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
314 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
315 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
316 |
+
|
317 |
+
|
318 |
+
lincom _b[1.TRUMP_0#1.black] + _b[1.TRUMP_0]
|
319 |
+
mat treat[`pos',5] = r(estimate)
|
320 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
321 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
322 |
+
|
323 |
+
lincom _b[1.TRUMP_0#1.asian] + _b[1.TRUMP_0]
|
324 |
+
mat treat[`pos',8] = r(estimate)
|
325 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
326 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
327 |
+
}
|
328 |
+
else if `lag' < -`bin_l' {
|
329 |
+
local num2 = `num' - `bin_l' + 1
|
330 |
+
local num1 = - `num'
|
331 |
+
mat treat[`pos',1] = `num1'
|
332 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
333 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
334 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
335 |
+
|
336 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.black] + _b[1.TRUMP_PRE_`num'_`num2']
|
337 |
+
mat treat[`pos',5] = r(estimate)
|
338 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
339 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
340 |
+
|
341 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.asian] + _b[1.TRUMP_PRE_`num'_`num2']
|
342 |
+
mat treat[`pos',8] = r(estimate)
|
343 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
344 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
345 |
+
}
|
346 |
+
else if `lag' == -`bin_l' {
|
347 |
+
mat treat[`pos',1] = -`bin_l'
|
348 |
+
mat treat[`pos',2] = 0
|
349 |
+
mat treat[`pos',3] = 0
|
350 |
+
mat treat[`pos',4] = 0
|
351 |
+
|
352 |
+
mat treat[`pos',5] = 0
|
353 |
+
mat treat[`pos',6] = 0
|
354 |
+
mat treat[`pos',7] = 0
|
355 |
+
|
356 |
+
mat treat[`pos',8] = 0
|
357 |
+
mat treat[`pos',9] = 0
|
358 |
+
mat treat[`pos',10] = 0
|
359 |
+
}
|
360 |
+
else {
|
361 |
+
di "**"
|
362 |
+
di `lag'
|
363 |
+
di `pos'
|
364 |
+
local num2 = `num' + `bin_l' - 1
|
365 |
+
mat treat[`pos',1] = `num2'
|
366 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
367 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
368 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
369 |
+
|
370 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.black] + _b[1.TRUMP_POST_`num'_`num2']
|
371 |
+
mat treat[`pos',5] = r(estimate)
|
372 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
373 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
374 |
+
|
375 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.asian] + _b[1.TRUMP_POST_`num'_`num2']
|
376 |
+
mat treat[`pos',8] = r(estimate)
|
377 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
378 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
379 |
+
}
|
380 |
+
}
|
381 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
382 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
383 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
384 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
385 |
+
|
386 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.black] + _b[1.TRUMP_PRE_M`jj']
|
387 |
+
mat treat[`range'-1,5] = r(estimate)
|
388 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
389 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
390 |
+
|
391 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.asian] + _b[1.TRUMP_PRE_M`jj']
|
392 |
+
mat treat[`range'-1,8] = r(estimate)
|
393 |
+
mat treat[`range'-1,9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
394 |
+
mat treat[`range'-1,10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
395 |
+
|
396 |
+
|
397 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
398 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M`end']
|
399 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M`end'] + _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
400 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M`end'] - _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
401 |
+
|
402 |
+
lincom _b[1.TRUMP_POST_M`end'#1.black] + _b[1.TRUMP_POST_M`end']
|
403 |
+
mat treat[`range',5] = r(estimate)
|
404 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
405 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
406 |
+
|
407 |
+
lincom _b[1.TRUMP_POST_M`end'#1.asian] + _b[1.TRUMP_POST_M`end']
|
408 |
+
mat treat[`range',8] = r(estimate)
|
409 |
+
mat treat[`range',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
410 |
+
mat treat[`range',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
411 |
+
|
412 |
+
|
413 |
+
g yy = treat[_n,1] in 1/`range'
|
414 |
+
g eff_hisp = treat[_n,2] in 1/`range'
|
415 |
+
g eff_hisp_10 = treat[_n,3] in 1/`range'
|
416 |
+
g eff_hisp_90 = treat[_n,4] in 1/`range'
|
417 |
+
g eff_bl = treat[_n,5] in 1/`range'
|
418 |
+
g eff_bl_10 = treat[_n,6] in 1/`range'
|
419 |
+
g eff_bl_90 = treat[_n,7] in 1/`range'
|
420 |
+
g eff_as = treat[_n,8] in 1/`range'
|
421 |
+
g eff_as_10 = treat[_n,9] in 1/`range'
|
422 |
+
g eff_as_90 = treat[_n,10] in 1/`range'
|
423 |
+
sort yy
|
424 |
+
|
425 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
426 |
+
duplicates drop yy, force
|
427 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
428 |
+
|
429 |
+
twoway (rcap eff_hisp_10 eff_hisp_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) ) (scatter eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(green) msymbol(triangle)) (line eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanics") legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(hisp,replace)
|
430 |
+
graph export "Results\FigureA7D.pdf", as(pdf) replace
|
431 |
+
|
432 |
+
|
433 |
+
twoway (rcap eff_bl_10 eff_bl_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Blacks") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(black,replace)
|
434 |
+
graph export "Results\FigureA7E.pdf", as(pdf) replace
|
435 |
+
|
436 |
+
twoway (rcap eff_as_10 eff_as_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(red)) (scatter eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(red)) (line eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(red) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on APIs") legend(off) xlabel(-105(15)105) ylabel(-0.01(0.005)0.025) saving(asian,replace)
|
437 |
+
graph export "Results\FigureA7F.pdf", as(pdf) replace
|
39/replication_package/Do/FigureA8.do
ADDED
@@ -0,0 +1,389 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A8
|
4 |
+
*** Impact of Trump Rallies on the Number of Stops With Respect to Whites: Event-study Results
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\countydayrace_data.dta", clear
|
8 |
+
|
9 |
+
drop TRUMP*
|
10 |
+
|
11 |
+
local start = -105
|
12 |
+
local end = 105
|
13 |
+
local bin_l = 15
|
14 |
+
|
15 |
+
g TRUMP_0 = 0
|
16 |
+
forval ii = 1/9 {
|
17 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
18 |
+
}
|
19 |
+
|
20 |
+
forval ii = 1(`bin_l')`end'{
|
21 |
+
local jj = `ii' + `bin_l' - 1
|
22 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
23 |
+
forval ee = 1/9 {
|
24 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
25 |
+
}
|
26 |
+
}
|
27 |
+
g TRUMP_POST_M`end' = 0
|
28 |
+
forval ii = 1/9 {
|
29 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
30 |
+
}
|
31 |
+
*
|
32 |
+
|
33 |
+
forval ii = `start'(`bin_l')0 {
|
34 |
+
if `ii' < -`bin_l' {
|
35 |
+
local jj = abs(`ii')
|
36 |
+
local zz = `jj' - `bin_l' + 1
|
37 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
38 |
+
forval ee = 1/9 {
|
39 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
*
|
44 |
+
local jj = abs(`start')
|
45 |
+
g TRUMP_PRE_M`jj' = 0
|
46 |
+
forval ii = 1/9 {
|
47 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
48 |
+
}
|
49 |
+
|
50 |
+
reghdfe ihs_stop_race 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.TRUMP_PRE_*#1.black 1.TRUMP_0#1.black 1.TRUMP_POST_*#1.black 1.TRUMP_PRE_*#1.asian 1.TRUMP_0#1.asian 1.TRUMP_POST_*#1.asian ihs_stops [w=n_stops], a(i.county_id##i.black i.county_id##i.asian i.day_id##i.black i.day_id##i.asian i.county_id#c.day_id i.black#i.county_id#c.day_id i.asian#i.county_id#c.day_id) cluster(county_id day_id )
|
51 |
+
|
52 |
+
local temp = 1/`bin_l'
|
53 |
+
local bin_neg = abs(`start' * `temp')
|
54 |
+
local bin_pos = `end' * `temp'
|
55 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
56 |
+
|
57 |
+
mat treat = J(`range',10,1)
|
58 |
+
|
59 |
+
local Nrange = `range' - 2
|
60 |
+
|
61 |
+
forval pos = 1/`Nrange' {
|
62 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
63 |
+
if `lag' > 0 {
|
64 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
65 |
+
}
|
66 |
+
|
67 |
+
local num = abs(`lag')
|
68 |
+
|
69 |
+
if `lag' == 0 {
|
70 |
+
mat treat[`pos',1] = 0
|
71 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
72 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
73 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
74 |
+
|
75 |
+
|
76 |
+
lincom _b[1.TRUMP_0#1.black] + _b[1.TRUMP_0]
|
77 |
+
mat treat[`pos',5] = r(estimate)
|
78 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
79 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
80 |
+
|
81 |
+
lincom _b[1.TRUMP_0#1.asian] + _b[1.TRUMP_0]
|
82 |
+
mat treat[`pos',8] = r(estimate)
|
83 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
84 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
85 |
+
}
|
86 |
+
else if `lag' < -`bin_l' {
|
87 |
+
local num2 = `num' - `bin_l' + 1
|
88 |
+
local num1 = - `num'
|
89 |
+
mat treat[`pos',1] = `num1'
|
90 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
91 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
92 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
93 |
+
|
94 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.black] + _b[1.TRUMP_PRE_`num'_`num2']
|
95 |
+
mat treat[`pos',5] = r(estimate)
|
96 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
97 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
98 |
+
|
99 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.asian] + _b[1.TRUMP_PRE_`num'_`num2']
|
100 |
+
mat treat[`pos',8] = r(estimate)
|
101 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
102 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
103 |
+
}
|
104 |
+
else if `lag' == -`bin_l' {
|
105 |
+
mat treat[`pos',1] = -`bin_l'
|
106 |
+
mat treat[`pos',2] = 0
|
107 |
+
mat treat[`pos',3] = 0
|
108 |
+
mat treat[`pos',4] = 0
|
109 |
+
|
110 |
+
mat treat[`pos',5] = 0
|
111 |
+
mat treat[`pos',6] = 0
|
112 |
+
mat treat[`pos',7] = 0
|
113 |
+
|
114 |
+
mat treat[`pos',8] = 0
|
115 |
+
mat treat[`pos',9] = 0
|
116 |
+
mat treat[`pos',10] = 0
|
117 |
+
}
|
118 |
+
else {
|
119 |
+
di "**"
|
120 |
+
di `lag'
|
121 |
+
di `pos'
|
122 |
+
local num2 = `num' + `bin_l' - 1
|
123 |
+
mat treat[`pos',1] = `num2'
|
124 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
125 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
126 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
127 |
+
|
128 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.black] + _b[1.TRUMP_POST_`num'_`num2']
|
129 |
+
mat treat[`pos',5] = r(estimate)
|
130 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
131 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
132 |
+
|
133 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.asian] + _b[1.TRUMP_POST_`num'_`num2']
|
134 |
+
mat treat[`pos',8] = r(estimate)
|
135 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
136 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
137 |
+
}
|
138 |
+
}
|
139 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
140 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
141 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
142 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
143 |
+
|
144 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.black] + _b[1.TRUMP_PRE_M`jj']
|
145 |
+
mat treat[`range'-1,5] = r(estimate)
|
146 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
147 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
148 |
+
|
149 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.asian] + _b[1.TRUMP_PRE_M`jj']
|
150 |
+
mat treat[`range'-1,8] = r(estimate)
|
151 |
+
mat treat[`range'-1,9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
152 |
+
mat treat[`range'-1,10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
153 |
+
|
154 |
+
|
155 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
156 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M`end']
|
157 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M`end'] + _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
158 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M`end'] - _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
159 |
+
|
160 |
+
lincom _b[1.TRUMP_POST_M`end'#1.black] + _b[1.TRUMP_POST_M`end']
|
161 |
+
mat treat[`range',5] = r(estimate)
|
162 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
163 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
164 |
+
|
165 |
+
lincom _b[1.TRUMP_POST_M`end'#1.asian] + _b[1.TRUMP_POST_M`end']
|
166 |
+
mat treat[`range',8] = r(estimate)
|
167 |
+
mat treat[`range',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
168 |
+
mat treat[`range',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
169 |
+
|
170 |
+
|
171 |
+
g yy = treat[_n,1] in 1/`range'
|
172 |
+
g eff_hisp = treat[_n,2] in 1/`range'
|
173 |
+
g eff_hisp_10 = treat[_n,3] in 1/`range'
|
174 |
+
g eff_hisp_90 = treat[_n,4] in 1/`range'
|
175 |
+
g eff_bl = treat[_n,5] in 1/`range'
|
176 |
+
g eff_bl_10 = treat[_n,6] in 1/`range'
|
177 |
+
g eff_bl_90 = treat[_n,7] in 1/`range'
|
178 |
+
g eff_as = treat[_n,8] in 1/`range'
|
179 |
+
g eff_as_10 = treat[_n,9] in 1/`range'
|
180 |
+
g eff_as_90 = treat[_n,10] in 1/`range'
|
181 |
+
sort yy
|
182 |
+
|
183 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
184 |
+
duplicates drop yy, force
|
185 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
186 |
+
|
187 |
+
twoway (rcap eff_hisp_10 eff_hisp_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) ) (scatter eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(green) msymbol(triangle)) (line eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanics") legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.25) saving(hisp,replace)
|
188 |
+
graph export "Results\FigureA8A.pdf", as(pdf) replace
|
189 |
+
|
190 |
+
|
191 |
+
twoway (rcap eff_bl_10 eff_bl_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Blacks") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.25) saving(black,replace)
|
192 |
+
graph export "Results\FigureA8B.pdf", as(pdf) replace
|
193 |
+
|
194 |
+
twoway (rcap eff_as_10 eff_as_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(red)) (scatter eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(red)) (line eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(red) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on APIs") legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.25) saving(asian,replace)
|
195 |
+
graph export "Results\FigureA8C.pdf", as(pdf) replace
|
196 |
+
|
197 |
+
****************************************************************************************************************************************
|
198 |
+
|
199 |
+
use "Data\countydayrace_data.dta", clear
|
200 |
+
|
201 |
+
drop TRUMP*
|
202 |
+
|
203 |
+
local start = -105
|
204 |
+
local end = 105
|
205 |
+
local bin_l = 15
|
206 |
+
|
207 |
+
g TRUMP_0 = 0
|
208 |
+
forval ii = 1/9 {
|
209 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
210 |
+
}
|
211 |
+
|
212 |
+
forval ii = 1(`bin_l')`end'{
|
213 |
+
local jj = `ii' + `bin_l' - 1
|
214 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
215 |
+
forval ee = 1/9 {
|
216 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
217 |
+
}
|
218 |
+
}
|
219 |
+
g TRUMP_POST_M`end' = 0
|
220 |
+
forval ii = 1/9 {
|
221 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
222 |
+
}
|
223 |
+
*
|
224 |
+
|
225 |
+
forval ii = `start'(`bin_l')0 {
|
226 |
+
if `ii' < -`bin_l' {
|
227 |
+
local jj = abs(`ii')
|
228 |
+
local zz = `jj' - `bin_l' + 1
|
229 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
230 |
+
forval ee = 1/9 {
|
231 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
232 |
+
}
|
233 |
+
}
|
234 |
+
}
|
235 |
+
*
|
236 |
+
local jj = abs(`start')
|
237 |
+
g TRUMP_PRE_M`jj' = 0
|
238 |
+
forval ii = 1/9 {
|
239 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
240 |
+
}
|
241 |
+
|
242 |
+
reghdfe ihs_stop_race 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* 1.TRUMP_PRE_*#1.black 1.TRUMP_0#1.black 1.TRUMP_POST_*#1.black 1.TRUMP_PRE_*#1.asian 1.TRUMP_0#1.asian 1.TRUMP_POST_*#1.asian ihs_stops [w=n_stops], a(i.county_id##i.black i.county_id##i.asian i.day_id##i.black i.day_id##i.asian) cluster(county_id day_id)
|
243 |
+
|
244 |
+
|
245 |
+
local temp = 1/`bin_l'
|
246 |
+
local bin_neg = abs(`start' * `temp')
|
247 |
+
local bin_pos = `end' * `temp'
|
248 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
249 |
+
|
250 |
+
mat treat = J(`range',10,1)
|
251 |
+
|
252 |
+
local Nrange = `range' - 2
|
253 |
+
|
254 |
+
forval pos = 1/`Nrange' {
|
255 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l'
|
256 |
+
if `lag' > 0 {
|
257 |
+
local lag = `start' + `bin_l'*`pos' - `bin_l' - `bin_l' + 1
|
258 |
+
}
|
259 |
+
|
260 |
+
local num = abs(`lag')
|
261 |
+
|
262 |
+
if `lag' == 0 {
|
263 |
+
mat treat[`pos',1] = 0
|
264 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
265 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
266 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
267 |
+
|
268 |
+
|
269 |
+
lincom _b[1.TRUMP_0#1.black] + _b[1.TRUMP_0]
|
270 |
+
mat treat[`pos',5] = r(estimate)
|
271 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
272 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
273 |
+
|
274 |
+
lincom _b[1.TRUMP_0#1.asian] + _b[1.TRUMP_0]
|
275 |
+
mat treat[`pos',8] = r(estimate)
|
276 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
277 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
278 |
+
}
|
279 |
+
else if `lag' < -`bin_l' {
|
280 |
+
local num2 = `num' - `bin_l' + 1
|
281 |
+
local num1 = - `num'
|
282 |
+
mat treat[`pos',1] = `num1'
|
283 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
284 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
285 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
286 |
+
|
287 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.black] + _b[1.TRUMP_PRE_`num'_`num2']
|
288 |
+
mat treat[`pos',5] = r(estimate)
|
289 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
290 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
291 |
+
|
292 |
+
lincom _b[1.TRUMP_PRE_`num'_`num2'#1.asian] + _b[1.TRUMP_PRE_`num'_`num2']
|
293 |
+
mat treat[`pos',8] = r(estimate)
|
294 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
295 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
296 |
+
}
|
297 |
+
else if `lag' == -`bin_l' {
|
298 |
+
mat treat[`pos',1] = -`bin_l'
|
299 |
+
mat treat[`pos',2] = 0
|
300 |
+
mat treat[`pos',3] = 0
|
301 |
+
mat treat[`pos',4] = 0
|
302 |
+
|
303 |
+
mat treat[`pos',5] = 0
|
304 |
+
mat treat[`pos',6] = 0
|
305 |
+
mat treat[`pos',7] = 0
|
306 |
+
|
307 |
+
mat treat[`pos',8] = 0
|
308 |
+
mat treat[`pos',9] = 0
|
309 |
+
mat treat[`pos',10] = 0
|
310 |
+
}
|
311 |
+
else {
|
312 |
+
di "**"
|
313 |
+
di `lag'
|
314 |
+
di `pos'
|
315 |
+
local num2 = `num' + `bin_l' - 1
|
316 |
+
mat treat[`pos',1] = `num2'
|
317 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
318 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
319 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
320 |
+
|
321 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.black] + _b[1.TRUMP_POST_`num'_`num2']
|
322 |
+
mat treat[`pos',5] = r(estimate)
|
323 |
+
mat treat[`pos',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
324 |
+
mat treat[`pos',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
325 |
+
|
326 |
+
lincom _b[1.TRUMP_POST_`num'_`num2'#1.asian] + _b[1.TRUMP_POST_`num'_`num2']
|
327 |
+
mat treat[`pos',8] = r(estimate)
|
328 |
+
mat treat[`pos',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
329 |
+
mat treat[`pos',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
330 |
+
}
|
331 |
+
}
|
332 |
+
mat treat[`range'-1,1] = `start' - `bin_l' - 1
|
333 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
334 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
335 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
336 |
+
|
337 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.black] + _b[1.TRUMP_PRE_M`jj']
|
338 |
+
mat treat[`range'-1,5] = r(estimate)
|
339 |
+
mat treat[`range'-1,6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
340 |
+
mat treat[`range'-1,7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
341 |
+
|
342 |
+
lincom _b[1.TRUMP_PRE_M`jj'#1.asian] + _b[1.TRUMP_PRE_M`jj']
|
343 |
+
mat treat[`range'-1,8] = r(estimate)
|
344 |
+
mat treat[`range'-1,9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
345 |
+
mat treat[`range'-1,10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
346 |
+
|
347 |
+
|
348 |
+
mat treat[`range',1] = `end' + `bin_l' + 1
|
349 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M`end']
|
350 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M`end'] + _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
351 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M`end'] - _se[1.TRUMP_POST_M`end']*invttail(e(N),0.025)
|
352 |
+
|
353 |
+
lincom _b[1.TRUMP_POST_M`end'#1.black] + _b[1.TRUMP_POST_M`end']
|
354 |
+
mat treat[`range',5] = r(estimate)
|
355 |
+
mat treat[`range',6] = r(estimate) + r(se)*invttail(e(N),0.025)
|
356 |
+
mat treat[`range',7] = r(estimate) - r(se)*invttail(e(N),0.025)
|
357 |
+
|
358 |
+
lincom _b[1.TRUMP_POST_M`end'#1.asian] + _b[1.TRUMP_POST_M`end']
|
359 |
+
mat treat[`range',8] = r(estimate)
|
360 |
+
mat treat[`range',9] = r(estimate) + r(se)*invttail(e(N),0.025)
|
361 |
+
mat treat[`range',10] = r(estimate) - r(se)*invttail(e(N),0.025)
|
362 |
+
|
363 |
+
|
364 |
+
g yy = treat[_n,1] in 1/`range'
|
365 |
+
g eff_hisp = treat[_n,2] in 1/`range'
|
366 |
+
g eff_hisp_10 = treat[_n,3] in 1/`range'
|
367 |
+
g eff_hisp_90 = treat[_n,4] in 1/`range'
|
368 |
+
g eff_bl = treat[_n,5] in 1/`range'
|
369 |
+
g eff_bl_10 = treat[_n,6] in 1/`range'
|
370 |
+
g eff_bl_90 = treat[_n,7] in 1/`range'
|
371 |
+
g eff_as = treat[_n,8] in 1/`range'
|
372 |
+
g eff_as_10 = treat[_n,9] in 1/`range'
|
373 |
+
g eff_as_90 = treat[_n,10] in 1/`range'
|
374 |
+
sort yy
|
375 |
+
|
376 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
377 |
+
duplicates drop yy, force
|
378 |
+
keep eff_* eff_*_10 eff_*_90 yy
|
379 |
+
|
380 |
+
twoway (rcap eff_hisp_10 eff_hisp_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) ) (scatter eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(green) msymbol(triangle)) (line eff_hisp yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(green) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanics") legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.2) saving(hisp,replace)
|
381 |
+
graph export "Results\FigureA8D.pdf", as(pdf) replace
|
382 |
+
|
383 |
+
|
384 |
+
twoway (rcap eff_bl_10 eff_bl_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(blue)) (scatter eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(blue)) (line eff_bl yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(blue) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Blacks") xlabel(-105(15)105) legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.2) saving(black,replace)
|
385 |
+
graph export "Results\FigureA8E.pdf", as(pdf) replace
|
386 |
+
|
387 |
+
twoway (rcap eff_as_10 eff_as_90 yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,lc(red)) (scatter eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1,mc(red)) (line eff_as yy if yy>`start' - `bin_l' - 1 & yy<`end' + `bin_l' + 1, lc(red) xline(0,lp(-)) yline(0,lp(-))) , graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on APIs") legend(off) xlabel(-105(15)105) ylabel(-0.15(0.05)0.2) saving(asian,replace)
|
388 |
+
graph export "Results\FigureA8F.pdf", as(pdf) replace
|
389 |
+
|
39/replication_package/Do/FigureA9.do
ADDED
@@ -0,0 +1,600 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** FIGURE A9
|
4 |
+
*** Impact of Trump Rallies on the Number of Stops: Event-study Results
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
global start = -105
|
8 |
+
global end = 105
|
9 |
+
global bin_l = 15
|
10 |
+
global var = "ihs_black"
|
11 |
+
global trend = 1
|
12 |
+
|
13 |
+
use "Data\stoplevel_data.dta", clear
|
14 |
+
|
15 |
+
g n_stops = 1
|
16 |
+
foreach var of varlist black hispanic white api {
|
17 |
+
replace `var' = `var'/100
|
18 |
+
}
|
19 |
+
|
20 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
21 |
+
|
22 |
+
g black_ps = 100*black / n_stops
|
23 |
+
g hispanic_ps = 100*hispanic / n_stops
|
24 |
+
g white_ps = 100*white / n_stops
|
25 |
+
g asian_ps = 100*api / n_stops
|
26 |
+
g ln_stops = ln(n_stops)
|
27 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
28 |
+
g white_nbps = 100*white / (n_stops-black)
|
29 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
30 |
+
|
31 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
32 |
+
g ln_black = ln(black +1)
|
33 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
34 |
+
g ln_hispanic = ln(hispanic+1)
|
35 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
36 |
+
g ln_white = ln(white+1)
|
37 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
38 |
+
g ln_asian = ln(api+1)
|
39 |
+
|
40 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
41 |
+
|
42 |
+
g TRUMP_0 = 0
|
43 |
+
forval ii = 1/9 {
|
44 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
45 |
+
}
|
46 |
+
|
47 |
+
forval ii = 1($bin_l)$end{
|
48 |
+
local jj = `ii' + $bin_l - 1
|
49 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
50 |
+
forval ee = 1/9 {
|
51 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
52 |
+
}
|
53 |
+
}
|
54 |
+
g TRUMP_POST_M$end = 0
|
55 |
+
forval ii = 1/9 {
|
56 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
57 |
+
}
|
58 |
+
*
|
59 |
+
|
60 |
+
forval ii = $start($bin_l)0 {
|
61 |
+
if `ii' < -$bin_l {
|
62 |
+
local jj = abs(`ii')
|
63 |
+
local zz = `jj' - $bin_l + 1
|
64 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
65 |
+
forval ee = 1/9 {
|
66 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
67 |
+
}
|
68 |
+
}
|
69 |
+
}
|
70 |
+
*
|
71 |
+
local jj = abs($start)
|
72 |
+
g TRUMP_PRE_M`jj' = 0
|
73 |
+
forval ii = 1/9 {
|
74 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
75 |
+
}
|
76 |
+
|
77 |
+
if $trend==1 {
|
78 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
82 |
+
}
|
83 |
+
local temp = 1/$bin_l
|
84 |
+
local bin_neg = abs($start * `temp')
|
85 |
+
local bin_pos = $end * `temp'
|
86 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
87 |
+
|
88 |
+
mat treat = J(`range',4,1)
|
89 |
+
|
90 |
+
local Nrange = `range' - 2
|
91 |
+
|
92 |
+
forval pos = 1/`Nrange' {
|
93 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
94 |
+
if `lag' > 0 {
|
95 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
96 |
+
}
|
97 |
+
|
98 |
+
local num = abs(`lag')
|
99 |
+
|
100 |
+
if `lag' == 0 {
|
101 |
+
mat treat[`pos',1] = 0
|
102 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
103 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
104 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
105 |
+
}
|
106 |
+
else if `lag' < -$bin_l {
|
107 |
+
local num2 = `num' - $bin_l + 1
|
108 |
+
local num1 = - `num'
|
109 |
+
mat treat[`pos',1] = `num1'
|
110 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
111 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
112 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
113 |
+
}
|
114 |
+
else if `lag' == -$bin_l {
|
115 |
+
mat treat[`pos',1] = -$bin_l
|
116 |
+
mat treat[`pos',2] = 0
|
117 |
+
mat treat[`pos',3] = 0
|
118 |
+
mat treat[`pos',4] = 0
|
119 |
+
}
|
120 |
+
else {
|
121 |
+
di "**"
|
122 |
+
di `lag'
|
123 |
+
di `pos'
|
124 |
+
local num2 = `num' + $bin_l - 1
|
125 |
+
mat treat[`pos',1] = `num2'
|
126 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
127 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
128 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
129 |
+
}
|
130 |
+
}
|
131 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
132 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
133 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
134 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
135 |
+
|
136 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
137 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
138 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
139 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
140 |
+
|
141 |
+
g yy = treat[_n,1] in 1/`range'
|
142 |
+
g eff = treat[_n,2] in 1/`range'
|
143 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
144 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
145 |
+
sort yy
|
146 |
+
|
147 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
148 |
+
duplicates drop yy, force
|
149 |
+
keep eff eff_5 eff_95 yy
|
150 |
+
|
151 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Black Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
152 |
+
graph export "Results\FigureA9A.pdf", as(pdf) replace
|
153 |
+
|
154 |
+
******************************************************************************************************************************************************************
|
155 |
+
|
156 |
+
global start = -105
|
157 |
+
global end = 105
|
158 |
+
global bin_l = 15
|
159 |
+
global var = "ihs_hispanic"
|
160 |
+
global trend = 1
|
161 |
+
|
162 |
+
use "Data\stoplevel_data.dta", clear
|
163 |
+
|
164 |
+
g n_stops = 1
|
165 |
+
foreach var of varlist black hispanic white api {
|
166 |
+
replace `var' = `var'/100
|
167 |
+
}
|
168 |
+
|
169 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
170 |
+
g black_ps = 100*black / n_stops
|
171 |
+
g hispanic_ps = 100*hispanic / n_stops
|
172 |
+
g white_ps = 100*white / n_stops
|
173 |
+
g asian_ps = 100*api / n_stops
|
174 |
+
g ln_stops = ln(n_stops)
|
175 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
176 |
+
g white_nbps = 100*white / (n_stops-black)
|
177 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
178 |
+
|
179 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
180 |
+
g ln_black = ln(black +1)
|
181 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
182 |
+
g ln_hispanic = ln(hispanic+1)
|
183 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
184 |
+
g ln_white = ln(white+1)
|
185 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
186 |
+
g ln_asian = ln(api+1)
|
187 |
+
|
188 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
189 |
+
|
190 |
+
|
191 |
+
g TRUMP_0 = 0
|
192 |
+
forval ii = 1/9 {
|
193 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
194 |
+
}
|
195 |
+
|
196 |
+
forval ii = 1($bin_l)$end{
|
197 |
+
local jj = `ii' + $bin_l - 1
|
198 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
199 |
+
forval ee = 1/9 {
|
200 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
201 |
+
}
|
202 |
+
}
|
203 |
+
g TRUMP_POST_M$end = 0
|
204 |
+
forval ii = 1/9 {
|
205 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
206 |
+
}
|
207 |
+
*
|
208 |
+
|
209 |
+
forval ii = $start($bin_l)0 {
|
210 |
+
if `ii' < -$bin_l {
|
211 |
+
local jj = abs(`ii')
|
212 |
+
local zz = `jj' - $bin_l + 1
|
213 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
214 |
+
forval ee = 1/9 {
|
215 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
216 |
+
}
|
217 |
+
}
|
218 |
+
}
|
219 |
+
*
|
220 |
+
local jj = abs($start)
|
221 |
+
g TRUMP_PRE_M`jj' = 0
|
222 |
+
forval ii = 1/9 {
|
223 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
224 |
+
}
|
225 |
+
|
226 |
+
if $trend==1 {
|
227 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
228 |
+
}
|
229 |
+
else {
|
230 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
231 |
+
}
|
232 |
+
local temp = 1/$bin_l
|
233 |
+
local bin_neg = abs($start * `temp')
|
234 |
+
local bin_pos = $end * `temp'
|
235 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
236 |
+
|
237 |
+
mat treat = J(`range',4,1)
|
238 |
+
|
239 |
+
local Nrange = `range' - 2
|
240 |
+
|
241 |
+
forval pos = 1/`Nrange' {
|
242 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
243 |
+
if `lag' > 0 {
|
244 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
245 |
+
}
|
246 |
+
|
247 |
+
local num = abs(`lag')
|
248 |
+
|
249 |
+
if `lag' == 0 {
|
250 |
+
mat treat[`pos',1] = 0
|
251 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
252 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
253 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
254 |
+
}
|
255 |
+
else if `lag' < -$bin_l {
|
256 |
+
local num2 = `num' - $bin_l + 1
|
257 |
+
local num1 = - `num'
|
258 |
+
mat treat[`pos',1] = `num1'
|
259 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
260 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
261 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
262 |
+
}
|
263 |
+
else if `lag' == -$bin_l {
|
264 |
+
mat treat[`pos',1] = -$bin_l
|
265 |
+
mat treat[`pos',2] = 0
|
266 |
+
mat treat[`pos',3] = 0
|
267 |
+
mat treat[`pos',4] = 0
|
268 |
+
}
|
269 |
+
else {
|
270 |
+
di "**"
|
271 |
+
di `lag'
|
272 |
+
di `pos'
|
273 |
+
local num2 = `num' + $bin_l - 1
|
274 |
+
mat treat[`pos',1] = `num2'
|
275 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
276 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
277 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
278 |
+
}
|
279 |
+
}
|
280 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
281 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
282 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
283 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
284 |
+
|
285 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
286 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
287 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
288 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
289 |
+
|
290 |
+
g yy = treat[_n,1] in 1/`range'
|
291 |
+
g eff = treat[_n,2] in 1/`range'
|
292 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
293 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
294 |
+
sort yy
|
295 |
+
|
296 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
297 |
+
duplicates drop yy, force
|
298 |
+
keep eff eff_5 eff_95 yy
|
299 |
+
|
300 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on Hispanic Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
301 |
+
graph export "Results\FigureA9B.pdf", as(pdf) replace
|
302 |
+
|
303 |
+
******************************************************************************************************************************************************************
|
304 |
+
|
305 |
+
global start = -105
|
306 |
+
global end = 105
|
307 |
+
global bin_l = 15
|
308 |
+
global var = "ihs_white"
|
309 |
+
global trend = 1
|
310 |
+
|
311 |
+
use "Data\stoplevel_data.dta", clear
|
312 |
+
|
313 |
+
g n_stops = 1
|
314 |
+
foreach var of varlist black hispanic white api {
|
315 |
+
replace `var' = `var'/100
|
316 |
+
}
|
317 |
+
|
318 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
319 |
+
|
320 |
+
g black_ps = 100*black / n_stops
|
321 |
+
g hispanic_ps = 100*hispanic / n_stops
|
322 |
+
g white_ps = 100*white / n_stops
|
323 |
+
g asian_ps = 100*api / n_stops
|
324 |
+
g ln_stops = ln(n_stops)
|
325 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
326 |
+
g white_nbps = 100*white / (n_stops-black)
|
327 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
328 |
+
|
329 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
330 |
+
g ln_black = ln(black +1)
|
331 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
332 |
+
g ln_hispanic = ln(hispanic+1)
|
333 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
334 |
+
g ln_white = ln(white+1)
|
335 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
336 |
+
g ln_asian = ln(api+1)
|
337 |
+
|
338 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
339 |
+
|
340 |
+
|
341 |
+
g TRUMP_0 = 0
|
342 |
+
forval ii = 1/9 {
|
343 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
344 |
+
}
|
345 |
+
|
346 |
+
forval ii = 1($bin_l)$end{
|
347 |
+
local jj = `ii' + $bin_l - 1
|
348 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
349 |
+
forval ee = 1/9 {
|
350 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
351 |
+
}
|
352 |
+
}
|
353 |
+
g TRUMP_POST_M$end = 0
|
354 |
+
forval ii = 1/9 {
|
355 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
356 |
+
}
|
357 |
+
*
|
358 |
+
|
359 |
+
forval ii = $start($bin_l)0 {
|
360 |
+
if `ii' < -$bin_l {
|
361 |
+
local jj = abs(`ii')
|
362 |
+
local zz = `jj' - $bin_l + 1
|
363 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
364 |
+
forval ee = 1/9 {
|
365 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
*
|
370 |
+
local jj = abs($start)
|
371 |
+
g TRUMP_PRE_M`jj' = 0
|
372 |
+
forval ii = 1/9 {
|
373 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
374 |
+
}
|
375 |
+
|
376 |
+
if $trend==1 {
|
377 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
378 |
+
}
|
379 |
+
else {
|
380 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
381 |
+
}
|
382 |
+
local temp = 1/$bin_l
|
383 |
+
local bin_neg = abs($start * `temp')
|
384 |
+
local bin_pos = $end * `temp'
|
385 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
386 |
+
|
387 |
+
mat treat = J(`range',4,1)
|
388 |
+
|
389 |
+
local Nrange = `range' - 2
|
390 |
+
|
391 |
+
forval pos = 1/`Nrange' {
|
392 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
393 |
+
if `lag' > 0 {
|
394 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
395 |
+
}
|
396 |
+
|
397 |
+
local num = abs(`lag')
|
398 |
+
|
399 |
+
if `lag' == 0 {
|
400 |
+
mat treat[`pos',1] = 0
|
401 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
402 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
403 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
404 |
+
}
|
405 |
+
else if `lag' < -$bin_l {
|
406 |
+
local num2 = `num' - $bin_l + 1
|
407 |
+
local num1 = - `num'
|
408 |
+
mat treat[`pos',1] = `num1'
|
409 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
410 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
411 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
412 |
+
}
|
413 |
+
else if `lag' == -$bin_l {
|
414 |
+
mat treat[`pos',1] = -$bin_l
|
415 |
+
mat treat[`pos',2] = 0
|
416 |
+
mat treat[`pos',3] = 0
|
417 |
+
mat treat[`pos',4] = 0
|
418 |
+
}
|
419 |
+
else {
|
420 |
+
di "**"
|
421 |
+
di `lag'
|
422 |
+
di `pos'
|
423 |
+
local num2 = `num' + $bin_l - 1
|
424 |
+
mat treat[`pos',1] = `num2'
|
425 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
426 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
427 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
428 |
+
}
|
429 |
+
}
|
430 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
431 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
432 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
433 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
434 |
+
|
435 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
436 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
437 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
438 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
439 |
+
|
440 |
+
g yy = treat[_n,1] in 1/`range'
|
441 |
+
g eff = treat[_n,2] in 1/`range'
|
442 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
443 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
444 |
+
sort yy
|
445 |
+
|
446 |
+
*keep if yy>`start'-1 & yy<`end'+1
|
447 |
+
duplicates drop yy, force
|
448 |
+
keep eff eff_5 eff_95 yy
|
449 |
+
|
450 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on White Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
451 |
+
graph export "Results\FigureA9D.pdf", as(pdf) replace
|
452 |
+
|
453 |
+
******************************************************************************************************************************************************************
|
454 |
+
|
455 |
+
global start = -105
|
456 |
+
global end = 105
|
457 |
+
global bin_l = 15
|
458 |
+
global var = "ihs_asian"
|
459 |
+
global trend = 1
|
460 |
+
|
461 |
+
use "Data\stoplevel_data.dta", clear
|
462 |
+
|
463 |
+
g n_stops = 1
|
464 |
+
foreach var of varlist black hispanic white api {
|
465 |
+
replace `var' = `var'/100
|
466 |
+
}
|
467 |
+
|
468 |
+
collapse (sum) n_stops black hispanic white api (first) dist_event* , by(county_fips day_id)
|
469 |
+
|
470 |
+
g black_ps = 100*black / n_stops
|
471 |
+
g hispanic_ps = 100*hispanic / n_stops
|
472 |
+
g white_ps = 100*white / n_stops
|
473 |
+
g asian_ps = 100*api / n_stops
|
474 |
+
g ln_stops = ln(n_stops)
|
475 |
+
g hispanic_nbps = 100*hispanic / (n_stops-black)
|
476 |
+
g white_nbps = 100*white / (n_stops-black)
|
477 |
+
g asian_nbps = 100*asian / (n_stops-black)
|
478 |
+
|
479 |
+
g ihs_black= log(black +(black +1)^(1/2))
|
480 |
+
g ln_black = ln(black +1)
|
481 |
+
g ihs_hispanic = log(hispanic+(hispanic+1)^(1/2))
|
482 |
+
g ln_hispanic = ln(hispanic+1)
|
483 |
+
g ihs_white = log(white+(white+1)^(1/2))
|
484 |
+
g ln_white = ln(white+1)
|
485 |
+
g ihs_asian = log(api+(api+1)^(1/2))
|
486 |
+
g ln_asian = ln(api+1)
|
487 |
+
|
488 |
+
g ihs_stops = log(n_stops+(n_stops+1)^(1/2))
|
489 |
+
|
490 |
+
|
491 |
+
g TRUMP_0 = 0
|
492 |
+
forval ii = 1/9 {
|
493 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
494 |
+
}
|
495 |
+
|
496 |
+
forval ii = 1($bin_l)$end{
|
497 |
+
local jj = `ii' + $bin_l - 1
|
498 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
499 |
+
forval ee = 1/9 {
|
500 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
501 |
+
}
|
502 |
+
}
|
503 |
+
g TRUMP_POST_M$end = 0
|
504 |
+
forval ii = 1/9 {
|
505 |
+
replace TRUMP_POST_M$end = 1 if (dist_event`ii' > $end & dist_event`ii'!=.)
|
506 |
+
}
|
507 |
+
*
|
508 |
+
|
509 |
+
forval ii = $start($bin_l)0 {
|
510 |
+
if `ii' < -$bin_l {
|
511 |
+
local jj = abs(`ii')
|
512 |
+
local zz = `jj' - $bin_l + 1
|
513 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
514 |
+
forval ee = 1/9 {
|
515 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
516 |
+
}
|
517 |
+
}
|
518 |
+
}
|
519 |
+
*
|
520 |
+
local jj = abs($start)
|
521 |
+
g TRUMP_PRE_M`jj' = 0
|
522 |
+
forval ii = 1/9 {
|
523 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < $start & dist_event`ii'!=.)
|
524 |
+
}
|
525 |
+
|
526 |
+
if $trend==1 {
|
527 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
528 |
+
}
|
529 |
+
else {
|
530 |
+
reghdfe $var 1.TRUMP_PRE_* 1.TRUMP_0 1.TRUMP_POST_* ihs_stops [w=n_stops], a(i.county_fips i.day_id) cluster(county_fips day_id)
|
531 |
+
}
|
532 |
+
local temp = 1/$bin_l
|
533 |
+
local bin_neg = abs($start * `temp')
|
534 |
+
local bin_pos = $end * `temp'
|
535 |
+
local range = round(`bin_neg' + `bin_pos' + 3)
|
536 |
+
|
537 |
+
mat treat = J(`range',4,1)
|
538 |
+
|
539 |
+
local Nrange = `range' - 2
|
540 |
+
|
541 |
+
forval pos = 1/`Nrange' {
|
542 |
+
local lag = $start + $bin_l*`pos' - $bin_l
|
543 |
+
if `lag' > 0 {
|
544 |
+
local lag = $start + $bin_l*`pos' - $bin_l - $bin_l + 1
|
545 |
+
}
|
546 |
+
|
547 |
+
local num = abs(`lag')
|
548 |
+
|
549 |
+
if `lag' == 0 {
|
550 |
+
mat treat[`pos',1] = 0
|
551 |
+
mat treat[`pos',2] = _b[1.TRUMP_0]
|
552 |
+
mat treat[`pos',3] = _b[1.TRUMP_0] + _se[1.TRUMP_0]*invttail(e(N),0.025)
|
553 |
+
mat treat[`pos',4] = _b[1.TRUMP_0] - _se[1.TRUMP_0]*invttail(e(N),0.025)
|
554 |
+
}
|
555 |
+
else if `lag' < -$bin_l {
|
556 |
+
local num2 = `num' - $bin_l + 1
|
557 |
+
local num1 = - `num'
|
558 |
+
mat treat[`pos',1] = `num1'
|
559 |
+
mat treat[`pos',2] = _b[1.TRUMP_PRE_`num'_`num2']
|
560 |
+
mat treat[`pos',3] = _b[1.TRUMP_PRE_`num'_`num2'] + _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
561 |
+
mat treat[`pos',4] = _b[1.TRUMP_PRE_`num'_`num2'] - _se[1.TRUMP_PRE_`num'_`num2']*invttail(e(N),0.025)
|
562 |
+
}
|
563 |
+
else if `lag' == -$bin_l {
|
564 |
+
mat treat[`pos',1] = -$bin_l
|
565 |
+
mat treat[`pos',2] = 0
|
566 |
+
mat treat[`pos',3] = 0
|
567 |
+
mat treat[`pos',4] = 0
|
568 |
+
}
|
569 |
+
else {
|
570 |
+
di "**"
|
571 |
+
di `lag'
|
572 |
+
di `pos'
|
573 |
+
local num2 = `num' + $bin_l - 1
|
574 |
+
mat treat[`pos',1] = `num2'
|
575 |
+
mat treat[`pos',2] = _b[1.TRUMP_POST_`num'_`num2']
|
576 |
+
mat treat[`pos',3] = _b[1.TRUMP_POST_`num'_`num2'] + _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
577 |
+
mat treat[`pos',4] = _b[1.TRUMP_POST_`num'_`num2'] - _se[1.TRUMP_POST_`num'_`num2']*invttail(e(N),0.025)
|
578 |
+
}
|
579 |
+
}
|
580 |
+
mat treat[`range'-1,1] = $start - $bin_l - 1
|
581 |
+
mat treat[`range'-1,2] = _b[1.TRUMP_PRE_M`jj']
|
582 |
+
mat treat[`range'-1,3] = _b[1.TRUMP_PRE_M`jj'] + _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
583 |
+
mat treat[`range'-1,4] = _b[1.TRUMP_PRE_M`jj'] - _se[1.TRUMP_PRE_M`jj']*invttail(e(N),0.025)
|
584 |
+
|
585 |
+
mat treat[`range',1] = $end + $bin_l + 1
|
586 |
+
mat treat[`range',2] = _b[1.TRUMP_POST_M$end]
|
587 |
+
mat treat[`range',3] = _b[1.TRUMP_POST_M$end] + _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
588 |
+
mat treat[`range',4] = _b[1.TRUMP_POST_M$end] - _se[1.TRUMP_POST_M$end] *invttail(e(N),0.025)
|
589 |
+
|
590 |
+
g yy = treat[_n,1] in 1/`range'
|
591 |
+
g eff = treat[_n,2] in 1/`range'
|
592 |
+
g eff_5 = treat[_n,3] in 1/`range'
|
593 |
+
g eff_95 = treat[_n,4] in 1/`range'
|
594 |
+
sort yy
|
595 |
+
|
596 |
+
duplicates drop yy, force
|
597 |
+
keep eff eff_5 eff_95 yy
|
598 |
+
|
599 |
+
twoway (rcap eff_5 eff_95 yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1) (scatter eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1)(line eff yy if yy>$start - $bin_l - 1 & yy<$end + $bin_l + 1, xline(0,lp(-)) yline(0,lp(-))) , xlabel(-105(15)105) ylabel(-0.1(0.05)0.1) graphregion(fcolor(white)) xtitle("Days From Trump") ytitle("Effect on API Stops") legend(order(1 "95% Confidence Interval" 2 "Effect"))
|
600 |
+
graph export "Results\FigureA9C.pdf", as(pdf) replace
|
39/replication_package/Do/Main.do
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
**********************************************************************
|
2 |
+
*** Replication File for "Inflammatory Political Campaigns and
|
3 |
+
*** Racial Bias in Policing" by Pauline Grosjean, Federico Masera, and
|
4 |
+
*** Hasin Yousaf. For Publication at The Quarterly Journal of Economics
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
*** Define your own course directory.
|
8 |
+
set more off
|
9 |
+
cd "SET YOUR OWN PATH"
|
10 |
+
|
11 |
+
|
12 |
+
do "Do\Table1.do"
|
13 |
+
do "Do\Table2.do"
|
14 |
+
do "Do\Table3.do"
|
15 |
+
do "Do\Table4.do"
|
16 |
+
do "Do\Table5.do"
|
17 |
+
do "Do\Table6.do"
|
18 |
+
do "Do\Table7.do"
|
19 |
+
|
20 |
+
|
21 |
+
do "Do\Figure1.do"
|
22 |
+
do "Do\Figure2.do"
|
39/replication_package/Do/Table1.do
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 1
|
4 |
+
*** Impact of Trump Rallies on the Probability of a Black Stop
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
10 |
+
outreg2 using "Results\Table1.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
11 |
+
|
12 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_31_60 TRUMP_POST_61_90 TRUMP_POST_M90 TRUMP_PRE_M90, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
13 |
+
outreg2 using "Results\Table1.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 TRUMP_POST_31_60 TRUMP_POST_61_90) label nonotes nocons noni
|
14 |
+
|
15 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id) cluster(county_fips day_id)
|
16 |
+
outreg2 using "Results\Table1.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
17 |
+
|
18 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id i.county_fips#c.day_sq) cluster(county_fips day_id)
|
19 |
+
outreg2 using "Results\Table1.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
20 |
+
summ black
|
21 |
+
|
22 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 if around30days==1 | trumpcounties==0, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
23 |
+
outreg2 using "Results\Table1.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
24 |
+
summ black if around30days==1 | trumpcounties==0
|
25 |
+
|
26 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if trumpcounties==1, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
27 |
+
outreg2 using "Results\Table1.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
28 |
+
summ black if trumpcounties==1
|
29 |
+
|
39/replication_package/Do/Table2.do
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 2
|
4 |
+
*** Triple Difference Results: Probability and Number of Stops by Race or Ethnicity
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
*do "Do\preparing_countydayrace_data"
|
8 |
+
|
9 |
+
use "Data\countydayrace_data.dta", clear
|
10 |
+
|
11 |
+
|
12 |
+
reghdfe prob_stop_race 1.TRUMP_*30#1.black 1.TRUMP_*30#1.hispanic 1.TRUMP_*30#1.asian [w=n_stops] if subject_race!=4, a(i.county_id##i.hispanic i.county_id##i.asian i.day_id##i.hispanic i.day_id##i.asian i.hispanic#i.county_id#c.day_id i.asian#i.county_id#c.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
13 |
+
***Effect on blacks (vs whites)
|
14 |
+
lincom _b[1.TRUMP_POST_1_30#1.black]
|
15 |
+
local est_black_white = `r(estimate)'
|
16 |
+
local se_black_white = `r(se)'
|
17 |
+
***Effect on blacks (vs hispanics)
|
18 |
+
lincom _b[1.TRUMP_POST_1_30#1.black] - _b[1.TRUMP_POST_1_30#1.hispanic]
|
19 |
+
local est_black_hisp = `r(estimate)'
|
20 |
+
local se_black_hisp = `r(se)'
|
21 |
+
***Effect on blacks (vs asians)
|
22 |
+
lincom _b[1.TRUMP_POST_1_30#1.black] - _b[1.TRUMP_POST_1_30#1.asian]
|
23 |
+
local est_black_api = `r(estimate)'
|
24 |
+
local se_black_api = `r(se)'
|
25 |
+
***Effect on hispanics (vs whites)
|
26 |
+
lincom _b[1.TRUMP_POST_1_30#1.hispanic]
|
27 |
+
***Effect on asian (vs whites)
|
28 |
+
lincom _b[1.TRUMP_POST_1_30#1.asian]
|
29 |
+
***Effect on asian (vs hispanic)
|
30 |
+
lincom _b[1.TRUMP_POST_1_30#1.asian] - _b[1.TRUMP_POST_1_30#1.hispanic]
|
31 |
+
outreg2 using "Results/Table2.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) label nonotes nocons noni
|
32 |
+
summ prob_stop_race if subject_race!=4
|
33 |
+
|
34 |
+
reghdfe ihs_stop_race 1.TRUMP_*30#1.black 1.TRUMP_*30#1.hispanic 1.TRUMP_*30#1.asian ihn_stops [w=n_stops] if subject_race!=4, a(i.county_id##i.hispanic i.county_id##i.asian i.day_id##i.hispanic i.day_id##i.asian i.hispanic#i.county_id#c.day_id i.asian#i.county_id#c.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
35 |
+
***Effect on blacks (vs whites)
|
36 |
+
lincom _b[1.TRUMP_POST_1_30#1.black]
|
37 |
+
local est_black_white = `r(estimate)'
|
38 |
+
local se_black_white = `r(se)'
|
39 |
+
***Effect on blacks (vs hispanics)
|
40 |
+
lincom _b[1.TRUMP_POST_1_30#1.black] - _b[1.TRUMP_POST_1_30#1.hispanic]
|
41 |
+
local est_black_hisp = `r(estimate)'
|
42 |
+
local se_black_hisp = `r(se)'
|
43 |
+
***Effect on blacks (vs asians)
|
44 |
+
lincom _b[1.TRUMP_POST_1_30#1.black] - _b[1.TRUMP_POST_1_30#1.asian]
|
45 |
+
local est_black_api = `r(estimate)'
|
46 |
+
local se_black_api = `r(se)'
|
47 |
+
***Effect on hispanics (vs whites)
|
48 |
+
lincom _b[1.TRUMP_POST_1_30#1.hispanic]
|
49 |
+
***Effect on asian (vs whites)
|
50 |
+
lincom _b[1.TRUMP_POST_1_30#1.asian]
|
51 |
+
***Effect on asian (vs hispanic)
|
52 |
+
lincom _b[1.TRUMP_POST_1_30#1.asian] - _b[1.TRUMP_POST_1_30#1.hispanic]
|
53 |
+
outreg2 using "Results/Table2.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) label nonotes nocons noni
|
54 |
+
summ ihs_stop_race if subject_race!=4
|
55 |
+
|
56 |
+
|
39/replication_package/Do/Table3.do
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 3
|
4 |
+
*** Driver Behavior
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
*** Panel A
|
8 |
+
use "Data\fars_data.dta"
|
9 |
+
|
10 |
+
reghdfe ihsinc 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_PRE_M30 1.TRUMP_POST_M30 [aweight=incidents], a(i.county_fips i.date) cluster(county_fips date)
|
11 |
+
outreg2 using "Results/Table3A.txt", replace keep(1.TRUMP_POST_1_30) dec(3) nocons
|
12 |
+
|
13 |
+
foreach y in ihsfatal ihsfatalviolation ihsblack ihsnonblack ihswhite ihshispani ihsmexican {
|
14 |
+
reghdfe `y' 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_PRE_M30 1.TRUMP_POST_M30 [aweight=incidents], a(i.county_fips i.date) cluster(county_fips date)
|
15 |
+
outreg2 using "Results/Table3A.txt", append keep(1.TRUMP_POST_1_30) dec(3) nocons
|
16 |
+
|
17 |
+
}
|
18 |
+
|
19 |
+
*** Panel B
|
20 |
+
use "Data\stoplevel_data.dta", clear
|
21 |
+
|
22 |
+
reghdfe blackcollision TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
23 |
+
outreg2 using "Results/Table3B.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
24 |
+
|
25 |
+
foreach var of varlist nonblackcollision whitecollision hispaniccollision blackradar nonblackradar whiteradar hispanicradar {
|
26 |
+
reghdfe `var' TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
27 |
+
outreg2 using "Results/Table3B.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
28 |
+
}
|
29 |
+
|
30 |
+
summ blackcollision
|
31 |
+
foreach var of varlist nonblackcollision whitecollision hispaniccollision blackradar nonblackradar whiteradar hispanicradar {
|
32 |
+
summ `var'
|
33 |
+
}
|
39/replication_package/Do/Table4.do
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 4
|
4 |
+
*** Police Behavior
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
reghdfe black 1.TRUMP_POST_1_30 1.TRUMP_POST_1_30#0.state_pd TRUMP_0 TRUMP_POST_M30 TRUMP_PRE_M30 , a(i.state_pd i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id )
|
10 |
+
outreg2 using "Results/Table4.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30 1.TRUMP_POST_1_30#0.state_pd) addtext("County FE", "YES", "Day FE", "YES", "CountyXDay", "YES", "Additional FE" , "Agency") label nonotes nocons noni
|
11 |
+
lincom 1.TRUMP_POST_1_30 + 1.TRUMP_POST_1_30#0.state_pd
|
12 |
+
|
13 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id i.hour) cluster(county_fips day_id)
|
14 |
+
outreg2 using "Results/Table4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) addtext("County FE", "YES", "Day FE", "YES", "CountyXDay", "YES", "Additional FE" , "Hour of Stop") label nonotes nocons noni
|
15 |
+
|
16 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id i.county_fips#i.state_pd) cluster(county_fips day_id)
|
17 |
+
outreg2 using "Results/Table4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) addtext("County FE", "YES", "Day FE", "YES", "CountyXDay", "YES", "Additional FE" , "Agency") label nonotes nocons noni
|
18 |
+
|
19 |
+
egen officer_id=group(officer_id_hash)
|
20 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id i.officer_id) cluster(county_fips day_id)
|
21 |
+
outreg2 using "Results/Table4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) addtext("County FE", "YES", "Day FE", "YES", "CountyXDay", "YES", "Additional FE" , "Officer") label nonotes nocons
|
22 |
+
|
23 |
+
summ black if state_pd!=.
|
24 |
+
summ black if hour!=.
|
25 |
+
summ black if officer_id_hash!=""
|
39/replication_package/Do/Table5.do
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 5
|
4 |
+
*** Role of Estimated Offcer Bias in the Effect of Trump Rallies on the Probability of a Black Stop
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\officerbias.dta", clear
|
8 |
+
|
9 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 bias_int1 if officer_id_hash!="" , a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
10 |
+
outreg2 using "Results/Table5.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off1 bias_int1) label nonotes nocons noni
|
11 |
+
|
12 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 bias_int1 if officer_id_hash!="" , a(i.officer_id i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
13 |
+
outreg2 using "Results/Table5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off1 bias_int1) label nonotes nocons noni
|
14 |
+
|
15 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 bias_int2 if officer_id_hash!="" , a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
16 |
+
outreg2 using "Results/Table5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off2 bias_int2) label nonotes nocons noni
|
17 |
+
|
18 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 bias_int2 if officer_id_hash!="" , a(i.officer_id i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
19 |
+
outreg2 using "Results/Table5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off2 bias_int2) label nonotes nocons noni
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
|
39/replication_package/Do/Table6.do
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 6
|
4 |
+
*** Role of Local Characteristics in the Effect of Trump Rallies on the Probability of a Black Stop
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
keep black county_fips day_id TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 racial_resent_a racial_resent_b any_slaves_1860 alt_cottonsui ihsbl_lynch ihsbl_exec dem_p rep medianincome coll d_tradeusch_pw d_tradeotch_pw_lag
|
10 |
+
|
11 |
+
mat treat = J(11,4,1)
|
12 |
+
|
13 |
+
summ racial_resent_a
|
14 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
15 |
+
g interaction = TRUMP_POST_1_30 * racial_resent_asd
|
16 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.racial_resent_a, a(i.county_fips i.day_id) cluster(county_fips)
|
17 |
+
outreg2 using "Results/Table6.txt", replace dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Racial Resentment A","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
18 |
+
drop interaction
|
19 |
+
|
20 |
+
summ racial_resent_b
|
21 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
22 |
+
g interaction = TRUMP_POST_1_30 * racial_resent_bsd
|
23 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.racial_resent_b, a(i.county_fips i.day_id) cluster(county_fips)
|
24 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Racial Resentment B","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
25 |
+
drop interaction
|
26 |
+
|
27 |
+
g interaction = TRUMP_POST_1_30 * any_slaves_1860
|
28 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#1.any_slaves_1860 , a(i.county_fips i.day_id) cluster(county_fips)
|
29 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Any Slaves","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
30 |
+
drop interaction
|
31 |
+
|
32 |
+
su alt_cottonsui , detail
|
33 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
34 |
+
g interaction = TRUMP_POST_1_30 * alt_cottonsuisd
|
35 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.alt_cottonsui , a(i.county_fips i.day_id) cluster(county_fips)
|
36 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Cotton","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
37 |
+
drop interaction
|
38 |
+
|
39 |
+
su ihsbl_lynch , detail
|
40 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
41 |
+
g interaction = TRUMP_POST_1_30 * ihsbl_lynchsd
|
42 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.ihsbl_lynch , a(i.county_fips i.day_id) cluster(county_fips)
|
43 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Lynchings","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
44 |
+
drop interaction
|
45 |
+
|
46 |
+
su ihsbl_exec , detail
|
47 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
48 |
+
g interaction = TRUMP_POST_1_30 * ihsbl_execsd
|
49 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.ihsbl_exec , a(i.county_fips i.day_id) cluster(county_fips)
|
50 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","IHS Executations","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
51 |
+
drop interaction
|
52 |
+
|
53 |
+
**** PANEL B
|
54 |
+
su dem_p , detail
|
55 |
+
g dem_psd = ( dem_p - r(mean))/r(sd)
|
56 |
+
local sd = r(sd)
|
57 |
+
g interaction = TRUMP_POST_1_30 * dem_psd
|
58 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.dem_p , a(i.county_fips i.day_id) cluster(county_fips)
|
59 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","DEM Share","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
60 |
+
drop interaction
|
61 |
+
|
62 |
+
g interaction = TRUMP_POST_1_30 * rep
|
63 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.rep , a(i.county_fips i.day_id) cluster(county_fips)
|
64 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","County Sheriff","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
65 |
+
drop interaction
|
66 |
+
|
67 |
+
su medianincome , detail
|
68 |
+
g incomesd = ( medianincome - r(mean))/r(sd)
|
69 |
+
g interaction = TRUMP_POST_1_30 * incomesd
|
70 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.medianincome , a(i.county_fips i.day_id) cluster(county_fips)
|
71 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Income","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
72 |
+
drop interaction
|
73 |
+
|
74 |
+
su coll , detail
|
75 |
+
g collsd = ( coll - r(mean))/r(sd)
|
76 |
+
g interaction = TRUMP_POST_1_30 * collsd
|
77 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.coll , a(i.county_fips i.day_id) cluster(county_fips)
|
78 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","College","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
79 |
+
drop interaction
|
80 |
+
|
81 |
+
su d_tradeusch_pw , detail
|
82 |
+
g d_tradeusch_pwsd = ( d_tradeusch_pw - r(mean))/r(sd)
|
83 |
+
g interaction = TRUMP_POST_1_30 * d_tradeusch_pwsd
|
84 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.d_tradeusch_pw , a(i.county_fips i.day_id) cluster(county_fips)
|
85 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","China Shock","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
86 |
+
drop interaction
|
87 |
+
|
88 |
+
su d_tradeotch_pw_lag , detail
|
89 |
+
g dtrdothchsd = ( d_tradeotch_pw_lag - r(mean))/r(sd)
|
90 |
+
g interaction = TRUMP_POST_1_30 * dtrdothchsd
|
91 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.dtrdothch , a(i.county_fips i.day_id) cluster(county_fips)
|
92 |
+
outreg2 using "Results/Table6.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","China Shock IV","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
93 |
+
drop interaction
|
39/replication_package/Do/Table7.do
ADDED
@@ -0,0 +1,1170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE 7
|
4 |
+
*** Role of Local Characteristics in the Effect of Trump Rallies on the Probability of a Black Stop
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
qui:{
|
8 |
+
|
9 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
10 |
+
set obs 2655
|
11 |
+
replace A="totnonstopwords" in 2655
|
12 |
+
foreach v of varlist B-GI {
|
13 |
+
egen totwordsX=total(`v')
|
14 |
+
replace `v'=totwordsX in 2655
|
15 |
+
drop totwordsX
|
16 |
+
}
|
17 |
+
foreach v of varlist B-GI {
|
18 |
+
local x : variable label `v'
|
19 |
+
rename `v' v`x'
|
20 |
+
}
|
21 |
+
keep if A=="DRUG" | A=="CRIME" | A=="RAPE" | A=="CRIMIN" | A=="GUN" | A=="PRISON" | A=="RIOT" | A=="THUG" | A=="URBAN" | A=="AFRICAN" | A=="BLACK" | A=="RACE" | A=="RACIAL" | A=="RACIST" | A=="totnonstopwords"
|
22 |
+
keep A v*
|
23 |
+
|
24 |
+
reshape long v, i(A) j(id)
|
25 |
+
sort id
|
26 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
27 |
+
by id: egen C = max(B)
|
28 |
+
keep if A=="totnonstopwords"
|
29 |
+
keep id v C
|
30 |
+
rename C A
|
31 |
+
replace A=0 if A==.
|
32 |
+
rename v totnonstopwords
|
33 |
+
rename A word
|
34 |
+
merge 1:1 id using "Data\speech_data.dta"
|
35 |
+
drop if _merge==2
|
36 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
37 |
+
replace totwords=-999 if totnonstopwords==-999
|
38 |
+
g inspeechdata = (_merge==3)
|
39 |
+
drop state A _merge id
|
40 |
+
destring county_fips, replace
|
41 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
42 |
+
drop if county_fips==.
|
43 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
44 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
45 |
+
|
46 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
47 |
+
keep if _merge!=1
|
48 |
+
|
49 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
50 |
+
forval ee = 9(-1)1 {
|
51 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
52 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
53 |
+
}
|
54 |
+
|
55 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
56 |
+
g nwords = .
|
57 |
+
forval ee = 9(-1)1 {
|
58 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
59 |
+
}
|
60 |
+
|
61 |
+
su nwords
|
62 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
63 |
+
|
64 |
+
su bias_off1
|
65 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
66 |
+
|
67 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
68 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
69 |
+
|
70 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
71 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
72 |
+
|
73 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
74 |
+
|
75 |
+
noisily: di "ALL REFERENCES: "
|
76 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
77 |
+
outreg2 using "Results/Table7A.txt", replace dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Explicit+Implicit") label nonotes nocons noni
|
78 |
+
|
79 |
+
****explicit
|
80 |
+
|
81 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
82 |
+
set obs 2655
|
83 |
+
replace A="totnonstopwords" in 2655
|
84 |
+
foreach v of varlist B-GI {
|
85 |
+
egen totwordsX=total(`v')
|
86 |
+
replace `v'=totwordsX in 2655
|
87 |
+
drop totwordsX
|
88 |
+
}
|
89 |
+
foreach v of varlist B-GI {
|
90 |
+
local x : variable label `v'
|
91 |
+
rename `v' v`x'
|
92 |
+
}
|
93 |
+
keep if A=="AFRICAN" | A=="BLACK" | A=="RACE" | A=="RACIAL" | A=="RACIST" | A=="totnonstopwords"
|
94 |
+
keep A v*
|
95 |
+
|
96 |
+
|
97 |
+
reshape long v, i(A) j(id)
|
98 |
+
sort id
|
99 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
100 |
+
by id: egen C = max(B)
|
101 |
+
keep if A=="totnonstopwords"
|
102 |
+
keep id v C
|
103 |
+
rename C A
|
104 |
+
replace A=0 if A==.
|
105 |
+
rename v totnonstopwords
|
106 |
+
rename A word
|
107 |
+
merge 1:1 id using "Data\speech_data.dta"
|
108 |
+
drop if _merge==2
|
109 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
110 |
+
replace totwords=-999 if totnonstopwords==-999
|
111 |
+
g inspeechdata = (_merge==3)
|
112 |
+
drop state A _merge id
|
113 |
+
destring county_fips, replace
|
114 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
115 |
+
drop if county_fips==.
|
116 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
117 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
118 |
+
|
119 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
120 |
+
keep if _merge!=1
|
121 |
+
|
122 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
123 |
+
forval ee = 9(-1)1 {
|
124 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
125 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
126 |
+
}
|
127 |
+
|
128 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
129 |
+
g nwords = .
|
130 |
+
forval ee = 9(-1)1 {
|
131 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
132 |
+
}
|
133 |
+
|
134 |
+
su nwords
|
135 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
136 |
+
|
137 |
+
su bias_off1
|
138 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
139 |
+
|
140 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
141 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
142 |
+
|
143 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
144 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
145 |
+
|
146 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
147 |
+
|
148 |
+
|
149 |
+
noisily: di "EXPLICIT REFERENCES"
|
150 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
151 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Explicit") label nonotes nocons noni
|
152 |
+
|
153 |
+
|
154 |
+
|
155 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
156 |
+
set obs 2655
|
157 |
+
replace A="totnonstopwords" in 2655
|
158 |
+
foreach v of varlist B-GI {
|
159 |
+
egen totwordsX=total(`v')
|
160 |
+
replace `v'=totwordsX in 2655
|
161 |
+
drop totwordsX
|
162 |
+
}
|
163 |
+
foreach v of varlist B-GI {
|
164 |
+
local x : variable label `v'
|
165 |
+
rename `v' v`x'
|
166 |
+
}
|
167 |
+
keep if A=="DRUG" | A=="CRIME" | A=="RAPE" | A=="CRIMIN" | A=="GUN" | A=="PRISON" | A=="RIOT" | A=="THUG" | A=="URBAN" | A=="totnonstopwords"
|
168 |
+
keep A v*
|
169 |
+
|
170 |
+
reshape long v, i(A) j(id)
|
171 |
+
sort id
|
172 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
173 |
+
by id: egen C = max(B)
|
174 |
+
keep if A=="totnonstopwords"
|
175 |
+
keep id v C
|
176 |
+
rename C A
|
177 |
+
replace A=0 if A==.
|
178 |
+
rename v totnonstopwords
|
179 |
+
rename A word
|
180 |
+
merge 1:1 id using "Data\speech_data.dta"
|
181 |
+
drop if _merge==2
|
182 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
183 |
+
replace totwords=-999 if totnonstopwords==-999
|
184 |
+
g inspeechdata = (_merge==3)
|
185 |
+
drop state A _merge id
|
186 |
+
destring county_fips, replace
|
187 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
188 |
+
drop if county_fips==.
|
189 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
190 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
191 |
+
|
192 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
193 |
+
keep if _merge!=1
|
194 |
+
|
195 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
196 |
+
forval ee = 9(-1)1 {
|
197 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
198 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
199 |
+
}
|
200 |
+
|
201 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
202 |
+
g nwords = .
|
203 |
+
forval ee = 9(-1)1 {
|
204 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
205 |
+
}
|
206 |
+
|
207 |
+
su nwords
|
208 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
209 |
+
|
210 |
+
su bias_off1
|
211 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
212 |
+
|
213 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
214 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
215 |
+
|
216 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
217 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
218 |
+
|
219 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
220 |
+
|
221 |
+
noisily: di "IMPLICIT: "
|
222 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
223 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Implicit") label nonotes nocons noni
|
224 |
+
|
225 |
+
|
226 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
227 |
+
set obs 2655
|
228 |
+
replace A="totnonstopwords" in 2655
|
229 |
+
foreach v of varlist B-GI {
|
230 |
+
egen totwordsX=total(`v')
|
231 |
+
replace `v'=totwordsX in 2655
|
232 |
+
drop totwordsX
|
233 |
+
}
|
234 |
+
foreach v of varlist B-GI {
|
235 |
+
local x : variable label `v'
|
236 |
+
rename `v' v`x'
|
237 |
+
}
|
238 |
+
keep if A=="CHINA" | A=="TRADE" | A=="NAFTA" | A=="totnonstopwords"
|
239 |
+
keep A v*
|
240 |
+
|
241 |
+
reshape long v, i(A) j(id)
|
242 |
+
sort id
|
243 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
244 |
+
by id: egen C = max(B)
|
245 |
+
keep if A=="totnonstopwords"
|
246 |
+
keep id v C
|
247 |
+
rename C A
|
248 |
+
replace A=0 if A==.
|
249 |
+
rename v totnonstopwords
|
250 |
+
rename A word
|
251 |
+
merge 1:1 id using "Data\speech_data.dta"
|
252 |
+
drop if _merge==2
|
253 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
254 |
+
replace totwords=-999 if totnonstopwords==-999
|
255 |
+
g inspeechdata = (_merge==3)
|
256 |
+
drop state A _merge id
|
257 |
+
destring county_fips, replace
|
258 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
259 |
+
drop if county_fips==.
|
260 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
261 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
262 |
+
|
263 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
264 |
+
keep if _merge!=1
|
265 |
+
|
266 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
267 |
+
forval ee = 9(-1)1 {
|
268 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
269 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
270 |
+
}
|
271 |
+
|
272 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
273 |
+
g nwords = .
|
274 |
+
forval ee = 9(-1)1 {
|
275 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
276 |
+
}
|
277 |
+
|
278 |
+
su nwords
|
279 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
280 |
+
|
281 |
+
su bias_off1
|
282 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
283 |
+
|
284 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
285 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
286 |
+
|
287 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
288 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
289 |
+
|
290 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
291 |
+
|
292 |
+
noisily: di "TRADE: "
|
293 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
294 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Trade") label nonotes nocons noni
|
295 |
+
|
296 |
+
|
297 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
298 |
+
set obs 2655
|
299 |
+
replace A="totnonstopwords" in 2655
|
300 |
+
foreach v of varlist B-GI {
|
301 |
+
egen totwordsX=total(`v')
|
302 |
+
replace `v'=totwordsX in 2655
|
303 |
+
drop totwordsX
|
304 |
+
}
|
305 |
+
foreach v of varlist B-GI {
|
306 |
+
local x : variable label `v'
|
307 |
+
rename `v' v`x'
|
308 |
+
}
|
309 |
+
keep if A=="HILARI" | A=="CLINTON" | A=="EMAIL" | A=="LOCK" | A=="totnonstopwords"
|
310 |
+
keep A v*
|
311 |
+
|
312 |
+
reshape long v, i(A) j(id)
|
313 |
+
sort id
|
314 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
315 |
+
by id: egen C = max(B)
|
316 |
+
keep if A=="totnonstopwords"
|
317 |
+
keep id v C
|
318 |
+
rename C A
|
319 |
+
replace A=0 if A==.
|
320 |
+
rename v totnonstopwords
|
321 |
+
rename A word
|
322 |
+
merge 1:1 id using "Data\speech_data.dta"
|
323 |
+
drop if _merge==2
|
324 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
325 |
+
replace totwords=-999 if totnonstopwords==-999
|
326 |
+
g inspeechdata = (_merge==3)
|
327 |
+
drop state A _merge id
|
328 |
+
destring county_fips, replace
|
329 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
330 |
+
drop if county_fips==.
|
331 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
332 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
333 |
+
|
334 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
335 |
+
keep if _merge!=1
|
336 |
+
|
337 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
338 |
+
forval ee = 9(-1)1 {
|
339 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
340 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
341 |
+
}
|
342 |
+
|
343 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
344 |
+
g nwords = .
|
345 |
+
forval ee = 9(-1)1 {
|
346 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
347 |
+
}
|
348 |
+
|
349 |
+
su nwords
|
350 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
351 |
+
|
352 |
+
su bias_off1
|
353 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
354 |
+
|
355 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
356 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
357 |
+
|
358 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
359 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
360 |
+
|
361 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
362 |
+
|
363 |
+
noisily: di "CLINTON: "
|
364 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
365 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Clinton") label nonotes nocons noni
|
366 |
+
|
367 |
+
|
368 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
369 |
+
set obs 2655
|
370 |
+
replace A="totnonstopwords" in 2655
|
371 |
+
foreach v of varlist B-GI {
|
372 |
+
egen totwordsX=total(`v')
|
373 |
+
replace `v'=totwordsX in 2655
|
374 |
+
drop totwordsX
|
375 |
+
}
|
376 |
+
foreach v of varlist B-GI {
|
377 |
+
local x : variable label `v'
|
378 |
+
rename `v' v`x'
|
379 |
+
}
|
380 |
+
keep if A=="ISI" | A=="SYRIA" | A=="IRAQ" | A=="TERRORIST" | A=="AFGHANISTAN" | A=="ISLAM" | A=="totnonstopwords"
|
381 |
+
keep A v*
|
382 |
+
|
383 |
+
reshape long v, i(A) j(id)
|
384 |
+
sort id
|
385 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
386 |
+
by id: egen C = max(B)
|
387 |
+
keep if A=="totnonstopwords"
|
388 |
+
keep id v C
|
389 |
+
rename C A
|
390 |
+
replace A=0 if A==.
|
391 |
+
rename v totnonstopwords
|
392 |
+
rename A word
|
393 |
+
merge 1:1 id using "Data\speech_data.dta"
|
394 |
+
drop if _merge==2
|
395 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
396 |
+
replace totwords=-999 if totnonstopwords==-999
|
397 |
+
g inspeechdata = (_merge==3)
|
398 |
+
drop state A _merge id
|
399 |
+
destring county_fips, replace
|
400 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
401 |
+
drop if county_fips==.
|
402 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
403 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
404 |
+
|
405 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
406 |
+
keep if _merge!=1
|
407 |
+
|
408 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
409 |
+
forval ee = 9(-1)1 {
|
410 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
411 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
412 |
+
}
|
413 |
+
|
414 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
415 |
+
g nwords = .
|
416 |
+
forval ee = 9(-1)1 {
|
417 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
418 |
+
}
|
419 |
+
|
420 |
+
su nwords
|
421 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
422 |
+
|
423 |
+
su bias_off1
|
424 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
425 |
+
|
426 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
427 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
428 |
+
|
429 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
430 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
431 |
+
|
432 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
433 |
+
|
434 |
+
noisily: di "TERROR: "
|
435 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
436 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Terror") label nonotes nocons noni
|
437 |
+
|
438 |
+
|
439 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
440 |
+
set obs 2655
|
441 |
+
replace A="totnonstopwords" in 2655
|
442 |
+
foreach v of varlist B-GI {
|
443 |
+
egen totwordsX=total(`v')
|
444 |
+
replace `v'=totwordsX in 2655
|
445 |
+
drop totwordsX
|
446 |
+
}
|
447 |
+
foreach v of varlist B-GI {
|
448 |
+
local x : variable label `v'
|
449 |
+
rename `v' v`x'
|
450 |
+
}
|
451 |
+
keep if A=="BUSI" | A=="JOB" | A=="MANUFACTUR" | A=="TAX" | A=="totnonstopwords"
|
452 |
+
keep A v*
|
453 |
+
|
454 |
+
reshape long v, i(A) j(id)
|
455 |
+
sort id
|
456 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
457 |
+
by id: egen C = max(B)
|
458 |
+
keep if A=="totnonstopwords"
|
459 |
+
keep id v C
|
460 |
+
rename C A
|
461 |
+
replace A=0 if A==.
|
462 |
+
rename v totnonstopwords
|
463 |
+
rename A word
|
464 |
+
merge 1:1 id using "Data\speech_data.dta"
|
465 |
+
drop if _merge==2
|
466 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
467 |
+
replace totwords=-999 if totnonstopwords==-999
|
468 |
+
g inspeechdata = (_merge==3)
|
469 |
+
drop state A _merge id
|
470 |
+
destring county_fips, replace
|
471 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
472 |
+
drop if county_fips==.
|
473 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
474 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
475 |
+
|
476 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
477 |
+
keep if _merge!=1
|
478 |
+
|
479 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
480 |
+
forval ee = 9(-1)1 {
|
481 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
482 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
483 |
+
}
|
484 |
+
|
485 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
486 |
+
g nwords = .
|
487 |
+
forval ee = 9(-1)1 {
|
488 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
489 |
+
}
|
490 |
+
|
491 |
+
su nwords
|
492 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
493 |
+
|
494 |
+
su bias_off1
|
495 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
496 |
+
|
497 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
498 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
499 |
+
|
500 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
501 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
502 |
+
|
503 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
504 |
+
|
505 |
+
noisily: di "JOB: "
|
506 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
507 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Job") label nonotes nocons noni
|
508 |
+
|
509 |
+
|
510 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
511 |
+
set obs 2655
|
512 |
+
replace A="totnonstopwords" in 2655
|
513 |
+
foreach v of varlist B-GI {
|
514 |
+
egen totwordsX=total(`v')
|
515 |
+
replace `v'=totwordsX in 2655
|
516 |
+
drop totwordsX
|
517 |
+
}
|
518 |
+
foreach v of varlist B-GI {
|
519 |
+
local x : variable label `v'
|
520 |
+
rename `v' v`x'
|
521 |
+
}
|
522 |
+
keep if A=="RIG" | A=="MEDIA" | A=="CNN" | A=="WASHINGTON" | A=="CORRUPT" | A=="SWAMP" | A=="totnonstopwords"
|
523 |
+
keep A v*
|
524 |
+
|
525 |
+
reshape long v, i(A) j(id)
|
526 |
+
sort id
|
527 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
528 |
+
by id: egen C = max(B)
|
529 |
+
keep if A=="totnonstopwords"
|
530 |
+
keep id v C
|
531 |
+
rename C A
|
532 |
+
replace A=0 if A==.
|
533 |
+
rename v totnonstopwords
|
534 |
+
rename A word
|
535 |
+
merge 1:1 id using "Data\speech_data.dta"
|
536 |
+
drop if _merge==2
|
537 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
538 |
+
replace totwords=-999 if totnonstopwords==-999
|
539 |
+
g inspeechdata = (_merge==3)
|
540 |
+
drop state A _merge id
|
541 |
+
destring county_fips, replace
|
542 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
543 |
+
drop if county_fips==.
|
544 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
545 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
546 |
+
|
547 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
548 |
+
keep if _merge!=1
|
549 |
+
|
550 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
551 |
+
forval ee = 9(-1)1 {
|
552 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
553 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
554 |
+
}
|
555 |
+
|
556 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
557 |
+
g nwords = .
|
558 |
+
forval ee = 9(-1)1 {
|
559 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
560 |
+
}
|
561 |
+
|
562 |
+
su nwords
|
563 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
564 |
+
|
565 |
+
su bias_off1
|
566 |
+
replace bias_off1 = (bias_off1 - r(mean)) / r(sd)
|
567 |
+
|
568 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
569 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
570 |
+
|
571 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off1*nwords
|
572 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
573 |
+
|
574 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off1
|
575 |
+
|
576 |
+
noisily: di "CORRUPTION: "
|
577 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
578 |
+
outreg2 using "Results/Table7A.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off1 TPXbias TPXbiasXnwords) addtext("Words","Corruption") label nonotes nocons noni
|
579 |
+
|
580 |
+
|
581 |
+
|
582 |
+
|
583 |
+
|
584 |
+
|
585 |
+
|
586 |
+
***********************************************************************************************************************************************************************************************************
|
587 |
+
|
588 |
+
|
589 |
+
|
590 |
+
**********************************************************************
|
591 |
+
*** TABLE 7
|
592 |
+
*** Role of Local Characteristics in the Effect of Trump Rallies on the Probability of a Black Stop
|
593 |
+
**********************************************************************
|
594 |
+
|
595 |
+
qui:{
|
596 |
+
|
597 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
598 |
+
set obs 2655
|
599 |
+
replace A="totnonstopwords" in 2655
|
600 |
+
foreach v of varlist B-GI {
|
601 |
+
egen totwordsX=total(`v')
|
602 |
+
replace `v'=totwordsX in 2655
|
603 |
+
drop totwordsX
|
604 |
+
}
|
605 |
+
foreach v of varlist B-GI {
|
606 |
+
local x : variable label `v'
|
607 |
+
rename `v' v`x'
|
608 |
+
}
|
609 |
+
keep if A=="DRUG" | A=="CRIME" | A=="RAPE" | A=="CRIMIN" | A=="GUN" | A=="PRISON" | A=="RIOT" | A=="THUG" | A=="URBAN" | A=="AFRICAN" | A=="BLACK" | A=="RACE" | A=="RACIAL" | A=="RACIST" | A=="totnonstopwords"
|
610 |
+
keep A v*
|
611 |
+
|
612 |
+
reshape long v, i(A) j(id)
|
613 |
+
sort id
|
614 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
615 |
+
by id: egen C = max(B)
|
616 |
+
keep if A=="totnonstopwords"
|
617 |
+
keep id v C
|
618 |
+
rename C A
|
619 |
+
replace A=0 if A==.
|
620 |
+
rename v totnonstopwords
|
621 |
+
rename A word
|
622 |
+
merge 1:1 id using "Data\speech_data.dta"
|
623 |
+
drop if _merge==2
|
624 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
625 |
+
replace totwords=-999 if totnonstopwords==-999
|
626 |
+
g inspeechdata = (_merge==3)
|
627 |
+
drop state A _merge id
|
628 |
+
destring county_fips, replace
|
629 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
630 |
+
drop if county_fips==.
|
631 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
632 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
633 |
+
|
634 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
635 |
+
keep if _merge!=1
|
636 |
+
|
637 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
638 |
+
forval ee = 9(-1)1 {
|
639 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
640 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
641 |
+
}
|
642 |
+
|
643 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
644 |
+
g nwords = .
|
645 |
+
forval ee = 9(-1)1 {
|
646 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
647 |
+
}
|
648 |
+
|
649 |
+
su nwords
|
650 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
651 |
+
|
652 |
+
su bias_off2
|
653 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
654 |
+
|
655 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
656 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
657 |
+
|
658 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
659 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
660 |
+
|
661 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
662 |
+
|
663 |
+
noisily: di "ALL REFERENCES: "
|
664 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
665 |
+
outreg2 using "Results/Table7B.txt", replace dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Explicit+Implicit") label nonotes nocons noni
|
666 |
+
|
667 |
+
****explicit
|
668 |
+
|
669 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
670 |
+
set obs 2655
|
671 |
+
replace A="totnonstopwords" in 2655
|
672 |
+
foreach v of varlist B-GI {
|
673 |
+
egen totwordsX=total(`v')
|
674 |
+
replace `v'=totwordsX in 2655
|
675 |
+
drop totwordsX
|
676 |
+
}
|
677 |
+
foreach v of varlist B-GI {
|
678 |
+
local x : variable label `v'
|
679 |
+
rename `v' v`x'
|
680 |
+
}
|
681 |
+
keep if A=="AFRICAN" | A=="BLACK" | A=="RACE" | A=="RACIAL" | A=="RACIST" | A=="totnonstopwords"
|
682 |
+
keep A v*
|
683 |
+
|
684 |
+
|
685 |
+
reshape long v, i(A) j(id)
|
686 |
+
sort id
|
687 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
688 |
+
by id: egen C = max(B)
|
689 |
+
keep if A=="totnonstopwords"
|
690 |
+
keep id v C
|
691 |
+
rename C A
|
692 |
+
replace A=0 if A==.
|
693 |
+
rename v totnonstopwords
|
694 |
+
rename A word
|
695 |
+
merge 1:1 id using "Data\speech_data.dta"
|
696 |
+
drop if _merge==2
|
697 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
698 |
+
replace totwords=-999 if totnonstopwords==-999
|
699 |
+
g inspeechdata = (_merge==3)
|
700 |
+
drop state A _merge id
|
701 |
+
destring county_fips, replace
|
702 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
703 |
+
drop if county_fips==.
|
704 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
705 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
706 |
+
|
707 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
708 |
+
keep if _merge!=1
|
709 |
+
|
710 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
711 |
+
forval ee = 9(-1)1 {
|
712 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
713 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
714 |
+
}
|
715 |
+
|
716 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
717 |
+
g nwords = .
|
718 |
+
forval ee = 9(-1)1 {
|
719 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
720 |
+
}
|
721 |
+
|
722 |
+
su nwords
|
723 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
724 |
+
|
725 |
+
su bias_off2
|
726 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
727 |
+
|
728 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
729 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
730 |
+
|
731 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
732 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
733 |
+
|
734 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
735 |
+
|
736 |
+
|
737 |
+
noisily: di "EXPLICIT REFERENCES"
|
738 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
739 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Explicit") label nonotes nocons noni
|
740 |
+
|
741 |
+
|
742 |
+
|
743 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
744 |
+
set obs 2655
|
745 |
+
replace A="totnonstopwords" in 2655
|
746 |
+
foreach v of varlist B-GI {
|
747 |
+
egen totwordsX=total(`v')
|
748 |
+
replace `v'=totwordsX in 2655
|
749 |
+
drop totwordsX
|
750 |
+
}
|
751 |
+
foreach v of varlist B-GI {
|
752 |
+
local x : variable label `v'
|
753 |
+
rename `v' v`x'
|
754 |
+
}
|
755 |
+
keep if A=="DRUG" | A=="CRIME" | A=="RAPE" | A=="CRIMIN" | A=="GUN" | A=="PRISON" | A=="RIOT" | A=="THUG" | A=="URBAN" | A=="totnonstopwords"
|
756 |
+
keep A v*
|
757 |
+
|
758 |
+
reshape long v, i(A) j(id)
|
759 |
+
sort id
|
760 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
761 |
+
by id: egen C = max(B)
|
762 |
+
keep if A=="totnonstopwords"
|
763 |
+
keep id v C
|
764 |
+
rename C A
|
765 |
+
replace A=0 if A==.
|
766 |
+
rename v totnonstopwords
|
767 |
+
rename A word
|
768 |
+
merge 1:1 id using "Data\speech_data.dta"
|
769 |
+
drop if _merge==2
|
770 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
771 |
+
replace totwords=-999 if totnonstopwords==-999
|
772 |
+
g inspeechdata = (_merge==3)
|
773 |
+
drop state A _merge id
|
774 |
+
destring county_fips, replace
|
775 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
776 |
+
drop if county_fips==.
|
777 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
778 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
779 |
+
|
780 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
781 |
+
keep if _merge!=1
|
782 |
+
|
783 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
784 |
+
forval ee = 9(-1)1 {
|
785 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
786 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
787 |
+
}
|
788 |
+
|
789 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
790 |
+
g nwords = .
|
791 |
+
forval ee = 9(-1)1 {
|
792 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
793 |
+
}
|
794 |
+
|
795 |
+
su nwords
|
796 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
797 |
+
|
798 |
+
su bias_off2
|
799 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
800 |
+
|
801 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
802 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
803 |
+
|
804 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
805 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
806 |
+
|
807 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
808 |
+
|
809 |
+
noisily: di "IMPLICIT: "
|
810 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
811 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Implicit") label nonotes nocons noni
|
812 |
+
|
813 |
+
|
814 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
815 |
+
set obs 2655
|
816 |
+
replace A="totnonstopwords" in 2655
|
817 |
+
foreach v of varlist B-GI {
|
818 |
+
egen totwordsX=total(`v')
|
819 |
+
replace `v'=totwordsX in 2655
|
820 |
+
drop totwordsX
|
821 |
+
}
|
822 |
+
foreach v of varlist B-GI {
|
823 |
+
local x : variable label `v'
|
824 |
+
rename `v' v`x'
|
825 |
+
}
|
826 |
+
keep if A=="CHINA" | A=="TRADE" | A=="NAFTA" | A=="totnonstopwords"
|
827 |
+
keep A v*
|
828 |
+
|
829 |
+
reshape long v, i(A) j(id)
|
830 |
+
sort id
|
831 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
832 |
+
by id: egen C = max(B)
|
833 |
+
keep if A=="totnonstopwords"
|
834 |
+
keep id v C
|
835 |
+
rename C A
|
836 |
+
replace A=0 if A==.
|
837 |
+
rename v totnonstopwords
|
838 |
+
rename A word
|
839 |
+
merge 1:1 id using "Data\speech_data.dta"
|
840 |
+
drop if _merge==2
|
841 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
842 |
+
replace totwords=-999 if totnonstopwords==-999
|
843 |
+
g inspeechdata = (_merge==3)
|
844 |
+
drop state A _merge id
|
845 |
+
destring county_fips, replace
|
846 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
847 |
+
drop if county_fips==.
|
848 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
849 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
850 |
+
|
851 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
852 |
+
keep if _merge!=1
|
853 |
+
|
854 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
855 |
+
forval ee = 9(-1)1 {
|
856 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
857 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
858 |
+
}
|
859 |
+
|
860 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
861 |
+
g nwords = .
|
862 |
+
forval ee = 9(-1)1 {
|
863 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
864 |
+
}
|
865 |
+
|
866 |
+
su nwords
|
867 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
868 |
+
|
869 |
+
su bias_off2
|
870 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
871 |
+
|
872 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
873 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
874 |
+
|
875 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
876 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
877 |
+
|
878 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
879 |
+
|
880 |
+
noisily: di "TRADE: "
|
881 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
882 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Trade") label nonotes nocons noni
|
883 |
+
|
884 |
+
|
885 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
886 |
+
set obs 2655
|
887 |
+
replace A="totnonstopwords" in 2655
|
888 |
+
foreach v of varlist B-GI {
|
889 |
+
egen totwordsX=total(`v')
|
890 |
+
replace `v'=totwordsX in 2655
|
891 |
+
drop totwordsX
|
892 |
+
}
|
893 |
+
foreach v of varlist B-GI {
|
894 |
+
local x : variable label `v'
|
895 |
+
rename `v' v`x'
|
896 |
+
}
|
897 |
+
keep if A=="HILARI" | A=="CLINTON" | A=="EMAIL" | A=="LOCK" | A=="totnonstopwords"
|
898 |
+
keep A v*
|
899 |
+
|
900 |
+
reshape long v, i(A) j(id)
|
901 |
+
sort id
|
902 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
903 |
+
by id: egen C = max(B)
|
904 |
+
keep if A=="totnonstopwords"
|
905 |
+
keep id v C
|
906 |
+
rename C A
|
907 |
+
replace A=0 if A==.
|
908 |
+
rename v totnonstopwords
|
909 |
+
rename A word
|
910 |
+
merge 1:1 id using "Data\speech_data.dta"
|
911 |
+
drop if _merge==2
|
912 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
913 |
+
replace totwords=-999 if totnonstopwords==-999
|
914 |
+
g inspeechdata = (_merge==3)
|
915 |
+
drop state A _merge id
|
916 |
+
destring county_fips, replace
|
917 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
918 |
+
drop if county_fips==.
|
919 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
920 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
921 |
+
|
922 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
923 |
+
keep if _merge!=1
|
924 |
+
|
925 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
926 |
+
forval ee = 9(-1)1 {
|
927 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
928 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
929 |
+
}
|
930 |
+
|
931 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
932 |
+
g nwords = .
|
933 |
+
forval ee = 9(-1)1 {
|
934 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
935 |
+
}
|
936 |
+
|
937 |
+
su nwords
|
938 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
939 |
+
|
940 |
+
su bias_off2
|
941 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
942 |
+
|
943 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
944 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
945 |
+
|
946 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
947 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
948 |
+
|
949 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
950 |
+
|
951 |
+
noisily: di "CLINTON: "
|
952 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
953 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Clinton") label nonotes nocons noni
|
954 |
+
|
955 |
+
|
956 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
957 |
+
set obs 2655
|
958 |
+
replace A="totnonstopwords" in 2655
|
959 |
+
foreach v of varlist B-GI {
|
960 |
+
egen totwordsX=total(`v')
|
961 |
+
replace `v'=totwordsX in 2655
|
962 |
+
drop totwordsX
|
963 |
+
}
|
964 |
+
foreach v of varlist B-GI {
|
965 |
+
local x : variable label `v'
|
966 |
+
rename `v' v`x'
|
967 |
+
}
|
968 |
+
keep if A=="ISI" | A=="SYRIA" | A=="IRAQ" | A=="TERRORIST" | A=="AFGHANISTAN" | A=="ISLAM" | A=="totnonstopwords"
|
969 |
+
keep A v*
|
970 |
+
|
971 |
+
reshape long v, i(A) j(id)
|
972 |
+
sort id
|
973 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
974 |
+
by id: egen C = max(B)
|
975 |
+
keep if A=="totnonstopwords"
|
976 |
+
keep id v C
|
977 |
+
rename C A
|
978 |
+
replace A=0 if A==.
|
979 |
+
rename v totnonstopwords
|
980 |
+
rename A word
|
981 |
+
merge 1:1 id using "Data\speech_data.dta"
|
982 |
+
drop if _merge==2
|
983 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
984 |
+
replace totwords=-999 if totnonstopwords==-999
|
985 |
+
g inspeechdata = (_merge==3)
|
986 |
+
drop state A _merge id
|
987 |
+
destring county_fips, replace
|
988 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
989 |
+
drop if county_fips==.
|
990 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
991 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
992 |
+
|
993 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
994 |
+
keep if _merge!=1
|
995 |
+
|
996 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
997 |
+
forval ee = 9(-1)1 {
|
998 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
999 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
1003 |
+
g nwords = .
|
1004 |
+
forval ee = 9(-1)1 {
|
1005 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
1006 |
+
}
|
1007 |
+
|
1008 |
+
su nwords
|
1009 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
1010 |
+
|
1011 |
+
su bias_off2
|
1012 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
1013 |
+
|
1014 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
1015 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
1016 |
+
|
1017 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
1018 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
1019 |
+
|
1020 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
1021 |
+
|
1022 |
+
noisily: di "TERROR: "
|
1023 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
1024 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Terror") label nonotes nocons noni
|
1025 |
+
|
1026 |
+
|
1027 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
1028 |
+
set obs 2655
|
1029 |
+
replace A="totnonstopwords" in 2655
|
1030 |
+
foreach v of varlist B-GI {
|
1031 |
+
egen totwordsX=total(`v')
|
1032 |
+
replace `v'=totwordsX in 2655
|
1033 |
+
drop totwordsX
|
1034 |
+
}
|
1035 |
+
foreach v of varlist B-GI {
|
1036 |
+
local x : variable label `v'
|
1037 |
+
rename `v' v`x'
|
1038 |
+
}
|
1039 |
+
keep if A=="BUSI" | A=="JOB" | A=="MANUFACTUR" | A=="TAX" | A=="totnonstopwords"
|
1040 |
+
keep A v*
|
1041 |
+
|
1042 |
+
reshape long v, i(A) j(id)
|
1043 |
+
sort id
|
1044 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
1045 |
+
by id: egen C = max(B)
|
1046 |
+
keep if A=="totnonstopwords"
|
1047 |
+
keep id v C
|
1048 |
+
rename C A
|
1049 |
+
replace A=0 if A==.
|
1050 |
+
rename v totnonstopwords
|
1051 |
+
rename A word
|
1052 |
+
merge 1:1 id using "Data\speech_data.dta"
|
1053 |
+
drop if _merge==2
|
1054 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
1055 |
+
replace totwords=-999 if totnonstopwords==-999
|
1056 |
+
g inspeechdata = (_merge==3)
|
1057 |
+
drop state A _merge id
|
1058 |
+
destring county_fips, replace
|
1059 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
1060 |
+
drop if county_fips==.
|
1061 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
1062 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
1063 |
+
|
1064 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
1065 |
+
keep if _merge!=1
|
1066 |
+
|
1067 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
1068 |
+
forval ee = 9(-1)1 {
|
1069 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
1070 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
1074 |
+
g nwords = .
|
1075 |
+
forval ee = 9(-1)1 {
|
1076 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
1077 |
+
}
|
1078 |
+
|
1079 |
+
su nwords
|
1080 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
1081 |
+
|
1082 |
+
su bias_off2
|
1083 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
1084 |
+
|
1085 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
1086 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
1087 |
+
|
1088 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
1089 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
1090 |
+
|
1091 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
1092 |
+
|
1093 |
+
noisily: di "JOB: "
|
1094 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
1095 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Job") label nonotes nocons noni
|
1096 |
+
|
1097 |
+
|
1098 |
+
import excel "Data\wordcount-eachspeech-all.xlsx", sheet("Sheet1") firstrow clear
|
1099 |
+
set obs 2655
|
1100 |
+
replace A="totnonstopwords" in 2655
|
1101 |
+
foreach v of varlist B-GI {
|
1102 |
+
egen totwordsX=total(`v')
|
1103 |
+
replace `v'=totwordsX in 2655
|
1104 |
+
drop totwordsX
|
1105 |
+
}
|
1106 |
+
foreach v of varlist B-GI {
|
1107 |
+
local x : variable label `v'
|
1108 |
+
rename `v' v`x'
|
1109 |
+
}
|
1110 |
+
keep if A=="RIG" | A=="MEDIA" | A=="CNN" | A=="WASHINGTON" | A=="CORRUPT" | A=="SWAMP" | A=="totnonstopwords"
|
1111 |
+
keep A v*
|
1112 |
+
|
1113 |
+
reshape long v, i(A) j(id)
|
1114 |
+
sort id
|
1115 |
+
by id: egen B = total(v) if A!="totnonstopwords"
|
1116 |
+
by id: egen C = max(B)
|
1117 |
+
keep if A=="totnonstopwords"
|
1118 |
+
keep id v C
|
1119 |
+
rename C A
|
1120 |
+
replace A=0 if A==.
|
1121 |
+
rename v totnonstopwords
|
1122 |
+
rename A word
|
1123 |
+
merge 1:1 id using "Data\speech_data.dta"
|
1124 |
+
drop if _merge==2
|
1125 |
+
replace totnonstopwords=-999 if totnonstopwords==0 | totnonstopwords==.
|
1126 |
+
replace totwords=-999 if totnonstopwords==-999
|
1127 |
+
g inspeechdata = (_merge==3)
|
1128 |
+
drop state A _merge id
|
1129 |
+
destring county_fips, replace
|
1130 |
+
reshape wide word event_day_Trump_ totnonstopwords totwords inspeechdata, i(county_fips) j(rally_number)
|
1131 |
+
drop if county_fips==.
|
1132 |
+
egen inspeechdata=rowmax(inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9)
|
1133 |
+
drop inspeechdata1 inspeechdata2 inspeechdata3 inspeechdata4 inspeechdata5 inspeechdata6 inspeechdata7 inspeechdata8 inspeechdata9 totwords*
|
1134 |
+
|
1135 |
+
merge 1:m county_fips using "Data/full_data_tomergewithspeech.dta"
|
1136 |
+
keep if _merge!=1
|
1137 |
+
|
1138 |
+
*** event_day_Trump is missing if they are not in speech data, while dist_event & abs_dist_event are non-missing (because they are defined based on all rallies).
|
1139 |
+
forval ee = 9(-1)1 {
|
1140 |
+
g abs_dist_event`ee' = abs(dist_event`ee')
|
1141 |
+
replace totnonstopwords`ee'=-999 if totnonstopwords`ee'==. & abs_dist_event`ee'!=.
|
1142 |
+
}
|
1143 |
+
|
1144 |
+
egen closestevent=rowmin(abs_dist_event1 abs_dist_event2 abs_dist_event3 abs_dist_event4 abs_dist_event5 abs_dist_event6 abs_dist_event7 abs_dist_event8 abs_dist_event9)
|
1145 |
+
g nwords = .
|
1146 |
+
forval ee = 9(-1)1 {
|
1147 |
+
replace nwords = word`ee' if abs_dist_event`ee'==closestevent & totnonstopwords`ee'!=-999
|
1148 |
+
}
|
1149 |
+
|
1150 |
+
su nwords
|
1151 |
+
replace nwords = (nwords - r(mean)) / r(sd)
|
1152 |
+
|
1153 |
+
su bias_off2
|
1154 |
+
replace bias_off2 = (bias_off2 - r(mean)) / r(sd)
|
1155 |
+
|
1156 |
+
g TPXnwords = TRUMP_POST_1_30*nwords
|
1157 |
+
replace TPXnwords = 0 if NEVER_TREATED==1
|
1158 |
+
|
1159 |
+
g TPXbiasXnwords=TRUMP_POST_1_30*bias_off2*nwords
|
1160 |
+
replace TPXbiasXnwords = 0 if NEVER_TREATED==1
|
1161 |
+
|
1162 |
+
g TPXbias = TRUMP_POST_1_30 * bias_off2
|
1163 |
+
|
1164 |
+
noisily: di "CORRUPTION: "
|
1165 |
+
noisily: reghdfe black 1.TRUMP_PRE_M30 1.TRUMP_0 1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords 1.TRUMP_POST_M30, a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id)
|
1166 |
+
outreg2 using "Results/Table7B.txt", append dec(3) keep(1.TRUMP_POST_1_30 TPXnwords bias_off2 TPXbias TPXbiasXnwords) addtext("Words","Corruption") label nonotes nocons noni
|
1167 |
+
|
1168 |
+
}
|
1169 |
+
|
1170 |
+
}
|
39/replication_package/Do/TableA1.do
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A1
|
4 |
+
*** Summary Statistics
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
summ TRUMP_POST_1_30 black hispanic api white
|
39/replication_package/Do/TableA10.do
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A10
|
4 |
+
*** Role of Estimated Officer Bias in the Effect of Trump Rallies on
|
5 |
+
*** the Probability of a Black Stop: Robustness to Agency-Day Fixed
|
6 |
+
*** Effects
|
7 |
+
**********************************************************************
|
8 |
+
|
9 |
+
use "Data\officerbias.dta", clear
|
10 |
+
|
11 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 bias_int1 if officer_id_hash!="" , a(i.county_id i.day_id i.county_id#c.day_id i.county_id#i.state_pd#c.day_id) cluster(i.county_id i.day_id)
|
12 |
+
outreg2 using "Results/TableA10.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off1 bias_int1) label nonotes nocons noni addtext("Officer FE", "NO", "Bias Measure", "Method 1")
|
13 |
+
|
14 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 bias_int1 if officer_id_hash!="" , a(i.officer_id i.county_id i.day_id i.county_id#c.day_id i.county_id#i.state_pd#c.day_id) cluster(i.county_id i.day_id)
|
15 |
+
outreg2 using "Results/TableA10.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off1 bias_int1) label nonotes nocons noni addtext("Officer FE", "YES", "Bias Measure", "Method 1")
|
16 |
+
|
17 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 bias_int2 if officer_id_hash!="" , a(i.county_id i.day_id i.county_id#c.day_id i.county_id#i.state_pd#c.day_id) cluster(i.county_id i.day_id)
|
18 |
+
outreg2 using "Results/TableA10.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off2 bias_int2) label nonotes nocons noni addtext("Officer FE", "NO", "Bias Measure", "Method 2")
|
19 |
+
|
20 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 bias_int2 if officer_id_hash!="" , a(i.officer_id i.county_id i.day_id i.county_id#c.day_id i.county_id#i.state_pd#c.day_id) cluster(i.county_id i.day_id)
|
21 |
+
outreg2 using "Results/TableA10.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30 bias_off2 bias_int2) label nonotes nocons noni addtext("Officer FE", "YES", "Bias Measure", "Method 1")
|
39/replication_package/Do/TableA11.do
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A11
|
4 |
+
*** Role of Estimated Officer Bias in the Effect of Trump Rallies on
|
5 |
+
*** the Probability of a Black Stop: Additional Robustness
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\officerbias.dta", clear
|
9 |
+
|
10 |
+
drop if officer_id==.
|
11 |
+
|
12 |
+
forvalues j=1(1)2{
|
13 |
+
centile bias_off`j' if bias_off`j'!=., c(33)
|
14 |
+
local bias_p33 = `r(c_1)'
|
15 |
+
|
16 |
+
centile bias_off`j' if bias_off`j'!=., c(67)
|
17 |
+
local bias_p67 = `r(c_1)'
|
18 |
+
|
19 |
+
g bias_off`j'_33 = (bias_off`j'<`bias_p33')
|
20 |
+
g bias_off`j'_33_67 = (bias_off`j'>=`bias_p33' & bias_off`j'<`bias_p67')
|
21 |
+
g bias_off`j'_u67 = (bias_off`j'<`bias_p67')
|
22 |
+
g bias_off`j'_67 = (bias_off`j'>=`bias_p67')
|
23 |
+
|
24 |
+
g TP_1_30Xbias_off`j'_33 = TRUMP_POST_1_30*bias_off`j'_33
|
25 |
+
g TP_1_30Xbias_off`j'_33_67 = TRUMP_POST_1_30*bias_off`j'_33_67
|
26 |
+
g TP_1_30Xbias_off`j'_u67 = TRUMP_POST_1_30*bias_off`j'_u67
|
27 |
+
g TP_1_30Xbias_off`j'_67 = TRUMP_POST_1_30*bias_off`j'_67
|
28 |
+
}
|
29 |
+
|
30 |
+
reghdfe black TRUMP_0 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 TP_1_30Xbias_off1_33 TP_1_30Xbias_off1_33_67 TP_1_30Xbias_off1_67, a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
31 |
+
outreg2 using "Results/TableA11.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TP_1_30Xbias_off1_33 TP_1_30Xbias_off1_33_67 TP_1_30Xbias_off1_67) label nonotes nocons noni
|
32 |
+
|
33 |
+
reghdfe black TRUMP_0 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off1 TP_1_30Xbias_off1_u67 TP_1_30Xbias_off1_67 , a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
34 |
+
outreg2 using "Results/TableA11.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TP_1_30Xbias_off1_u67 TP_1_30Xbias_off1_67) label nonotes nocons noni
|
35 |
+
|
36 |
+
reghdfe black TRUMP_0 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 TP_1_30Xbias_off2_33 TP_1_30Xbias_off2_33_67 TP_1_30Xbias_off2_67, a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
37 |
+
outreg2 using "Results/TableA11.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TP_1_30Xbias_off2_33 TP_1_30Xbias_off2_33_67 TP_1_30Xbias_off2_67) label nonotes nocons noni
|
38 |
+
|
39 |
+
reghdfe black TRUMP_0 TRUMP_POST_M30 TRUMP_PRE_M30 bias_off2 TP_1_30Xbias_off2_u67 TP_1_30Xbias_off2_67 , a(i.county_id i.day_id i.county_id#c.day_id) cluster(i.county_id i.day_id)
|
40 |
+
outreg2 using "Results/TableA11.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TP_1_30Xbias_off2_u67 TP_1_30Xbias_off2_67) label nonotes nocons noni
|
41 |
+
|
39/replication_package/Do/TableA12.do
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A12
|
4 |
+
*** Role of Local Characteristics in the Eff ect of Trump Rallies on
|
5 |
+
*** the Probability of a Black Stop Controlling for a Linear Time
|
6 |
+
*** Trend Interacted with the Share of Black People in the County
|
7 |
+
**********************************************************************
|
8 |
+
|
9 |
+
use "Data\stoplevel_data.dta", clear
|
10 |
+
|
11 |
+
mat treat = J(11,4,1)
|
12 |
+
|
13 |
+
keep black county_fips day_id TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 racial_resent_a racial_resent_b any_slaves_1860 alt_cottonsui ihsbl_lynch ihsbl_exec dem_p rep medianincome coll d_tradeusch_pw d_tradeotch_pw_lag countyblack
|
14 |
+
drop if black==.
|
15 |
+
|
16 |
+
summ racial_resent_a
|
17 |
+
g racial_resent_asd = ( racial_resent_a - r(mean))/r(sd)
|
18 |
+
g interaction = TRUMP_POST_1_30 * racial_resent_asd
|
19 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.racial_resent_a c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
20 |
+
outreg2 using "Results/TableA12.txt", replace dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Racial Resentment A","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
21 |
+
drop interaction
|
22 |
+
|
23 |
+
summ racial_resent_b
|
24 |
+
g racial_resent_bsd = ( racial_resent_b - r(mean))/r(sd)
|
25 |
+
g interaction = TRUMP_POST_1_30 * racial_resent_bsd
|
26 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.racial_resent_b c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
27 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Racial Resentment B","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
28 |
+
drop interaction
|
29 |
+
|
30 |
+
g interaction = TRUMP_POST_1_30 * any_slaves_1860
|
31 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#1.any_slaves_1860 c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
32 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Any Slaves","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
33 |
+
drop interaction
|
34 |
+
|
35 |
+
su alt_cottonsui , detail
|
36 |
+
g alt_cottonsuisd = ( alt_cottonsui - r(mean))/r(sd)
|
37 |
+
g interaction = TRUMP_POST_1_30 * alt_cottonsuisd
|
38 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.alt_cottonsui c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
39 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Cotton","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
40 |
+
drop interaction
|
41 |
+
|
42 |
+
su ihsbl_lynch , detail
|
43 |
+
g ihsbl_lynchsd = ( ihsbl_lynch - r(mean))/r(sd)
|
44 |
+
g interaction = TRUMP_POST_1_30 * ihsbl_lynchsd
|
45 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.ihsbl_lynch c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
46 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","IHS Slaves","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
47 |
+
drop interaction
|
48 |
+
|
49 |
+
su ihsbl_exec , detail
|
50 |
+
g ihsbl_execsd = ( ihsbl_exec - r(mean))/r(sd)
|
51 |
+
g interaction = TRUMP_POST_1_30 * ihsbl_execsd
|
52 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.ihsbl_exec c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
53 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","IHS Executations","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
54 |
+
drop interaction
|
55 |
+
|
56 |
+
**** PANEL B
|
57 |
+
su dem_p , detail
|
58 |
+
g dem_psd = ( dem_p - r(mean))/r(sd)
|
59 |
+
local sd = r(sd)
|
60 |
+
g interaction = TRUMP_POST_1_30 * dem_psd
|
61 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.dem_p c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
62 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","DEM Share","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
63 |
+
drop interaction
|
64 |
+
|
65 |
+
g interaction = TRUMP_POST_1_30 * rep
|
66 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.rep c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
67 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","County Sheriff","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
68 |
+
drop interaction
|
69 |
+
|
70 |
+
su medianincome , detail
|
71 |
+
g incomesd = ( medianincome - r(mean))/r(sd)
|
72 |
+
g interaction = TRUMP_POST_1_30 * incomesd
|
73 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.medianincome c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
74 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","Income","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
75 |
+
drop interaction
|
76 |
+
|
77 |
+
su coll , detail
|
78 |
+
g collsd = ( coll - r(mean))/r(sd)
|
79 |
+
g interaction = TRUMP_POST_1_30 * collsd
|
80 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.coll c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
81 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","College","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
82 |
+
drop interaction
|
83 |
+
|
84 |
+
su d_tradeusch_pw , detail
|
85 |
+
g d_tradeusch_pwsd = ( d_tradeusch_pw - r(mean))/r(sd)
|
86 |
+
g interaction = TRUMP_POST_1_30 * d_tradeusch_pwsd
|
87 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.d_tradeusch_pw c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
88 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","China Shock","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
89 |
+
drop interaction
|
90 |
+
|
91 |
+
su d_tradeotch_pw_lag , detail
|
92 |
+
g dtrdothchsd = ( d_tradeotch_pw_lag - r(mean))/r(sd)
|
93 |
+
g interaction = TRUMP_POST_1_30 * dtrdothchsd
|
94 |
+
reghdfe black 1.TRUMP_* interaction c.day_id#c.dtrdothch c.day_id#c.countyblack, a(i.county_fips i.day_id) cluster(county_fips)
|
95 |
+
outreg2 using "Results/TableA12.txt", append dec(3) keep(1.TRUMP_POST_1_30 interaction) addtext("Interaction","China Shock IV","County FE", "YES", "Daily FE", "YES") label nonotes nocons noni
|
96 |
+
drop interaction
|
39/replication_package/Do/TableA13.do
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A13
|
4 |
+
*** Correlations Between Trumps' Rally Speech and County Covariates
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\speech_countydata.dta", clear
|
8 |
+
|
9 |
+
foreach y in Explicit Implicit trade clinton terror business corruption {
|
10 |
+
gen ihs`y'= log(`y'+(`y'^2+1)^0.5)
|
11 |
+
reg ihs`y' racial_resent_asd racial_resent_bsd any_slaves_1860 cottonmeansd bexecrtsd blynchtsd popsd dem_psd rep medianincomesd collsd d_tradeusch_pwsd $miss, rob
|
12 |
+
xi: outreg2 racial_resent_asd racial_resent_bsd any_slaves_1860 cottonmeansd bexecrtsd blynchtsd dem_psd rep medianincomesd collsd d_tradeusch_pwsd using "Results/TableA13.xls", se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) nocons bfmt(fc) append
|
13 |
+
|
14 |
+
}
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
|
39/replication_package/Do/TableA2.do
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A2
|
4 |
+
*** Differences in the Probability of a Black Stop Before Treatment
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
forvalues j=5(5)30 {
|
10 |
+
g TRUMP_PRE`j' = 0
|
11 |
+
forval ii = 1/9 {
|
12 |
+
replace TRUMP_PRE`j' = 1 if (dist_event`ii' < 0 & dist_event`ii'>=-`j' & dist_event`ii'!=.)
|
13 |
+
}
|
14 |
+
|
15 |
+
bysort day_id: egen insample`j' = max(TRUMP_PRE`j')
|
16 |
+
label variable TRUMP_PRE`j' "Pre-Trump `j'"
|
17 |
+
|
18 |
+
}
|
19 |
+
|
20 |
+
keep black TRUMP* insample* day_id county_fips
|
21 |
+
compress
|
22 |
+
|
23 |
+
reghdfe black TRUMP_PRE5 if insample5==1 , a(i.day_id) cluster(county_fips day_id)
|
24 |
+
outreg2 using "Results\TableA2.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_PRE5) addtext("Window", "5 days") label nonotes nocons noni
|
25 |
+
|
26 |
+
forvalues j=10(5)30 {
|
27 |
+
reghdfe black TRUMP_PRE`j' if insample`j'==1 , a(i.day_id) cluster(county_fips day_id)
|
28 |
+
outreg2 using "Results\TableA2.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_PRE`j') addtext("Window", "`j' days") label nonotes nocons noni
|
29 |
+
}
|
30 |
+
|
31 |
+
forvalues j=5(5)30 {
|
32 |
+
summ black if insample`j'==1
|
33 |
+
}
|
39/replication_package/Do/TableA3.do
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A3
|
4 |
+
*** Impact of Trump Rallies on the Probability of a Black Stop:
|
5 |
+
*** Alternative Methods to Deal with Multiple Rallies
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
keep black dist* county_fips day_id
|
11 |
+
|
12 |
+
g TRUMP_0 = 0
|
13 |
+
forval ii = 1/9 {
|
14 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
15 |
+
}
|
16 |
+
|
17 |
+
g TRUMP_POST_M30 = 0
|
18 |
+
forval ii = 1(1)9{
|
19 |
+
replace TRUMP_POST_M30 = 1 if (dist_event`ii' >=31 & dist_event`ii'!=.)
|
20 |
+
}
|
21 |
+
g TRUMP_PRE_M30 = 0
|
22 |
+
forval ii = 1(1)9{
|
23 |
+
replace TRUMP_PRE_M30 = 1 if (dist_event`ii' <=-31 & dist_event`ii'!=.)
|
24 |
+
}
|
25 |
+
|
26 |
+
g TRUMP_POST_1_30 = 0
|
27 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event1 >=1 & dist_event1<=30 & dist_event1!=.)
|
28 |
+
replace TRUMP_POST_1_30 = 2 if (dist_event2 >=1 & dist_event2<=30 & dist_event2!=.)
|
29 |
+
replace TRUMP_POST_1_30 = 3 if (dist_event3 >=1 & dist_event3<=30 & dist_event3!=.)
|
30 |
+
replace TRUMP_POST_1_30 = 4 if (dist_event4 >=1 & dist_event4<=30 & dist_event4!=.)
|
31 |
+
replace TRUMP_POST_1_30 = 5 if (dist_event5 >=1 & dist_event5<=30 & dist_event5!=.)
|
32 |
+
replace TRUMP_POST_1_30 = 6 if (dist_event6 >=1 & dist_event6<=30 & dist_event6!=.)
|
33 |
+
replace TRUMP_POST_1_30 = 7 if (dist_event7 >=1 & dist_event7<=30 & dist_event7!=.)
|
34 |
+
replace TRUMP_POST_1_30 = 8 if (dist_event8 >=1 & dist_event8<=30 & dist_event8!=.)
|
35 |
+
replace TRUMP_POST_1_30 = 9 if (dist_event9 >=1 & dist_event9<=30 & dist_event9!=.)
|
36 |
+
|
37 |
+
reghdfe black 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_POST_M30 1.TRUMP_PRE_M30, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
38 |
+
outreg2 using "Results\TableA3.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) addtext("Sample","Sum Event") keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
39 |
+
|
40 |
+
**************************
|
41 |
+
use "Data\stoplevel_data.dta", clear
|
42 |
+
|
43 |
+
keep black dist* county_fips day_id
|
44 |
+
g stopid = _n
|
45 |
+
|
46 |
+
g eventexists=0
|
47 |
+
forval ii=1/9 {
|
48 |
+
replace eventexists = eventexists+1 if dist_event`ii'!=.
|
49 |
+
}
|
50 |
+
|
51 |
+
expand eventexists, generate(copy)
|
52 |
+
sort stopid eventexists
|
53 |
+
by stopid eventexists: g number=cond(_N==1,0,_n)
|
54 |
+
replace number=1 if number==0 & dist_event1!=.
|
55 |
+
replace eventexists=1 if eventexists==0
|
56 |
+
g invnrallies=1/(eventexists)
|
57 |
+
***
|
58 |
+
g dist_event=.
|
59 |
+
forval ii = 9(-1)1 {
|
60 |
+
replace dist_event = dist_event`ii' if number==`ii' & dist_event==.
|
61 |
+
}
|
62 |
+
|
63 |
+
g TRUMP_0 = 0
|
64 |
+
forval ii = 1/9 {
|
65 |
+
replace TRUMP_0 = 1 if dist_event == 0
|
66 |
+
}
|
67 |
+
|
68 |
+
g TRUMP_POST_1_30 = 0
|
69 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event >=1 & dist_event<=30 & dist_event!=.)
|
70 |
+
|
71 |
+
g TRUMP_POST_M30 = 0
|
72 |
+
replace TRUMP_POST_M30 = 1 if (dist_event >=31 & dist_event!=.)
|
73 |
+
|
74 |
+
g TRUMP_PRE_M30 = 0
|
75 |
+
replace TRUMP_PRE_M30 = 1 if (dist_event <=-31 & dist_event!=.)
|
76 |
+
|
77 |
+
reghdfe black 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_POST_M30 1.TRUMP_PRE_M30 [aweight=invnrallies], a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
78 |
+
outreg2 using "Results\TableA3.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) addtext("Sample","Event Panel") keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
39/replication_package/Do/TableA4.do
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A4
|
4 |
+
*** Impact of Trump Rallies on the Relative Probability that a Stopped
|
5 |
+
*** Driver is of a Race or Ethnicity Relative to Another: Split Samples
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if black==100 | white==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
11 |
+
outreg2 using "Results\TableA4.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
12 |
+
|
13 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if black==100 | hispanic==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
14 |
+
outreg2 using "Results\TableA4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
15 |
+
|
16 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if black==100 | api==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
17 |
+
outreg2 using "Results\TableA4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
18 |
+
|
19 |
+
reghdfe hispanic TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if hispanic==100 | white==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
20 |
+
outreg2 using "Results\TableA4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
21 |
+
|
22 |
+
reghdfe hispanic TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if hispanic==100 | api==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
23 |
+
outreg2 using "Results\TableA4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
24 |
+
|
25 |
+
reghdfe api TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 if api==100 | white==100, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
26 |
+
outreg2 using "Results\TableA4.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(TRUMP_POST_1_30) label nonotes nocons noni
|
27 |
+
|
39/replication_package/Do/TableA5.do
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A5
|
4 |
+
*** Impact of Trump Rallies on the Number of Stops by Race or Ethnicity
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\county_day_data.dta", clear
|
8 |
+
|
9 |
+
reghdfe ihsblack 1.TRUMP_0 1.TRUMP_PRE* 1.TRUMP_POST* ihsstops [aweight=n_stops], a(i.county_fips i.day_id i.county_fips##c.day_id) cluster(county_fips day_id)
|
10 |
+
outreg2 using "Results\TableA5.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
11 |
+
|
12 |
+
reghdfe ihshispanic 1.TRUMP_0 1.TRUMP_PRE* 1.TRUMP_POST* ihsstops [aweight=n_stops], a(i.county_fips i.day_id i.county_fips##c.day_id) cluster(county_fips day_id)
|
13 |
+
outreg2 using "Results\TableA5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
14 |
+
|
15 |
+
reghdfe ihswhite 1.TRUMP_0 1.TRUMP_PRE* 1.TRUMP_POST* ihsstops [aweight=n_stops], a(i.county_fips i.day_id i.county_fips##c.day_id) cluster(county_fips day_id)
|
16 |
+
outreg2 using "Results\TableA5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
17 |
+
|
18 |
+
reghdfe ihsapi 1.TRUMP_0 1.TRUMP_PRE* 1.TRUMP_POST* ihsstops [aweight=n_stops], a(i.county_fips i.day_id i.county_fips##c.day_id) cluster(county_fips day_id)
|
19 |
+
outreg2 using "Results\TableA5.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30) label nonotes nocons noni
|
20 |
+
|
21 |
+
summ ihsblack_pc ihshispanic_pc ihswhite_pc ihsapi_pc [aweight=n_stops]
|
22 |
+
|
39/replication_package/Do/TableA6.do
ADDED
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A6
|
4 |
+
*** The Differential Effect of Trump and Other Political Rallies on
|
5 |
+
*** the Probability of a Black Stop
|
6 |
+
**********************************************************************
|
7 |
+
|
8 |
+
use "Data\stoplevel_data.dta", clear
|
9 |
+
|
10 |
+
merge n:1 county_fips using "Data\allcandidates_rallies.dta"
|
11 |
+
|
12 |
+
keep if year==2015 | year==2016 | year==2017
|
13 |
+
drop dist_event*
|
14 |
+
|
15 |
+
forval ii = 1/4 {
|
16 |
+
g dist_event`ii' = day_id - event_day_Cruz_`ii'
|
17 |
+
}
|
18 |
+
g CRUZ_0 = 0
|
19 |
+
forval ii = 1/4 {
|
20 |
+
replace CRUZ_0 = 1 if dist_event`ii' == 0 & dist_event`ii'!=.
|
21 |
+
}
|
22 |
+
*
|
23 |
+
g CRUZ_POST_1_30 = 0
|
24 |
+
forval ii = 1/4 {
|
25 |
+
replace CRUZ_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
26 |
+
}
|
27 |
+
g CRUZ_POST_M30 = 0
|
28 |
+
forval ii = 1/4 {
|
29 |
+
replace CRUZ_POST_M30 = 1 if (dist_event`ii' >30 & dist_event`ii'!=.)
|
30 |
+
}
|
31 |
+
g CRUZ_PRE_M30 = 0
|
32 |
+
forval ii = 1/4 {
|
33 |
+
replace CRUZ_PRE_M30 = 1 if (dist_event`ii' <-30 & dist_event`ii'!=.)
|
34 |
+
}
|
35 |
+
drop dist_event*
|
36 |
+
|
37 |
+
forval ii = 1/10 {
|
38 |
+
g dist_event`ii' = day_id - event_day_Clinton_`ii'
|
39 |
+
}
|
40 |
+
g CLINTON_0 = 0
|
41 |
+
forval ii = 1/10 {
|
42 |
+
replace CLINTON_0 = 1 if dist_event`ii' == 0 & dist_event`ii'!=.
|
43 |
+
}
|
44 |
+
*
|
45 |
+
g CLINTON_POST_1_30 = 0
|
46 |
+
forval ii = 1/10 {
|
47 |
+
replace CLINTON_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
48 |
+
}
|
49 |
+
g CLINTON_POST_M30 = 0
|
50 |
+
forval ii = 1/10 {
|
51 |
+
replace CLINTON_POST_M30 = 1 if (dist_event`ii' >30 & dist_event`ii'!=.)
|
52 |
+
}
|
53 |
+
g CLINTON_PRE_M30 = 0
|
54 |
+
forval ii = 1/10 {
|
55 |
+
replace CLINTON_PRE_M30 = 1 if (dist_event`ii' <-30 & dist_event`ii'!=.)
|
56 |
+
}
|
57 |
+
drop dist_event*
|
58 |
+
drop black
|
59 |
+
g black = (subject_race==2) * 100
|
60 |
+
|
61 |
+
egen t = group(day_id)
|
62 |
+
|
63 |
+
g anyrally_0 = (TRUMP_0==1 | CRUZ_0==1 | CLINTON_0==1)
|
64 |
+
g anyrally_1_30 = (TRUMP_POST_1_30==1 | CRUZ_POST_1_30==1 | CLINTON_POST_1_30==1)
|
65 |
+
g anyrally_POST_M30 = (TRUMP_POST_M30==1 | CRUZ_POST_M30==1 | CLINTON_POST_M30==1)
|
66 |
+
g anyrally_PRE_M30 = (TRUMP_PRE_M30==1 | CRUZ_PRE_M30==1 | CLINTON_PRE_M30==1)
|
67 |
+
|
68 |
+
reghdfe black TRUMP_0 TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30 anyrally_0 anyrally_1_30 anyrally_POST_M30 anyrally_PRE_M30, absorb(county_fips day_id county_fips#c.day_id) cluster(county_fips day_id)
|
69 |
+
outreg2 using "Results\TableA6.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(anyrally_1_30 TRUMP_POST_1_30) label nonotes nocons noni
|
70 |
+
|
71 |
+
*******************************************************************************************************************
|
72 |
+
use "Data\stops_2007_09.dta", clear
|
73 |
+
|
74 |
+
forval ii = 1/3 {
|
75 |
+
g dist_event`ii' = day_id - event_day_Obama_`ii'
|
76 |
+
}
|
77 |
+
|
78 |
+
g OBAMA_0 = 0
|
79 |
+
forval ii = 1/3 {
|
80 |
+
replace OBAMA_0 = 1 if dist_event`ii' == 0 & dist_event`ii'!=.
|
81 |
+
}
|
82 |
+
*
|
83 |
+
g OBAMA_POST_1_30 = 0
|
84 |
+
forval ii = 1/3 {
|
85 |
+
replace OBAMA_POST_1_30 = 1 if (dist_event`ii' > 0 & dist_event`ii'<=30 & dist_event`ii'!=.)
|
86 |
+
}
|
87 |
+
g OBAMA_POST_M30 = 0
|
88 |
+
forval ii = 1/3 {
|
89 |
+
replace OBAMA_POST_M30 = 1 if (dist_event`ii' >30 & dist_event`ii'!=.)
|
90 |
+
}
|
91 |
+
g OBAMA_PRE_M30 = 0
|
92 |
+
forval ii = 1/3 {
|
93 |
+
replace OBAMA_PRE_M30 = 1 if (dist_event`ii' <-30& dist_event`ii'!=.)
|
94 |
+
}
|
95 |
+
g black = 100*(subject_race == 2)
|
96 |
+
|
97 |
+
g sep = "-"
|
98 |
+
egen state_county = concat(state sep county_name)
|
99 |
+
drop sep
|
100 |
+
egen county_id = group(state_county)
|
101 |
+
|
102 |
+
reghdfe black 1.OBAMA_* , a(i.county_id i.day_id i.county_id#c.day_id) cluster(county_id day_id )
|
103 |
+
outreg2 using "Results\TableA6.txt", append se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.OBAMA_POST_1_30) label nonotes nocons noni
|
39/replication_package/Do/TableA7.do
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A7
|
4 |
+
*** Social Spillover Effects of Trump Rallies
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\network_spillovers.dta", clear
|
8 |
+
|
9 |
+
reghdfe black 1.TRUMP_* s_network_effect_TRUMP_POST_1_30, a(i.county_fips i.day_id i.county_fips#c.day_id) cluster(county_fips day_id)
|
10 |
+
outreg2 using "Results\TableA7.txt", replace se bdec(3) sdec(3) rdec(3) coefastr alpha(0.01, 0.05, 0.10) symbol(***, **, *) bfmt(fc) keep(1.TRUMP_POST_1_30 s_network_effect_TRUMP_POST_1_30) label nonotes nocons noni
|
11 |
+
|
39/replication_package/Do/TableA8.do
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A8
|
4 |
+
*** Driver Behavior: Rectangular Panel
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\fars_data.dta", clear
|
8 |
+
|
9 |
+
egen county_id=group(county_fips)
|
10 |
+
drop if county_id==.
|
11 |
+
drop if date==.
|
12 |
+
|
13 |
+
xtset county_id date
|
14 |
+
|
15 |
+
tsfill, full
|
16 |
+
sort county_id date
|
17 |
+
|
18 |
+
bysort county_id: egen county_fips2 = mean(county_fips)
|
19 |
+
replace county_fips = county_fips2
|
20 |
+
drop county_fips2
|
21 |
+
|
22 |
+
foreach var of varlist incidents Fatal Violation Drug FatalViolation FatalDrug Black Mexican MexicanViolation MexicanDrug Asian BlackViolation BlackDrug Hispanic HispanicViolation HispanicDrug White {
|
23 |
+
replace `var' = 0 if `var'==.
|
24 |
+
}
|
25 |
+
|
26 |
+
sort county_fips date
|
27 |
+
forval ii=1/9 {
|
28 |
+
by county_fips: egen event_day_Trump2_`ii' = mean(event_day_Trump_`ii')
|
29 |
+
replace event_day_Trump_`ii' = event_day_Trump2_`ii'
|
30 |
+
}
|
31 |
+
|
32 |
+
forval ii = 1/9 {
|
33 |
+
g dist_event`ii' = date - event_day_Trump_`ii'
|
34 |
+
}
|
35 |
+
|
36 |
+
replace TRUMP_0 = 0
|
37 |
+
forval ii = 1/9 {
|
38 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
39 |
+
}
|
40 |
+
|
41 |
+
replace TRUMP_POST_1_30 = 0
|
42 |
+
forval ii = 1(1)9{
|
43 |
+
forval ee = 1/9 {
|
44 |
+
replace TRUMP_POST_1_30 = 1 if (dist_event`ee' >=1 & dist_event`ee'<=30 & dist_event`ee'!=.)
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
replace TRUMP_POST_M30 = 0
|
49 |
+
forval ii = 1(1)9{
|
50 |
+
forval ee = 1/9 {
|
51 |
+
replace TRUMP_POST_M30 = 1 if (dist_event`ee' >=31 & dist_event`ee'!=.)
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
replace TRUMP_PRE_M30 = 0
|
56 |
+
forval ii = 1(1)9{
|
57 |
+
forval ee = 1/9 {
|
58 |
+
replace TRUMP_PRE_M30 = 1 if (dist_event`ee' <=-31 & dist_event`ee'!=.)
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
replace nonblack=Fatal-Black
|
63 |
+
|
64 |
+
replace ihsblack=100*log(Black+(Black^2+1)^0.5)
|
65 |
+
replace ihsfatal=100*log(Fatal+(Fatal^2+1)^0.5)
|
66 |
+
replace ihsfatalviolation=100*log(FatalViolation+(FatalViolation^2+1)^0.5)
|
67 |
+
replace ihsfataldrug=100*log(FatalDrug+(FatalDrug^2+1)^0.5)
|
68 |
+
replace ihsnonblack=100*log(nonblack+(nonblack^2+1)^0.5)
|
69 |
+
replace ihswhite=100*log(White+(White^2+1)^0.5)
|
70 |
+
replace ihsmexican=100*log(Mexican+(Mexican^2+1)^0.5)
|
71 |
+
replace ihshispani=100*log(Hispanic+(Hispanic^2+1)^0.5)
|
72 |
+
replace ihsBlackViolation=100*log(BlackViolation+(BlackViolation^2+1)^0.5)
|
73 |
+
replace ihsBlackDrug=100*log(BlackDrug+(BlackDrug^2+1)^0.5)
|
74 |
+
foreach x in Violation Drug incidents HispanicViolation HispanicDrug MexicanViolation MexicanDrug{
|
75 |
+
replace ihs`x'=100*log(`x'+(`x'^2+1)^0.5)
|
76 |
+
}
|
77 |
+
|
78 |
+
reghdfe ihsinc 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_PRE_M30 1.TRUMP_POST_M30, a(i.county_fips i.date) cluster(county_fips date)
|
79 |
+
outreg2 using "Results/TableA8.txt", replace keep(1.TRUMP_POST_1_30) dec(3) nocons
|
80 |
+
|
81 |
+
foreach y in ihsfatal ihsfatalviolation ihsblack ihsnonblack ihswhite ihshispani ihsmexican {
|
82 |
+
reghdfe `y' 1.TRUMP_0 1.TRUMP_POST_1_30 1.TRUMP_PRE_M30 1.TRUMP_POST_M30 ihsincidents, a(i.county_fips i.date) cluster(county_fips date)
|
83 |
+
outreg2 using "Results/TableA8.txt", append keep(1.TRUMP_POST_1_30) dec(3) nocons
|
84 |
+
|
85 |
+
}
|
86 |
+
summ ihsinc ihsfatal ihsfatalviolation ihsblack ihsnonblack ihswhite ihshispani ihsmexican
|
39/replication_package/Do/TableA9.do
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
**********************************************************************
|
3 |
+
*** TABLE A9
|
4 |
+
*** Impact of Trump Rallies on BLM Protests
|
5 |
+
**********************************************************************
|
6 |
+
|
7 |
+
use "Data\stoplevel_data.dta", clear
|
8 |
+
|
9 |
+
merge m:1 county_fips day_id using "Data\blm.dta"
|
10 |
+
drop if _merge==2
|
11 |
+
replace blm_protest = 0 if blm_protest==.
|
12 |
+
replace blm_protest = 100*blm_protest
|
13 |
+
|
14 |
+
reghdfe blm_protest TRUMP_0 1.TRUMP_POST_1_30 TRUMP_POST_M30 TRUMP_PRE_M30, a(i.county_fips i.day_id c.day_id#i.county_fips) cluster(county_fips day_id)
|
15 |
+
outreg2 using "Results/TableA9.txt", replace keep(1.TRUMP_POST_1_30) dec(3) nocons
|
16 |
+
g esample = (e(sample)==1)
|
17 |
+
summ blm_protest if esample==1
|
39/replication_package/Do/preparing_abrahamsun.do
ADDED
@@ -0,0 +1,2845 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
use "Data\stoplevel_data.dta", clear
|
3 |
+
|
4 |
+
g n_stops = 1
|
5 |
+
foreach var of varlist black hispanic white api {
|
6 |
+
replace `var' = `var'/100
|
7 |
+
}
|
8 |
+
|
9 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
10 |
+
|
11 |
+
g black_ps = black / n_stops
|
12 |
+
keep if year==2015 | year==2016 | year==2017
|
13 |
+
|
14 |
+
local start = -105
|
15 |
+
local end = 105
|
16 |
+
local bin_l = 15
|
17 |
+
|
18 |
+
g TRUMP_0 = 0
|
19 |
+
forval ii = 1/9 {
|
20 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
21 |
+
}
|
22 |
+
|
23 |
+
forval ii = 1(`bin_l')`end'{
|
24 |
+
local jj = `ii' + `bin_l' - 1
|
25 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
26 |
+
forval ee = 1/9 {
|
27 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
28 |
+
}
|
29 |
+
}
|
30 |
+
g TRUMP_POST_M`end' = 0
|
31 |
+
forval ii = 1/9 {
|
32 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
33 |
+
}
|
34 |
+
*
|
35 |
+
|
36 |
+
forval ii = `start'(`bin_l')0 {
|
37 |
+
if `ii' < -`bin_l' {
|
38 |
+
local jj = abs(`ii')
|
39 |
+
local zz = `jj' - `bin_l' + 1
|
40 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
41 |
+
forval ee = 1/9 {
|
42 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
43 |
+
}
|
44 |
+
}
|
45 |
+
}
|
46 |
+
*
|
47 |
+
local jj = abs(`start')
|
48 |
+
g TRUMP_PRE_M`jj' = 0
|
49 |
+
forval ii = 1/9 {
|
50 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
51 |
+
}
|
52 |
+
|
53 |
+
***number of counties 1,478
|
54 |
+
qui: {
|
55 |
+
forval ii = 1/1478 {
|
56 |
+
su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
57 |
+
if r(N) != 0 {
|
58 |
+
total n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
59 |
+
global stops`ii' = _b[n_stops]
|
60 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
61 |
+
}
|
62 |
+
}
|
63 |
+
}
|
64 |
+
*** Drop the first for collinearity
|
65 |
+
drop TREATED_COUNTY_9
|
66 |
+
|
67 |
+
reghdfe black_ps 1.TRUMP_POST_1_15 1.TRUMP_POST_1_15#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
68 |
+
|
69 |
+
mat treat = 999* J(1478,2,1)
|
70 |
+
|
71 |
+
local numerator = 0
|
72 |
+
local denominator = 0
|
73 |
+
forval ii = 1/1478 {
|
74 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
75 |
+
if r(N) != 0 {
|
76 |
+
if `ii' == 9{
|
77 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15])
|
78 |
+
mat treat[`ii',2] = (${stops`ii'})
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15] + _b[1.TRUMP_POST_1_15#1.TREATED_COUNTY_`ii'])
|
82 |
+
mat treat[`ii',2] = (${stops`ii'})
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
g yy = treat[_n,1] in 1/1478
|
88 |
+
g ww = treat[_n,2] in 1/1478
|
89 |
+
replace yy = . if yy==999
|
90 |
+
replace ww = . if ww==999
|
91 |
+
|
92 |
+
keep yy ww
|
93 |
+
|
94 |
+
g county_id = _n
|
95 |
+
drop if county_id > 1478
|
96 |
+
|
97 |
+
save "Results\SA_TRUMP_POST_1_15_TE.dta", replace
|
98 |
+
|
99 |
+
************************************************************************************************************************************
|
100 |
+
use "Data\stoplevel_data.dta", clear
|
101 |
+
|
102 |
+
g n_stops = 1
|
103 |
+
foreach var of varlist black hispanic white api {
|
104 |
+
replace `var' = `var'/100
|
105 |
+
}
|
106 |
+
|
107 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
108 |
+
|
109 |
+
g black_ps = black / n_stops
|
110 |
+
keep if year==2015 | year==2016 | year==2017
|
111 |
+
|
112 |
+
local start = -105
|
113 |
+
local end = 105
|
114 |
+
local bin_l = 15
|
115 |
+
|
116 |
+
g TRUMP_0 = 0
|
117 |
+
forval ii = 1/9 {
|
118 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
119 |
+
}
|
120 |
+
|
121 |
+
forval ii = 1(`bin_l')`end'{
|
122 |
+
local jj = `ii' + `bin_l' - 1
|
123 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
124 |
+
forval ee = 1/9 {
|
125 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
126 |
+
}
|
127 |
+
}
|
128 |
+
g TRUMP_POST_M`end' = 0
|
129 |
+
forval ii = 1/9 {
|
130 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
131 |
+
}
|
132 |
+
*
|
133 |
+
|
134 |
+
forval ii = `start'(`bin_l')0 {
|
135 |
+
if `ii' < -`bin_l' {
|
136 |
+
local jj = abs(`ii')
|
137 |
+
local zz = `jj' - `bin_l' + 1
|
138 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
139 |
+
forval ee = 1/9 {
|
140 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
141 |
+
}
|
142 |
+
}
|
143 |
+
}
|
144 |
+
*
|
145 |
+
local jj = abs(`start')
|
146 |
+
g TRUMP_PRE_M`jj' = 0
|
147 |
+
forval ii = 1/9 {
|
148 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
149 |
+
}
|
150 |
+
|
151 |
+
***number of counties 1,478
|
152 |
+
qui: {
|
153 |
+
forval ii = 1/1478 {
|
154 |
+
su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
155 |
+
if r(N) != 0 {
|
156 |
+
total n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
157 |
+
global stops`ii' = _b[n_stops]
|
158 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
159 |
+
}
|
160 |
+
}
|
161 |
+
}
|
162 |
+
*** Drop the first for collinearity
|
163 |
+
drop TREATED_COUNTY_9
|
164 |
+
|
165 |
+
reghdfe black_ps 1.TRUMP_POST_16_30 1.TRUMP_POST_16_30#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
166 |
+
|
167 |
+
mat treat = 999* J(1478,2,1)
|
168 |
+
|
169 |
+
local numerator = 0
|
170 |
+
local denominator = 0
|
171 |
+
forval ii = 1/1478 {
|
172 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
173 |
+
if r(N) != 0 {
|
174 |
+
if `ii' == 9{
|
175 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30])
|
176 |
+
mat treat[`ii',2] = (${stops`ii'})
|
177 |
+
}
|
178 |
+
else {
|
179 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30] + _b[1.TRUMP_POST_16_30#1.TREATED_COUNTY_`ii'])
|
180 |
+
mat treat[`ii',2] = (${stops`ii'})
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
|
185 |
+
g yy = treat[_n,1] in 1/1478
|
186 |
+
g ww = treat[_n,2] in 1/1478
|
187 |
+
replace yy = . if yy==999
|
188 |
+
replace ww = . if ww==999
|
189 |
+
|
190 |
+
keep yy ww
|
191 |
+
|
192 |
+
g county_id = _n
|
193 |
+
drop if county_id > 1478
|
194 |
+
|
195 |
+
save "Results\SA_TRUMP_POST_16_30_TE.dta", replace
|
196 |
+
|
197 |
+
************************************************************************************************************************************
|
198 |
+
use "data\Jack Police\full_dataset_CD.dta", clear
|
199 |
+
|
200 |
+
g black_ps = black / n_stops
|
201 |
+
keep if year==2015 | year==2016 | year==2017
|
202 |
+
|
203 |
+
local start = -105
|
204 |
+
local end = 105
|
205 |
+
local bin_l = 15
|
206 |
+
|
207 |
+
g TRUMP_0 = 0
|
208 |
+
forval ii = 1/9 {
|
209 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
210 |
+
}
|
211 |
+
|
212 |
+
|
213 |
+
forval ii = 1(`bin_l')`end'{
|
214 |
+
local jj = `ii' + `bin_l' - 1
|
215 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
216 |
+
forval ee = 1/9 {
|
217 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
218 |
+
}
|
219 |
+
}
|
220 |
+
g TRUMP_POST_M`end' = 0
|
221 |
+
forval ii = 1/9 {
|
222 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
223 |
+
}
|
224 |
+
*
|
225 |
+
|
226 |
+
forval ii = `start'(`bin_l')0 {
|
227 |
+
if `ii' < -`bin_l' {
|
228 |
+
local jj = abs(`ii')
|
229 |
+
local zz = `jj' - `bin_l' + 1
|
230 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
231 |
+
forval ee = 1/9 {
|
232 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
233 |
+
}
|
234 |
+
}
|
235 |
+
}
|
236 |
+
*
|
237 |
+
local jj = abs(`start')
|
238 |
+
g TRUMP_PRE_M`jj' = 0
|
239 |
+
forval ii = 1/9 {
|
240 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
241 |
+
}
|
242 |
+
|
243 |
+
***number of counties 1,478
|
244 |
+
qui: {
|
245 |
+
forval ii = 1/1478 {
|
246 |
+
su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
247 |
+
if r(N) != 0 {
|
248 |
+
total n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
249 |
+
global stops`ii' = _b[n_stops]
|
250 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
251 |
+
}
|
252 |
+
}
|
253 |
+
}
|
254 |
+
*** Drop the first for collinearity
|
255 |
+
drop TREATED_COUNTY_9
|
256 |
+
|
257 |
+
reghdfe black_ps 1.TRUMP_POST_31_45 1.TRUMP_POST_31_45#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
258 |
+
|
259 |
+
mat treat = 999* J(1478,2,1)
|
260 |
+
|
261 |
+
local numerator = 0
|
262 |
+
local denominator = 0
|
263 |
+
forval ii = 1/1478 {
|
264 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
265 |
+
if r(N) != 0 {
|
266 |
+
if `ii' == 9{
|
267 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45])
|
268 |
+
mat treat[`ii',2] = (${stops`ii'})
|
269 |
+
}
|
270 |
+
else {
|
271 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45] + _b[1.TRUMP_POST_31_45#1.TREATED_COUNTY_`ii'])
|
272 |
+
mat treat[`ii',2] = (${stops`ii'})
|
273 |
+
}
|
274 |
+
}
|
275 |
+
}
|
276 |
+
|
277 |
+
g yy = treat[_n,1] in 1/1478
|
278 |
+
g ww = treat[_n,2] in 1/1478
|
279 |
+
replace yy = . if yy==999
|
280 |
+
replace ww = . if ww==999
|
281 |
+
|
282 |
+
keep yy ww
|
283 |
+
|
284 |
+
g county_id = _n
|
285 |
+
drop if county_id > 1478
|
286 |
+
|
287 |
+
save "Results\SA_TRUMP_POST_31_45_TE.dta", replace
|
288 |
+
|
289 |
+
************************************************************************************************************************************
|
290 |
+
use "Data\stoplevel_data.dta", clear
|
291 |
+
|
292 |
+
g n_stops = 1
|
293 |
+
foreach var of varlist black hispanic white api {
|
294 |
+
replace `var' = `var'/100
|
295 |
+
}
|
296 |
+
|
297 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
298 |
+
|
299 |
+
g black_ps = black / n_stops
|
300 |
+
keep if year==2015 | year==2016 | year==2017
|
301 |
+
|
302 |
+
local start = -105
|
303 |
+
local end = 105
|
304 |
+
local bin_l = 15
|
305 |
+
|
306 |
+
g TRUMP_0 = 0
|
307 |
+
forval ii = 1/9 {
|
308 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
309 |
+
}
|
310 |
+
|
311 |
+
forval ii = 1(`bin_l')`end'{
|
312 |
+
local jj = `ii' + `bin_l' - 1
|
313 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
314 |
+
forval ee = 1/9 {
|
315 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
316 |
+
}
|
317 |
+
}
|
318 |
+
g TRUMP_POST_M`end' = 0
|
319 |
+
forval ii = 1/9 {
|
320 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
321 |
+
}
|
322 |
+
*
|
323 |
+
|
324 |
+
forval ii = `start'(`bin_l')0 {
|
325 |
+
if `ii' < -`bin_l' {
|
326 |
+
local jj = abs(`ii')
|
327 |
+
local zz = `jj' - `bin_l' + 1
|
328 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
329 |
+
forval ee = 1/9 {
|
330 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
331 |
+
}
|
332 |
+
}
|
333 |
+
}
|
334 |
+
*
|
335 |
+
local jj = abs(`start')
|
336 |
+
g TRUMP_PRE_M`jj' = 0
|
337 |
+
forval ii = 1/9 {
|
338 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
339 |
+
}
|
340 |
+
|
341 |
+
***number of counties 1,478
|
342 |
+
qui: {
|
343 |
+
forval ii = 1/1478 {
|
344 |
+
su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
345 |
+
if r(N) != 0 {
|
346 |
+
total n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
347 |
+
global stops`ii' = _b[n_stops]
|
348 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
349 |
+
}
|
350 |
+
}
|
351 |
+
}
|
352 |
+
*** Drop the first for collinearity
|
353 |
+
drop TREATED_COUNTY_9
|
354 |
+
|
355 |
+
reghdfe black_ps 1.TRUMP_POST_46_60 1.TRUMP_POST_46_60#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
356 |
+
|
357 |
+
mat treat = 999* J(1478,2,1)
|
358 |
+
|
359 |
+
local numerator = 0
|
360 |
+
local denominator = 0
|
361 |
+
forval ii = 1/1478 {
|
362 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
363 |
+
if r(N) != 0 {
|
364 |
+
if `ii' == 9{
|
365 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60])
|
366 |
+
mat treat[`ii',2] = (${stops`ii'})
|
367 |
+
}
|
368 |
+
else {
|
369 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60] + _b[1.TRUMP_POST_46_60#1.TREATED_COUNTY_`ii'])
|
370 |
+
mat treat[`ii',2] = (${stops`ii'})
|
371 |
+
}
|
372 |
+
}
|
373 |
+
}
|
374 |
+
|
375 |
+
g yy = treat[_n,1] in 1/1478
|
376 |
+
g ww = treat[_n,2] in 1/1478
|
377 |
+
replace yy = . if yy==999
|
378 |
+
replace ww = . if ww==999
|
379 |
+
|
380 |
+
keep yy ww
|
381 |
+
|
382 |
+
g county_id = _n
|
383 |
+
drop if county_id > 1478
|
384 |
+
|
385 |
+
save "Results\SA_TRUMP_POST_46_60_TE.dta", replace
|
386 |
+
|
387 |
+
************************************************************************************************************************************
|
388 |
+
|
389 |
+
use "Data\stoplevel_data.dta", clear
|
390 |
+
|
391 |
+
g n_stops = 1
|
392 |
+
foreach var of varlist black hispanic white api {
|
393 |
+
replace `var' = `var'/100
|
394 |
+
}
|
395 |
+
|
396 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
397 |
+
|
398 |
+
g black_ps = black / n_stops
|
399 |
+
keep if year==2015 | year==2016 | year==2017
|
400 |
+
|
401 |
+
local start = -105
|
402 |
+
local end = 105
|
403 |
+
local bin_l = 15
|
404 |
+
|
405 |
+
g TRUMP_0 = 0
|
406 |
+
forval ii = 1/9 {
|
407 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
408 |
+
}
|
409 |
+
|
410 |
+
|
411 |
+
forval ii = 1(`bin_l')`end'{
|
412 |
+
local jj = `ii' + `bin_l' - 1
|
413 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
414 |
+
forval ee = 1/9 {
|
415 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
416 |
+
}
|
417 |
+
}
|
418 |
+
g TRUMP_POST_M`end' = 0
|
419 |
+
forval ii = 1/9 {
|
420 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
421 |
+
}
|
422 |
+
*
|
423 |
+
|
424 |
+
|
425 |
+
forval ii = `start'(`bin_l')0 {
|
426 |
+
if `ii' < -`bin_l' {
|
427 |
+
local jj = abs(`ii')
|
428 |
+
local zz = `jj' - `bin_l' + 1
|
429 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
430 |
+
forval ee = 1/9 {
|
431 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
432 |
+
}
|
433 |
+
}
|
434 |
+
}
|
435 |
+
*
|
436 |
+
local jj = abs(`start')
|
437 |
+
g TRUMP_PRE_M`jj' = 0
|
438 |
+
forval ii = 1/9 {
|
439 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
440 |
+
}
|
441 |
+
|
442 |
+
***number of counties 1,478
|
443 |
+
qui: {
|
444 |
+
forval ii = 1/1478 {
|
445 |
+
su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
446 |
+
if r(N) != 0 {
|
447 |
+
total n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
448 |
+
global stops`ii' = _b[n_stops]
|
449 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
450 |
+
}
|
451 |
+
}
|
452 |
+
}
|
453 |
+
*** Drop the first for collinearity
|
454 |
+
drop TREATED_COUNTY_9
|
455 |
+
|
456 |
+
reghdfe black_ps 1.TRUMP_POST_61_75 1.TRUMP_POST_61_75#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
457 |
+
|
458 |
+
|
459 |
+
mat treat = 999* J(1478,2,1)
|
460 |
+
|
461 |
+
local numerator = 0
|
462 |
+
local denominator = 0
|
463 |
+
forval ii = 1/1478 {
|
464 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
465 |
+
if r(N) != 0 {
|
466 |
+
if `ii' == 9{
|
467 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75])
|
468 |
+
mat treat[`ii',2] = (${stops`ii'})
|
469 |
+
}
|
470 |
+
else {
|
471 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75] + _b[1.TRUMP_POST_61_75#1.TREATED_COUNTY_`ii'])
|
472 |
+
mat treat[`ii',2] = (${stops`ii'})
|
473 |
+
}
|
474 |
+
}
|
475 |
+
}
|
476 |
+
|
477 |
+
g yy = treat[_n,1] in 1/1478
|
478 |
+
g ww = treat[_n,2] in 1/1478
|
479 |
+
replace yy = . if yy==999
|
480 |
+
replace ww = . if ww==999
|
481 |
+
|
482 |
+
keep yy ww
|
483 |
+
|
484 |
+
g county_id = _n
|
485 |
+
drop if county_id > 1478
|
486 |
+
|
487 |
+
|
488 |
+
save "Results\SA_TRUMP_POST_61_75_TE.dta", replace
|
489 |
+
|
490 |
+
************************************************************************************************************************************
|
491 |
+
|
492 |
+
use "Data\stoplevel_data.dta", clear
|
493 |
+
|
494 |
+
g n_stops = 1
|
495 |
+
foreach var of varlist black hispanic white api {
|
496 |
+
replace `var' = `var'/100
|
497 |
+
}
|
498 |
+
|
499 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
500 |
+
|
501 |
+
g black_ps = black / n_stops
|
502 |
+
keep if year==2015 | year==2016 | year==2017
|
503 |
+
|
504 |
+
local start = -105
|
505 |
+
local end = 105
|
506 |
+
local bin_l = 15
|
507 |
+
|
508 |
+
g TRUMP_0 = 0
|
509 |
+
forval ii = 1/9 {
|
510 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
511 |
+
}
|
512 |
+
|
513 |
+
|
514 |
+
forval ii = 1(`bin_l')`end'{
|
515 |
+
local jj = `ii' + `bin_l' - 1
|
516 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
517 |
+
forval ee = 1/9 {
|
518 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
519 |
+
}
|
520 |
+
}
|
521 |
+
g TRUMP_POST_M`end' = 0
|
522 |
+
forval ii = 1/9 {
|
523 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
524 |
+
}
|
525 |
+
*
|
526 |
+
|
527 |
+
|
528 |
+
forval ii = `start'(`bin_l')0 {
|
529 |
+
if `ii' < -`bin_l' {
|
530 |
+
local jj = abs(`ii')
|
531 |
+
local zz = `jj' - `bin_l' + 1
|
532 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
533 |
+
forval ee = 1/9 {
|
534 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
535 |
+
}
|
536 |
+
}
|
537 |
+
}
|
538 |
+
*
|
539 |
+
local jj = abs(`start')
|
540 |
+
g TRUMP_PRE_M`jj' = 0
|
541 |
+
forval ii = 1/9 {
|
542 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
543 |
+
}
|
544 |
+
|
545 |
+
***number of counties 1,478
|
546 |
+
qui: {
|
547 |
+
forval ii = 1/1478 {
|
548 |
+
su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
549 |
+
if r(N) != 0 {
|
550 |
+
total n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
551 |
+
global stops`ii' = _b[n_stops]
|
552 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
553 |
+
}
|
554 |
+
}
|
555 |
+
}
|
556 |
+
*** Drop the first for collinearity
|
557 |
+
drop TREATED_COUNTY_9
|
558 |
+
|
559 |
+
reghdfe black_ps 1.TRUMP_POST_76_90 1.TRUMP_POST_76_90#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
560 |
+
|
561 |
+
mat treat = 999* J(1478,2,1)
|
562 |
+
|
563 |
+
local numerator = 0
|
564 |
+
local denominator = 0
|
565 |
+
forval ii = 1/1478 {
|
566 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
567 |
+
if r(N) != 0 {
|
568 |
+
if `ii' == 9{
|
569 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90])
|
570 |
+
mat treat[`ii',2] = (${stops`ii'})
|
571 |
+
}
|
572 |
+
else {
|
573 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90] + _b[1.TRUMP_POST_76_90#1.TREATED_COUNTY_`ii'])
|
574 |
+
mat treat[`ii',2] = (${stops`ii'})
|
575 |
+
}
|
576 |
+
}
|
577 |
+
}
|
578 |
+
|
579 |
+
g yy = treat[_n,1] in 1/1478
|
580 |
+
g ww = treat[_n,2] in 1/1478
|
581 |
+
replace yy = . if yy==999
|
582 |
+
replace ww = . if ww==999
|
583 |
+
|
584 |
+
keep yy ww
|
585 |
+
|
586 |
+
g county_id = _n
|
587 |
+
drop if county_id > 1478
|
588 |
+
|
589 |
+
save "Results\SA_TRUMP_POST_76_90_TE.dta", replace
|
590 |
+
|
591 |
+
|
592 |
+
************************************************************************************************************************************
|
593 |
+
|
594 |
+
use "Data\stoplevel_data.dta", clear
|
595 |
+
|
596 |
+
g n_stops = 1
|
597 |
+
foreach var of varlist black hispanic white api {
|
598 |
+
replace `var' = `var'/100
|
599 |
+
}
|
600 |
+
|
601 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
602 |
+
|
603 |
+
g black_ps = black / n_stops
|
604 |
+
keep if year==2015 | year==2016 | year==2017
|
605 |
+
|
606 |
+
local start = -105
|
607 |
+
local end = 105
|
608 |
+
local bin_l = 15
|
609 |
+
|
610 |
+
g TRUMP_0 = 0
|
611 |
+
forval ii = 1/9 {
|
612 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
613 |
+
}
|
614 |
+
|
615 |
+
|
616 |
+
forval ii = 1(`bin_l')`end'{
|
617 |
+
local jj = `ii' + `bin_l' - 1
|
618 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
619 |
+
forval ee = 1/9 {
|
620 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
621 |
+
}
|
622 |
+
}
|
623 |
+
g TRUMP_POST_M`end' = 0
|
624 |
+
forval ii = 1/9 {
|
625 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
626 |
+
}
|
627 |
+
*
|
628 |
+
|
629 |
+
|
630 |
+
forval ii = `start'(`bin_l')0 {
|
631 |
+
if `ii' < -`bin_l' {
|
632 |
+
local jj = abs(`ii')
|
633 |
+
local zz = `jj' - `bin_l' + 1
|
634 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
635 |
+
forval ee = 1/9 {
|
636 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
637 |
+
}
|
638 |
+
}
|
639 |
+
}
|
640 |
+
*
|
641 |
+
local jj = abs(`start')
|
642 |
+
g TRUMP_PRE_M`jj' = 0
|
643 |
+
forval ii = 1/9 {
|
644 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
645 |
+
}
|
646 |
+
|
647 |
+
***number of counties 1,478
|
648 |
+
qui: {
|
649 |
+
forval ii = 1/1478 {
|
650 |
+
su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
651 |
+
if r(N) != 0 {
|
652 |
+
total n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
653 |
+
global stops`ii' = _b[n_stops]
|
654 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
655 |
+
}
|
656 |
+
}
|
657 |
+
}
|
658 |
+
*** Drop the first for collinearity
|
659 |
+
drop TREATED_COUNTY_9
|
660 |
+
|
661 |
+
reghdfe black_ps 1.TRUMP_POST_91_105 1.TRUMP_POST_91_105#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
662 |
+
|
663 |
+
|
664 |
+
mat treat = 999* J(1478,2,1)
|
665 |
+
|
666 |
+
local numerator = 0
|
667 |
+
local denominator = 0
|
668 |
+
forval ii = 1/1478 {
|
669 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
670 |
+
if r(N) != 0 {
|
671 |
+
if `ii' == 9{
|
672 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105])
|
673 |
+
mat treat[`ii',2] = (${stops`ii'})
|
674 |
+
}
|
675 |
+
else {
|
676 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105] + _b[1.TRUMP_POST_91_105#1.TREATED_COUNTY_`ii'])
|
677 |
+
mat treat[`ii',2] = (${stops`ii'})
|
678 |
+
}
|
679 |
+
}
|
680 |
+
}
|
681 |
+
|
682 |
+
g yy = treat[_n,1] in 1/1478
|
683 |
+
g ww = treat[_n,2] in 1/1478
|
684 |
+
replace yy = . if yy==999
|
685 |
+
replace ww = . if ww==999
|
686 |
+
|
687 |
+
|
688 |
+
|
689 |
+
keep yy ww
|
690 |
+
|
691 |
+
g county_id = _n
|
692 |
+
drop if county_id > 1478
|
693 |
+
|
694 |
+
|
695 |
+
save "Results\SA_TRUMP_POST_91_105_TE.dta", replace
|
696 |
+
|
697 |
+
|
698 |
+
************************************************************************************************************************************
|
699 |
+
|
700 |
+
use "Data\stoplevel_data.dta", clear
|
701 |
+
|
702 |
+
g n_stops = 1
|
703 |
+
foreach var of varlist black hispanic white api {
|
704 |
+
replace `var' = `var'/100
|
705 |
+
}
|
706 |
+
|
707 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
708 |
+
|
709 |
+
g black_ps = black / n_stops
|
710 |
+
keep if year==2015 | year==2016 | year==2017
|
711 |
+
|
712 |
+
local start = -105
|
713 |
+
local end = 105
|
714 |
+
local bin_l = 15
|
715 |
+
|
716 |
+
forval ii = 1/9 {
|
717 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
718 |
+
}
|
719 |
+
*
|
720 |
+
|
721 |
+
|
722 |
+
g TRUMP_0 = 0
|
723 |
+
forval ii = 1/9 {
|
724 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
725 |
+
}
|
726 |
+
|
727 |
+
|
728 |
+
forval ii = 1(`bin_l')`end'{
|
729 |
+
local jj = `ii' + `bin_l' - 1
|
730 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
731 |
+
forval ee = 1/9 {
|
732 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
733 |
+
}
|
734 |
+
}
|
735 |
+
g TRUMP_POST_M`end' = 0
|
736 |
+
forval ii = 1/9 {
|
737 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
738 |
+
}
|
739 |
+
*
|
740 |
+
|
741 |
+
|
742 |
+
forval ii = `start'(`bin_l')0 {
|
743 |
+
if `ii' < -`bin_l' {
|
744 |
+
local jj = abs(`ii')
|
745 |
+
local zz = `jj' - `bin_l' + 1
|
746 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
747 |
+
forval ee = 1/9 {
|
748 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
749 |
+
}
|
750 |
+
}
|
751 |
+
}
|
752 |
+
*
|
753 |
+
local jj = abs(`start')
|
754 |
+
g TRUMP_PRE_M`jj' = 0
|
755 |
+
forval ii = 1/9 {
|
756 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
757 |
+
}
|
758 |
+
|
759 |
+
***number of counties 1,478
|
760 |
+
qui: {
|
761 |
+
forval ii = 1/1478 {
|
762 |
+
su n_stops if county_id==`ii' & TRUMP_0==1
|
763 |
+
if r(N) != 0 {
|
764 |
+
total n_stops if county_id==`ii' & TRUMP_0==1
|
765 |
+
global stops`ii' = _b[n_stops]
|
766 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
767 |
+
}
|
768 |
+
}
|
769 |
+
}
|
770 |
+
*** Drop the first for collinearity
|
771 |
+
drop TREATED_COUNTY_9
|
772 |
+
|
773 |
+
|
774 |
+
reghdfe black_ps 1.TRUMP_0 1.TRUMP_0#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
775 |
+
|
776 |
+
|
777 |
+
mat treat = 999* J(1478,2,1)
|
778 |
+
|
779 |
+
local numerator = 0
|
780 |
+
local denominator = 0
|
781 |
+
forval ii = 1/1478 {
|
782 |
+
qui: su n_stops if county_id==`ii' & TRUMP_0==1
|
783 |
+
if r(N) != 0 {
|
784 |
+
if `ii' == 9{
|
785 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0])
|
786 |
+
mat treat[`ii',2] = (${stops`ii'})
|
787 |
+
}
|
788 |
+
else {
|
789 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0] + _b[1.TRUMP_0#1.TREATED_COUNTY_`ii'])
|
790 |
+
mat treat[`ii',2] = (${stops`ii'})
|
791 |
+
}
|
792 |
+
}
|
793 |
+
}
|
794 |
+
|
795 |
+
g yy = treat[_n,1] in 1/1478
|
796 |
+
g ww = treat[_n,2] in 1/1478
|
797 |
+
replace yy = . if yy==999
|
798 |
+
replace ww = . if ww==999
|
799 |
+
|
800 |
+
|
801 |
+
|
802 |
+
keep yy ww
|
803 |
+
|
804 |
+
g county_id = _n
|
805 |
+
drop if county_id > 1478
|
806 |
+
|
807 |
+
|
808 |
+
save "Results\SA_TRUMP_0_TE.dta", replace
|
809 |
+
|
810 |
+
************************************************************************************************************************************
|
811 |
+
|
812 |
+
use "Data\stoplevel_data.dta", clear
|
813 |
+
|
814 |
+
g n_stops = 1
|
815 |
+
foreach var of varlist black hispanic white api {
|
816 |
+
replace `var' = `var'/100
|
817 |
+
}
|
818 |
+
|
819 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
820 |
+
|
821 |
+
g black_ps = black / n_stops
|
822 |
+
keep if year==2015 | year==2016 | year==2017
|
823 |
+
|
824 |
+
local start = -105
|
825 |
+
local end = 105
|
826 |
+
local bin_l = 15
|
827 |
+
|
828 |
+
g TRUMP_0 = 0
|
829 |
+
forval ii = 1/9 {
|
830 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
831 |
+
}
|
832 |
+
|
833 |
+
|
834 |
+
forval ii = 1(`bin_l')`end'{
|
835 |
+
local jj = `ii' + `bin_l' - 1
|
836 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
837 |
+
forval ee = 1/9 {
|
838 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
839 |
+
}
|
840 |
+
}
|
841 |
+
g TRUMP_POST_M`end' = 0
|
842 |
+
forval ii = 1/9 {
|
843 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
844 |
+
}
|
845 |
+
*
|
846 |
+
|
847 |
+
|
848 |
+
forval ii = `start'(`bin_l')0 {
|
849 |
+
if `ii' < -`bin_l' {
|
850 |
+
local jj = abs(`ii')
|
851 |
+
local zz = `jj' - `bin_l' + 1
|
852 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
853 |
+
forval ee = 1/9 {
|
854 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
855 |
+
}
|
856 |
+
}
|
857 |
+
}
|
858 |
+
*
|
859 |
+
local jj = abs(`start')
|
860 |
+
g TRUMP_PRE_M`jj' = 0
|
861 |
+
forval ii = 1/9 {
|
862 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
863 |
+
}
|
864 |
+
|
865 |
+
***number of counties 1,478
|
866 |
+
qui: {
|
867 |
+
forval ii = 1/1478 {
|
868 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
869 |
+
if r(N) != 0 {
|
870 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
871 |
+
global stops`ii' = _b[n_stops]
|
872 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
873 |
+
}
|
874 |
+
}
|
875 |
+
}
|
876 |
+
*** Drop the first for collinearity
|
877 |
+
drop TREATED_COUNTY_9
|
878 |
+
|
879 |
+
|
880 |
+
reghdfe black_ps 1.TRUMP_PRE_30_16 1.TRUMP_PRE_30_16#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_M105) cluster(county_id day_id)
|
881 |
+
|
882 |
+
|
883 |
+
mat treat = 999* J(1478,2,1)
|
884 |
+
|
885 |
+
local numerator = 0
|
886 |
+
local denominator = 0
|
887 |
+
forval ii = 1/1478 {
|
888 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
889 |
+
if r(N) != 0 {
|
890 |
+
if `ii' == 9{
|
891 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16])
|
892 |
+
mat treat[`ii',2] = (${stops`ii'})
|
893 |
+
}
|
894 |
+
else {
|
895 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16] + _b[1.TRUMP_PRE_30_16#1.TREATED_COUNTY_`ii'])
|
896 |
+
mat treat[`ii',2] = (${stops`ii'})
|
897 |
+
}
|
898 |
+
}
|
899 |
+
}
|
900 |
+
|
901 |
+
g yy = treat[_n,1] in 1/1478
|
902 |
+
g ww = treat[_n,2] in 1/1478
|
903 |
+
replace yy = . if yy==999
|
904 |
+
replace ww = . if ww==999
|
905 |
+
|
906 |
+
keep yy ww
|
907 |
+
|
908 |
+
g county_id = _n
|
909 |
+
drop if county_id > 1478
|
910 |
+
|
911 |
+
save "Results\SA_TRUMP_PRE_30_16_TE.dta", replace
|
912 |
+
|
913 |
+
************************************************************************************************************************************
|
914 |
+
|
915 |
+
use "Data\stoplevel_data.dta", clear
|
916 |
+
|
917 |
+
g n_stops = 1
|
918 |
+
foreach var of varlist black hispanic white api {
|
919 |
+
replace `var' = `var'/100
|
920 |
+
}
|
921 |
+
|
922 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
923 |
+
|
924 |
+
g black_ps = black / n_stops
|
925 |
+
keep if year==2015 | year==2016 | year==2017
|
926 |
+
|
927 |
+
local start = -105
|
928 |
+
local end = 105
|
929 |
+
local bin_l = 15
|
930 |
+
|
931 |
+
g TRUMP_0 = 0
|
932 |
+
forval ii = 1/9 {
|
933 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
934 |
+
}
|
935 |
+
|
936 |
+
|
937 |
+
forval ii = 1(`bin_l')`end'{
|
938 |
+
local jj = `ii' + `bin_l' - 1
|
939 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
940 |
+
forval ee = 1/9 {
|
941 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
942 |
+
}
|
943 |
+
}
|
944 |
+
g TRUMP_POST_M`end' = 0
|
945 |
+
forval ii = 1/9 {
|
946 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
947 |
+
}
|
948 |
+
*
|
949 |
+
|
950 |
+
forval ii = `start'(`bin_l')0 {
|
951 |
+
if `ii' < -`bin_l' {
|
952 |
+
local jj = abs(`ii')
|
953 |
+
local zz = `jj' - `bin_l' + 1
|
954 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
955 |
+
forval ee = 1/9 {
|
956 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
957 |
+
}
|
958 |
+
}
|
959 |
+
}
|
960 |
+
*
|
961 |
+
local jj = abs(`start')
|
962 |
+
g TRUMP_PRE_M`jj' = 0
|
963 |
+
forval ii = 1/9 {
|
964 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
965 |
+
}
|
966 |
+
|
967 |
+
***number of counties 1,478
|
968 |
+
qui: {
|
969 |
+
forval ii = 1/1478 {
|
970 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
971 |
+
if r(N) != 0 {
|
972 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
973 |
+
global stops`ii' = _b[n_stops]
|
974 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
975 |
+
}
|
976 |
+
}
|
977 |
+
}
|
978 |
+
*** Drop the first for collinearity
|
979 |
+
drop TREATED_COUNTY_9
|
980 |
+
|
981 |
+
reghdfe black_ps 1.TRUMP_PRE_45_31 1.TRUMP_PRE_45_31#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
982 |
+
|
983 |
+
mat treat = 999* J(1478,2,1)
|
984 |
+
|
985 |
+
local numerator = 0
|
986 |
+
local denominator = 0
|
987 |
+
forval ii = 1/1478 {
|
988 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
989 |
+
if r(N) != 0 {
|
990 |
+
if `ii' == 9{
|
991 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31])
|
992 |
+
mat treat[`ii',2] = (${stops`ii'})
|
993 |
+
}
|
994 |
+
else {
|
995 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31] + _b[1.TRUMP_PRE_45_31#1.TREATED_COUNTY_`ii'])
|
996 |
+
mat treat[`ii',2] = (${stops`ii'})
|
997 |
+
}
|
998 |
+
}
|
999 |
+
}
|
1000 |
+
|
1001 |
+
g yy = treat[_n,1] in 1/1478
|
1002 |
+
g ww = treat[_n,2] in 1/1478
|
1003 |
+
replace yy = . if yy==999
|
1004 |
+
replace ww = . if ww==999
|
1005 |
+
|
1006 |
+
keep yy ww
|
1007 |
+
|
1008 |
+
g county_id = _n
|
1009 |
+
drop if county_id > 1478
|
1010 |
+
|
1011 |
+
save "Results\SA_TRUMP_PRE_45_31_TE.dta", replace
|
1012 |
+
|
1013 |
+
************************************************************************************************************************************
|
1014 |
+
|
1015 |
+
use "Data\stoplevel_data.dta", clear
|
1016 |
+
|
1017 |
+
g n_stops = 1
|
1018 |
+
foreach var of varlist black hispanic white api {
|
1019 |
+
replace `var' = `var'/100
|
1020 |
+
}
|
1021 |
+
|
1022 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1023 |
+
|
1024 |
+
g black_ps = black / n_stops
|
1025 |
+
keep if year==2015 | year==2016 | year==2017
|
1026 |
+
|
1027 |
+
local start = -105
|
1028 |
+
local end = 105
|
1029 |
+
local bin_l = 15
|
1030 |
+
|
1031 |
+
g TRUMP_0 = 0
|
1032 |
+
forval ii = 1/9 {
|
1033 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1034 |
+
}
|
1035 |
+
|
1036 |
+
|
1037 |
+
forval ii = 1(`bin_l')`end'{
|
1038 |
+
local jj = `ii' + `bin_l' - 1
|
1039 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1040 |
+
forval ee = 1/9 {
|
1041 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1042 |
+
}
|
1043 |
+
}
|
1044 |
+
g TRUMP_POST_M`end' = 0
|
1045 |
+
forval ii = 1/9 {
|
1046 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1047 |
+
}
|
1048 |
+
*
|
1049 |
+
|
1050 |
+
|
1051 |
+
forval ii = `start'(`bin_l')0 {
|
1052 |
+
if `ii' < -`bin_l' {
|
1053 |
+
local jj = abs(`ii')
|
1054 |
+
local zz = `jj' - `bin_l' + 1
|
1055 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1056 |
+
forval ee = 1/9 {
|
1057 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1058 |
+
}
|
1059 |
+
}
|
1060 |
+
}
|
1061 |
+
*
|
1062 |
+
local jj = abs(`start')
|
1063 |
+
g TRUMP_PRE_M`jj' = 0
|
1064 |
+
forval ii = 1/9 {
|
1065 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1066 |
+
}
|
1067 |
+
|
1068 |
+
***number of counties 1,478
|
1069 |
+
qui: {
|
1070 |
+
forval ii = 1/1478 {
|
1071 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1072 |
+
if r(N) != 0 {
|
1073 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1074 |
+
global stops`ii' = _b[n_stops]
|
1075 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1076 |
+
}
|
1077 |
+
}
|
1078 |
+
}
|
1079 |
+
*** Drop the first for collinearity
|
1080 |
+
drop TREATED_COUNTY_9
|
1081 |
+
|
1082 |
+
reghdfe black_ps 1.TRUMP_PRE_60_46 1.TRUMP_PRE_60_46#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1083 |
+
|
1084 |
+
|
1085 |
+
mat treat = 999* J(1478,2,1)
|
1086 |
+
|
1087 |
+
local numerator = 0
|
1088 |
+
local denominator = 0
|
1089 |
+
forval ii = 1/1478 {
|
1090 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1091 |
+
if r(N) != 0 {
|
1092 |
+
if `ii' == 9{
|
1093 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46])
|
1094 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1095 |
+
}
|
1096 |
+
else {
|
1097 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46] + _b[1.TRUMP_PRE_60_46#1.TREATED_COUNTY_`ii'])
|
1098 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1099 |
+
}
|
1100 |
+
}
|
1101 |
+
}
|
1102 |
+
|
1103 |
+
g yy = treat[_n,1] in 1/1478
|
1104 |
+
g ww = treat[_n,2] in 1/1478
|
1105 |
+
replace yy = . if yy==999
|
1106 |
+
replace ww = . if ww==999
|
1107 |
+
|
1108 |
+
keep yy ww
|
1109 |
+
|
1110 |
+
g county_id = _n
|
1111 |
+
drop if county_id > 1478
|
1112 |
+
|
1113 |
+
|
1114 |
+
save "Results\SA_TRUMP_PRE_60_46_TE.dta", replace
|
1115 |
+
|
1116 |
+
************************************************************************************************************************************
|
1117 |
+
|
1118 |
+
use "Data\stoplevel_data.dta", clear
|
1119 |
+
|
1120 |
+
g n_stops = 1
|
1121 |
+
foreach var of varlist black hispanic white api {
|
1122 |
+
replace `var' = `var'/100
|
1123 |
+
}
|
1124 |
+
|
1125 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1126 |
+
|
1127 |
+
g black_ps = black / n_stops
|
1128 |
+
keep if year==2015 | year==2016 | year==2017
|
1129 |
+
|
1130 |
+
local start = -105
|
1131 |
+
local end = 105
|
1132 |
+
local bin_l = 15
|
1133 |
+
|
1134 |
+
g TRUMP_0 = 0
|
1135 |
+
forval ii = 1/9 {
|
1136 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1137 |
+
}
|
1138 |
+
|
1139 |
+
|
1140 |
+
forval ii = 1(`bin_l')`end'{
|
1141 |
+
local jj = `ii' + `bin_l' - 1
|
1142 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1143 |
+
forval ee = 1/9 {
|
1144 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1145 |
+
}
|
1146 |
+
}
|
1147 |
+
g TRUMP_POST_M`end' = 0
|
1148 |
+
forval ii = 1/9 {
|
1149 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1150 |
+
}
|
1151 |
+
*
|
1152 |
+
|
1153 |
+
|
1154 |
+
forval ii = `start'(`bin_l')0 {
|
1155 |
+
if `ii' < -`bin_l' {
|
1156 |
+
local jj = abs(`ii')
|
1157 |
+
local zz = `jj' - `bin_l' + 1
|
1158 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1159 |
+
forval ee = 1/9 {
|
1160 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1161 |
+
}
|
1162 |
+
}
|
1163 |
+
}
|
1164 |
+
*
|
1165 |
+
local jj = abs(`start')
|
1166 |
+
g TRUMP_PRE_M`jj' = 0
|
1167 |
+
forval ii = 1/9 {
|
1168 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1169 |
+
}
|
1170 |
+
|
1171 |
+
***number of counties 1,478
|
1172 |
+
qui: {
|
1173 |
+
forval ii = 1/1478 {
|
1174 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1175 |
+
if r(N) != 0 {
|
1176 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1177 |
+
global stops`ii' = _b[n_stops]
|
1178 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1179 |
+
}
|
1180 |
+
}
|
1181 |
+
}
|
1182 |
+
*** Drop the first for collinearity
|
1183 |
+
drop TREATED_COUNTY_9
|
1184 |
+
|
1185 |
+
reghdfe black_ps 1.TRUMP_PRE_75_61 1.TRUMP_PRE_75_61#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1186 |
+
|
1187 |
+
mat treat = 999* J(1478,2,1)
|
1188 |
+
|
1189 |
+
local numerator = 0
|
1190 |
+
local denominator = 0
|
1191 |
+
forval ii = 1/1478 {
|
1192 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1193 |
+
if r(N) != 0 {
|
1194 |
+
if `ii' == 9{
|
1195 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61])
|
1196 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1197 |
+
}
|
1198 |
+
else {
|
1199 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61] + _b[1.TRUMP_PRE_75_61#1.TREATED_COUNTY_`ii'])
|
1200 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1201 |
+
}
|
1202 |
+
}
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
g yy = treat[_n,1] in 1/1478
|
1206 |
+
g ww = treat[_n,2] in 1/1478
|
1207 |
+
replace yy = . if yy==999
|
1208 |
+
replace ww = . if ww==999
|
1209 |
+
|
1210 |
+
keep yy ww
|
1211 |
+
|
1212 |
+
g county_id = _n
|
1213 |
+
drop if county_id > 1478
|
1214 |
+
|
1215 |
+
save "Results\SA_TRUMP_PRE_75_61_TE.dta", replace
|
1216 |
+
|
1217 |
+
************************************************************************************************************************************
|
1218 |
+
|
1219 |
+
use "Data\stoplevel_data.dta", clear
|
1220 |
+
|
1221 |
+
g n_stops = 1
|
1222 |
+
foreach var of varlist black hispanic white api {
|
1223 |
+
replace `var' = `var'/100
|
1224 |
+
}
|
1225 |
+
|
1226 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1227 |
+
|
1228 |
+
g black_ps = black / n_stops
|
1229 |
+
keep if year==2015 | year==2016 | year==2017
|
1230 |
+
|
1231 |
+
local start = -105
|
1232 |
+
local end = 105
|
1233 |
+
local bin_l = 15
|
1234 |
+
|
1235 |
+
g TRUMP_0 = 0
|
1236 |
+
forval ii = 1/9 {
|
1237 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
|
1241 |
+
forval ii = 1(`bin_l')`end'{
|
1242 |
+
local jj = `ii' + `bin_l' - 1
|
1243 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1244 |
+
forval ee = 1/9 {
|
1245 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1246 |
+
}
|
1247 |
+
}
|
1248 |
+
g TRUMP_POST_M`end' = 0
|
1249 |
+
forval ii = 1/9 {
|
1250 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1251 |
+
}
|
1252 |
+
*
|
1253 |
+
|
1254 |
+
|
1255 |
+
forval ii = `start'(`bin_l')0 {
|
1256 |
+
if `ii' < -`bin_l' {
|
1257 |
+
local jj = abs(`ii')
|
1258 |
+
local zz = `jj' - `bin_l' + 1
|
1259 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1260 |
+
forval ee = 1/9 {
|
1261 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1262 |
+
}
|
1263 |
+
}
|
1264 |
+
}
|
1265 |
+
*
|
1266 |
+
local jj = abs(`start')
|
1267 |
+
g TRUMP_PRE_M`jj' = 0
|
1268 |
+
forval ii = 1/9 {
|
1269 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1270 |
+
}
|
1271 |
+
|
1272 |
+
***number of counties 1,478
|
1273 |
+
qui: {
|
1274 |
+
forval ii = 1/1478 {
|
1275 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1276 |
+
if r(N) != 0 {
|
1277 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1278 |
+
global stops`ii' = _b[n_stops]
|
1279 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1280 |
+
}
|
1281 |
+
}
|
1282 |
+
}
|
1283 |
+
*** Drop the first for collinearity
|
1284 |
+
drop TREATED_COUNTY_9
|
1285 |
+
|
1286 |
+
reghdfe black_ps 1.TRUMP_PRE_90_76 1.TRUMP_PRE_90_76#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1287 |
+
|
1288 |
+
|
1289 |
+
mat treat = 999* J(1478,2,1)
|
1290 |
+
|
1291 |
+
local numerator = 0
|
1292 |
+
local denominator = 0
|
1293 |
+
forval ii = 1/1478 {
|
1294 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1295 |
+
if r(N) != 0 {
|
1296 |
+
if `ii' == 9{
|
1297 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76])
|
1298 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1299 |
+
}
|
1300 |
+
else {
|
1301 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76] + _b[1.TRUMP_PRE_90_76#1.TREATED_COUNTY_`ii'])
|
1302 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1303 |
+
}
|
1304 |
+
}
|
1305 |
+
}
|
1306 |
+
|
1307 |
+
g yy = treat[_n,1] in 1/1478
|
1308 |
+
g ww = treat[_n,2] in 1/1478
|
1309 |
+
replace yy = . if yy==999
|
1310 |
+
replace ww = . if ww==999
|
1311 |
+
|
1312 |
+
keep yy ww
|
1313 |
+
|
1314 |
+
g county_id = _n
|
1315 |
+
drop if county_id > 1478
|
1316 |
+
|
1317 |
+
|
1318 |
+
save "Results\SA_TRUMP_PRE_90_76_TE.dta", replace
|
1319 |
+
|
1320 |
+
************************************************************************************************************************************
|
1321 |
+
|
1322 |
+
use "Data\stoplevel_data.dta", clear
|
1323 |
+
|
1324 |
+
g n_stops = 1
|
1325 |
+
foreach var of varlist black hispanic white api {
|
1326 |
+
replace `var' = `var'/100
|
1327 |
+
}
|
1328 |
+
|
1329 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1330 |
+
|
1331 |
+
g black_ps = black / n_stops
|
1332 |
+
keep if year==2015 | year==2016 | year==2017
|
1333 |
+
|
1334 |
+
local start = -105
|
1335 |
+
local end = 105
|
1336 |
+
local bin_l = 15
|
1337 |
+
|
1338 |
+
g TRUMP_0 = 0
|
1339 |
+
forval ii = 1/9 {
|
1340 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1341 |
+
}
|
1342 |
+
|
1343 |
+
|
1344 |
+
forval ii = 1(`bin_l')`end'{
|
1345 |
+
local jj = `ii' + `bin_l' - 1
|
1346 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1347 |
+
forval ee = 1/9 {
|
1348 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1349 |
+
}
|
1350 |
+
}
|
1351 |
+
g TRUMP_POST_M`end' = 0
|
1352 |
+
forval ii = 1/9 {
|
1353 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1354 |
+
}
|
1355 |
+
*
|
1356 |
+
|
1357 |
+
|
1358 |
+
forval ii = `start'(`bin_l')0 {
|
1359 |
+
if `ii' < -`bin_l' {
|
1360 |
+
local jj = abs(`ii')
|
1361 |
+
local zz = `jj' - `bin_l' + 1
|
1362 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1363 |
+
forval ee = 1/9 {
|
1364 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1365 |
+
}
|
1366 |
+
}
|
1367 |
+
}
|
1368 |
+
*
|
1369 |
+
local jj = abs(`start')
|
1370 |
+
g TRUMP_PRE_M`jj' = 0
|
1371 |
+
forval ii = 1/9 {
|
1372 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1373 |
+
}
|
1374 |
+
|
1375 |
+
***number of counties 1,478
|
1376 |
+
qui: {
|
1377 |
+
forval ii = 1/1478 {
|
1378 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1379 |
+
if r(N) != 0 {
|
1380 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1381 |
+
global stops`ii' = _b[n_stops]
|
1382 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1383 |
+
}
|
1384 |
+
}
|
1385 |
+
}
|
1386 |
+
*** Drop the first for collinearity
|
1387 |
+
drop TREATED_COUNTY_9
|
1388 |
+
|
1389 |
+
reghdfe black_ps 1.TRUMP_PRE_105_91 1.TRUMP_PRE_105_91#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1390 |
+
|
1391 |
+
mat treat = 999* J(1478,2,1)
|
1392 |
+
|
1393 |
+
local numerator = 0
|
1394 |
+
local denominator = 0
|
1395 |
+
forval ii = 1/1478 {
|
1396 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1397 |
+
if r(N) != 0 {
|
1398 |
+
if `ii' == 9{
|
1399 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91])
|
1400 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1401 |
+
}
|
1402 |
+
else {
|
1403 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91] + _b[1.TRUMP_PRE_105_91#1.TREATED_COUNTY_`ii'])
|
1404 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1405 |
+
}
|
1406 |
+
}
|
1407 |
+
}
|
1408 |
+
|
1409 |
+
g yy = treat[_n,1] in 1/1478
|
1410 |
+
g ww = treat[_n,2] in 1/1478
|
1411 |
+
replace yy = . if yy==999
|
1412 |
+
replace ww = . if ww==999
|
1413 |
+
|
1414 |
+
keep yy ww
|
1415 |
+
|
1416 |
+
g county_id = _n
|
1417 |
+
drop if county_id > 1478
|
1418 |
+
|
1419 |
+
save "Results\SA_TRUMP_PRE_105_91_TE.dta", replace
|
1420 |
+
|
1421 |
+
|
1422 |
+
|
1423 |
+
******************************************************************************************************************************************************************************************************************
|
1424 |
+
|
1425 |
+
use "Data\stoplevel_data.dta", clear
|
1426 |
+
|
1427 |
+
g n_stops = 1
|
1428 |
+
foreach var of varlist black hispanic white api {
|
1429 |
+
replace `var' = `var'/100
|
1430 |
+
}
|
1431 |
+
|
1432 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1433 |
+
|
1434 |
+
g black_ps = black / n_stops
|
1435 |
+
keep if year==2015 | year==2016 | year==2017
|
1436 |
+
|
1437 |
+
local start = -105
|
1438 |
+
local end = 105
|
1439 |
+
local bin_l = 15
|
1440 |
+
|
1441 |
+
g TRUMP_0 = 0
|
1442 |
+
forval ii = 1/9 {
|
1443 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
forval ii = 1(`bin_l')`end'{
|
1447 |
+
local jj = `ii' + `bin_l' - 1
|
1448 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1449 |
+
forval ee = 1/9 {
|
1450 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1451 |
+
}
|
1452 |
+
}
|
1453 |
+
g TRUMP_POST_M`end' = 0
|
1454 |
+
forval ii = 1/9 {
|
1455 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1456 |
+
}
|
1457 |
+
*
|
1458 |
+
|
1459 |
+
forval ii = `start'(`bin_l')0 {
|
1460 |
+
if `ii' < -`bin_l' {
|
1461 |
+
local jj = abs(`ii')
|
1462 |
+
local zz = `jj' - `bin_l' + 1
|
1463 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1464 |
+
forval ee = 1/9 {
|
1465 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1466 |
+
}
|
1467 |
+
}
|
1468 |
+
}
|
1469 |
+
*
|
1470 |
+
local jj = abs(`start')
|
1471 |
+
g TRUMP_PRE_M`jj' = 0
|
1472 |
+
forval ii = 1/9 {
|
1473 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
***number of counties 1,478
|
1477 |
+
qui: {
|
1478 |
+
forval ii = 1/1478 {
|
1479 |
+
su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1480 |
+
if r(N) != 0 {
|
1481 |
+
total n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1482 |
+
global stops`ii' = _b[n_stops]
|
1483 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1484 |
+
}
|
1485 |
+
}
|
1486 |
+
}
|
1487 |
+
*** Drop the first for collinearity
|
1488 |
+
drop TREATED_COUNTY_9
|
1489 |
+
|
1490 |
+
reghdfe black_ps 1.TRUMP_POST_1_15 1.TRUMP_POST_1_15#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1491 |
+
|
1492 |
+
mat treat = 999* J(1478,2,1)
|
1493 |
+
|
1494 |
+
local numerator = 0
|
1495 |
+
local denominator = 0
|
1496 |
+
forval ii = 1/1478 {
|
1497 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1498 |
+
if r(N) != 0 {
|
1499 |
+
if `ii' == 9{
|
1500 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15])
|
1501 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1502 |
+
}
|
1503 |
+
else {
|
1504 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15] + _b[1.TRUMP_POST_1_15#1.TREATED_COUNTY_`ii'])
|
1505 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1506 |
+
}
|
1507 |
+
}
|
1508 |
+
}
|
1509 |
+
|
1510 |
+
g yy = treat[_n,1] in 1/1478
|
1511 |
+
g ww = treat[_n,2] in 1/1478
|
1512 |
+
replace yy = . if yy==999
|
1513 |
+
replace ww = . if ww==999
|
1514 |
+
|
1515 |
+
keep yy ww
|
1516 |
+
|
1517 |
+
g county_id = _n
|
1518 |
+
drop if county_id > 1478
|
1519 |
+
|
1520 |
+
save "Results\SA_TRUMP_POST_1_15_TE_NT.dta", replace
|
1521 |
+
|
1522 |
+
************************************************************************************************************************************
|
1523 |
+
use "Data\stoplevel_data.dta", clear
|
1524 |
+
|
1525 |
+
g n_stops = 1
|
1526 |
+
foreach var of varlist black hispanic white api {
|
1527 |
+
replace `var' = `var'/100
|
1528 |
+
}
|
1529 |
+
|
1530 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1531 |
+
|
1532 |
+
g black_ps = black / n_stops
|
1533 |
+
keep if year==2015 | year==2016 | year==2017
|
1534 |
+
|
1535 |
+
local start = -105
|
1536 |
+
local end = 105
|
1537 |
+
local bin_l = 15
|
1538 |
+
|
1539 |
+
g TRUMP_0 = 0
|
1540 |
+
forval ii = 1/9 {
|
1541 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1542 |
+
}
|
1543 |
+
|
1544 |
+
forval ii = 1(`bin_l')`end'{
|
1545 |
+
local jj = `ii' + `bin_l' - 1
|
1546 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1547 |
+
forval ee = 1/9 {
|
1548 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1549 |
+
}
|
1550 |
+
}
|
1551 |
+
g TRUMP_POST_M`end' = 0
|
1552 |
+
forval ii = 1/9 {
|
1553 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1554 |
+
}
|
1555 |
+
*
|
1556 |
+
|
1557 |
+
forval ii = `start'(`bin_l')0 {
|
1558 |
+
if `ii' < -`bin_l' {
|
1559 |
+
local jj = abs(`ii')
|
1560 |
+
local zz = `jj' - `bin_l' + 1
|
1561 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1562 |
+
forval ee = 1/9 {
|
1563 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1564 |
+
}
|
1565 |
+
}
|
1566 |
+
}
|
1567 |
+
*
|
1568 |
+
local jj = abs(`start')
|
1569 |
+
g TRUMP_PRE_M`jj' = 0
|
1570 |
+
forval ii = 1/9 {
|
1571 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1572 |
+
}
|
1573 |
+
|
1574 |
+
***number of counties 1,478
|
1575 |
+
qui: {
|
1576 |
+
forval ii = 1/1478 {
|
1577 |
+
su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1578 |
+
if r(N) != 0 {
|
1579 |
+
total n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1580 |
+
global stops`ii' = _b[n_stops]
|
1581 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1582 |
+
}
|
1583 |
+
}
|
1584 |
+
}
|
1585 |
+
*** Drop the first for collinearity
|
1586 |
+
drop TREATED_COUNTY_9
|
1587 |
+
|
1588 |
+
reghdfe black_ps 1.TRUMP_POST_16_30 1.TRUMP_POST_16_30#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1589 |
+
|
1590 |
+
mat treat = 999* J(1478,2,1)
|
1591 |
+
|
1592 |
+
local numerator = 0
|
1593 |
+
local denominator = 0
|
1594 |
+
forval ii = 1/1478 {
|
1595 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1596 |
+
if r(N) != 0 {
|
1597 |
+
if `ii' == 9{
|
1598 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30])
|
1599 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1600 |
+
}
|
1601 |
+
else {
|
1602 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30] + _b[1.TRUMP_POST_16_30#1.TREATED_COUNTY_`ii'])
|
1603 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1604 |
+
}
|
1605 |
+
}
|
1606 |
+
}
|
1607 |
+
|
1608 |
+
g yy = treat[_n,1] in 1/1478
|
1609 |
+
g ww = treat[_n,2] in 1/1478
|
1610 |
+
replace yy = . if yy==999
|
1611 |
+
replace ww = . if ww==999
|
1612 |
+
|
1613 |
+
keep yy ww
|
1614 |
+
|
1615 |
+
g county_id = _n
|
1616 |
+
drop if county_id > 1478
|
1617 |
+
|
1618 |
+
save "Results\SA_TRUMP_POST_16_30_TE_NT.dta", replace
|
1619 |
+
|
1620 |
+
************************************************************************************************************************************
|
1621 |
+
use "data\Jack Police\full_dataset_CD.dta", clear
|
1622 |
+
|
1623 |
+
g black_ps = black / n_stops
|
1624 |
+
keep if year==2015 | year==2016 | year==2017
|
1625 |
+
|
1626 |
+
local start = -105
|
1627 |
+
local end = 105
|
1628 |
+
local bin_l = 15
|
1629 |
+
|
1630 |
+
g TRUMP_0 = 0
|
1631 |
+
forval ii = 1/9 {
|
1632 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1633 |
+
}
|
1634 |
+
|
1635 |
+
|
1636 |
+
forval ii = 1(`bin_l')`end'{
|
1637 |
+
local jj = `ii' + `bin_l' - 1
|
1638 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1639 |
+
forval ee = 1/9 {
|
1640 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1641 |
+
}
|
1642 |
+
}
|
1643 |
+
g TRUMP_POST_M`end' = 0
|
1644 |
+
forval ii = 1/9 {
|
1645 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1646 |
+
}
|
1647 |
+
*
|
1648 |
+
|
1649 |
+
forval ii = `start'(`bin_l')0 {
|
1650 |
+
if `ii' < -`bin_l' {
|
1651 |
+
local jj = abs(`ii')
|
1652 |
+
local zz = `jj' - `bin_l' + 1
|
1653 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1654 |
+
forval ee = 1/9 {
|
1655 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1656 |
+
}
|
1657 |
+
}
|
1658 |
+
}
|
1659 |
+
*
|
1660 |
+
local jj = abs(`start')
|
1661 |
+
g TRUMP_PRE_M`jj' = 0
|
1662 |
+
forval ii = 1/9 {
|
1663 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1664 |
+
}
|
1665 |
+
|
1666 |
+
***number of counties 1,478
|
1667 |
+
qui: {
|
1668 |
+
forval ii = 1/1478 {
|
1669 |
+
su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1670 |
+
if r(N) != 0 {
|
1671 |
+
total n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1672 |
+
global stops`ii' = _b[n_stops]
|
1673 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1674 |
+
}
|
1675 |
+
}
|
1676 |
+
}
|
1677 |
+
*** Drop the first for collinearity
|
1678 |
+
drop TREATED_COUNTY_9
|
1679 |
+
|
1680 |
+
reghdfe black_ps 1.TRUMP_POST_31_45 1.TRUMP_POST_31_45#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1681 |
+
|
1682 |
+
mat treat = 999* J(1478,2,1)
|
1683 |
+
|
1684 |
+
local numerator = 0
|
1685 |
+
local denominator = 0
|
1686 |
+
forval ii = 1/1478 {
|
1687 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1688 |
+
if r(N) != 0 {
|
1689 |
+
if `ii' == 9{
|
1690 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45])
|
1691 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1692 |
+
}
|
1693 |
+
else {
|
1694 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45] + _b[1.TRUMP_POST_31_45#1.TREATED_COUNTY_`ii'])
|
1695 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1696 |
+
}
|
1697 |
+
}
|
1698 |
+
}
|
1699 |
+
|
1700 |
+
g yy = treat[_n,1] in 1/1478
|
1701 |
+
g ww = treat[_n,2] in 1/1478
|
1702 |
+
replace yy = . if yy==999
|
1703 |
+
replace ww = . if ww==999
|
1704 |
+
|
1705 |
+
keep yy ww
|
1706 |
+
|
1707 |
+
g county_id = _n
|
1708 |
+
drop if county_id > 1478
|
1709 |
+
|
1710 |
+
save "Results\SA_TRUMP_POST_31_45_TE_NT.dta", replace
|
1711 |
+
|
1712 |
+
************************************************************************************************************************************
|
1713 |
+
use "Data\stoplevel_data.dta", clear
|
1714 |
+
|
1715 |
+
g n_stops = 1
|
1716 |
+
foreach var of varlist black hispanic white api {
|
1717 |
+
replace `var' = `var'/100
|
1718 |
+
}
|
1719 |
+
|
1720 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1721 |
+
|
1722 |
+
g black_ps = black / n_stops
|
1723 |
+
keep if year==2015 | year==2016 | year==2017
|
1724 |
+
|
1725 |
+
local start = -105
|
1726 |
+
local end = 105
|
1727 |
+
local bin_l = 15
|
1728 |
+
|
1729 |
+
g TRUMP_0 = 0
|
1730 |
+
forval ii = 1/9 {
|
1731 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1732 |
+
}
|
1733 |
+
|
1734 |
+
forval ii = 1(`bin_l')`end'{
|
1735 |
+
local jj = `ii' + `bin_l' - 1
|
1736 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1737 |
+
forval ee = 1/9 {
|
1738 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1739 |
+
}
|
1740 |
+
}
|
1741 |
+
g TRUMP_POST_M`end' = 0
|
1742 |
+
forval ii = 1/9 {
|
1743 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1744 |
+
}
|
1745 |
+
*
|
1746 |
+
|
1747 |
+
forval ii = `start'(`bin_l')0 {
|
1748 |
+
if `ii' < -`bin_l' {
|
1749 |
+
local jj = abs(`ii')
|
1750 |
+
local zz = `jj' - `bin_l' + 1
|
1751 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1752 |
+
forval ee = 1/9 {
|
1753 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1754 |
+
}
|
1755 |
+
}
|
1756 |
+
}
|
1757 |
+
*
|
1758 |
+
local jj = abs(`start')
|
1759 |
+
g TRUMP_PRE_M`jj' = 0
|
1760 |
+
forval ii = 1/9 {
|
1761 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1762 |
+
}
|
1763 |
+
|
1764 |
+
***number of counties 1,478
|
1765 |
+
qui: {
|
1766 |
+
forval ii = 1/1478 {
|
1767 |
+
su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
1768 |
+
if r(N) != 0 {
|
1769 |
+
total n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
1770 |
+
global stops`ii' = _b[n_stops]
|
1771 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1772 |
+
}
|
1773 |
+
}
|
1774 |
+
}
|
1775 |
+
*** Drop the first for collinearity
|
1776 |
+
drop TREATED_COUNTY_9
|
1777 |
+
|
1778 |
+
reghdfe black_ps 1.TRUMP_POST_46_60 1.TRUMP_POST_46_60#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1779 |
+
|
1780 |
+
mat treat = 999* J(1478,2,1)
|
1781 |
+
|
1782 |
+
local numerator = 0
|
1783 |
+
local denominator = 0
|
1784 |
+
forval ii = 1/1478 {
|
1785 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
1786 |
+
if r(N) != 0 {
|
1787 |
+
if `ii' == 9{
|
1788 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60])
|
1789 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1790 |
+
}
|
1791 |
+
else {
|
1792 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60] + _b[1.TRUMP_POST_46_60#1.TREATED_COUNTY_`ii'])
|
1793 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1794 |
+
}
|
1795 |
+
}
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
g yy = treat[_n,1] in 1/1478
|
1799 |
+
g ww = treat[_n,2] in 1/1478
|
1800 |
+
replace yy = . if yy==999
|
1801 |
+
replace ww = . if ww==999
|
1802 |
+
|
1803 |
+
keep yy ww
|
1804 |
+
|
1805 |
+
g county_id = _n
|
1806 |
+
drop if county_id > 1478
|
1807 |
+
|
1808 |
+
save "Results\SA_TRUMP_POST_46_60_TE_NT.dta", replace
|
1809 |
+
|
1810 |
+
************************************************************************************************************************************
|
1811 |
+
|
1812 |
+
use "Data\stoplevel_data.dta", clear
|
1813 |
+
|
1814 |
+
g n_stops = 1
|
1815 |
+
foreach var of varlist black hispanic white api {
|
1816 |
+
replace `var' = `var'/100
|
1817 |
+
}
|
1818 |
+
|
1819 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1820 |
+
|
1821 |
+
g black_ps = black / n_stops
|
1822 |
+
keep if year==2015 | year==2016 | year==2017
|
1823 |
+
|
1824 |
+
local start = -105
|
1825 |
+
local end = 105
|
1826 |
+
local bin_l = 15
|
1827 |
+
|
1828 |
+
g TRUMP_0 = 0
|
1829 |
+
forval ii = 1/9 {
|
1830 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1831 |
+
}
|
1832 |
+
|
1833 |
+
|
1834 |
+
forval ii = 1(`bin_l')`end'{
|
1835 |
+
local jj = `ii' + `bin_l' - 1
|
1836 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1837 |
+
forval ee = 1/9 {
|
1838 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1839 |
+
}
|
1840 |
+
}
|
1841 |
+
g TRUMP_POST_M`end' = 0
|
1842 |
+
forval ii = 1/9 {
|
1843 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1844 |
+
}
|
1845 |
+
*
|
1846 |
+
|
1847 |
+
|
1848 |
+
forval ii = `start'(`bin_l')0 {
|
1849 |
+
if `ii' < -`bin_l' {
|
1850 |
+
local jj = abs(`ii')
|
1851 |
+
local zz = `jj' - `bin_l' + 1
|
1852 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1853 |
+
forval ee = 1/9 {
|
1854 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1855 |
+
}
|
1856 |
+
}
|
1857 |
+
}
|
1858 |
+
*
|
1859 |
+
local jj = abs(`start')
|
1860 |
+
g TRUMP_PRE_M`jj' = 0
|
1861 |
+
forval ii = 1/9 {
|
1862 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1863 |
+
}
|
1864 |
+
|
1865 |
+
***number of counties 1,478
|
1866 |
+
qui: {
|
1867 |
+
forval ii = 1/1478 {
|
1868 |
+
su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
1869 |
+
if r(N) != 0 {
|
1870 |
+
total n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
1871 |
+
global stops`ii' = _b[n_stops]
|
1872 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1873 |
+
}
|
1874 |
+
}
|
1875 |
+
}
|
1876 |
+
*** Drop the first for collinearity
|
1877 |
+
drop TREATED_COUNTY_9
|
1878 |
+
|
1879 |
+
reghdfe black_ps 1.TRUMP_POST_61_75 1.TRUMP_POST_61_75#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1880 |
+
|
1881 |
+
|
1882 |
+
mat treat = 999* J(1478,2,1)
|
1883 |
+
|
1884 |
+
local numerator = 0
|
1885 |
+
local denominator = 0
|
1886 |
+
forval ii = 1/1478 {
|
1887 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
1888 |
+
if r(N) != 0 {
|
1889 |
+
if `ii' == 9{
|
1890 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75])
|
1891 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1892 |
+
}
|
1893 |
+
else {
|
1894 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75] + _b[1.TRUMP_POST_61_75#1.TREATED_COUNTY_`ii'])
|
1895 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1896 |
+
}
|
1897 |
+
}
|
1898 |
+
}
|
1899 |
+
|
1900 |
+
g yy = treat[_n,1] in 1/1478
|
1901 |
+
g ww = treat[_n,2] in 1/1478
|
1902 |
+
replace yy = . if yy==999
|
1903 |
+
replace ww = . if ww==999
|
1904 |
+
|
1905 |
+
keep yy ww
|
1906 |
+
|
1907 |
+
g county_id = _n
|
1908 |
+
drop if county_id > 1478
|
1909 |
+
|
1910 |
+
|
1911 |
+
save "Results\SA_TRUMP_POST_61_75_TE_NT.dta", replace
|
1912 |
+
|
1913 |
+
************************************************************************************************************************************
|
1914 |
+
|
1915 |
+
use "Data\stoplevel_data.dta", clear
|
1916 |
+
|
1917 |
+
g n_stops = 1
|
1918 |
+
foreach var of varlist black hispanic white api {
|
1919 |
+
replace `var' = `var'/100
|
1920 |
+
}
|
1921 |
+
|
1922 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
1923 |
+
|
1924 |
+
g black_ps = black / n_stops
|
1925 |
+
keep if year==2015 | year==2016 | year==2017
|
1926 |
+
|
1927 |
+
local start = -105
|
1928 |
+
local end = 105
|
1929 |
+
local bin_l = 15
|
1930 |
+
|
1931 |
+
g TRUMP_0 = 0
|
1932 |
+
forval ii = 1/9 {
|
1933 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1934 |
+
}
|
1935 |
+
|
1936 |
+
|
1937 |
+
forval ii = 1(`bin_l')`end'{
|
1938 |
+
local jj = `ii' + `bin_l' - 1
|
1939 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1940 |
+
forval ee = 1/9 {
|
1941 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1942 |
+
}
|
1943 |
+
}
|
1944 |
+
g TRUMP_POST_M`end' = 0
|
1945 |
+
forval ii = 1/9 {
|
1946 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1947 |
+
}
|
1948 |
+
*
|
1949 |
+
|
1950 |
+
|
1951 |
+
forval ii = `start'(`bin_l')0 {
|
1952 |
+
if `ii' < -`bin_l' {
|
1953 |
+
local jj = abs(`ii')
|
1954 |
+
local zz = `jj' - `bin_l' + 1
|
1955 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1956 |
+
forval ee = 1/9 {
|
1957 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1958 |
+
}
|
1959 |
+
}
|
1960 |
+
}
|
1961 |
+
*
|
1962 |
+
local jj = abs(`start')
|
1963 |
+
g TRUMP_PRE_M`jj' = 0
|
1964 |
+
forval ii = 1/9 {
|
1965 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1966 |
+
}
|
1967 |
+
|
1968 |
+
***number of counties 1,478
|
1969 |
+
qui: {
|
1970 |
+
forval ii = 1/1478 {
|
1971 |
+
su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
1972 |
+
if r(N) != 0 {
|
1973 |
+
total n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
1974 |
+
global stops`ii' = _b[n_stops]
|
1975 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1976 |
+
}
|
1977 |
+
}
|
1978 |
+
}
|
1979 |
+
*** Drop the first for collinearity
|
1980 |
+
drop TREATED_COUNTY_9
|
1981 |
+
|
1982 |
+
reghdfe black_ps 1.TRUMP_POST_76_90 1.TRUMP_POST_76_90#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1983 |
+
|
1984 |
+
mat treat = 999* J(1478,2,1)
|
1985 |
+
|
1986 |
+
local numerator = 0
|
1987 |
+
local denominator = 0
|
1988 |
+
forval ii = 1/1478 {
|
1989 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
1990 |
+
if r(N) != 0 {
|
1991 |
+
if `ii' == 9{
|
1992 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90])
|
1993 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1994 |
+
}
|
1995 |
+
else {
|
1996 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90] + _b[1.TRUMP_POST_76_90#1.TREATED_COUNTY_`ii'])
|
1997 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1998 |
+
}
|
1999 |
+
}
|
2000 |
+
}
|
2001 |
+
|
2002 |
+
g yy = treat[_n,1] in 1/1478
|
2003 |
+
g ww = treat[_n,2] in 1/1478
|
2004 |
+
replace yy = . if yy==999
|
2005 |
+
replace ww = . if ww==999
|
2006 |
+
|
2007 |
+
keep yy ww
|
2008 |
+
|
2009 |
+
g county_id = _n
|
2010 |
+
drop if county_id > 1478
|
2011 |
+
|
2012 |
+
save "Results\SA_TRUMP_POST_76_90_TE_NT.dta", replace
|
2013 |
+
|
2014 |
+
|
2015 |
+
************************************************************************************************************************************
|
2016 |
+
|
2017 |
+
use "Data\stoplevel_data.dta", clear
|
2018 |
+
|
2019 |
+
g n_stops = 1
|
2020 |
+
foreach var of varlist black hispanic white api {
|
2021 |
+
replace `var' = `var'/100
|
2022 |
+
}
|
2023 |
+
|
2024 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2025 |
+
|
2026 |
+
g black_ps = black / n_stops
|
2027 |
+
keep if year==2015 | year==2016 | year==2017
|
2028 |
+
|
2029 |
+
local start = -105
|
2030 |
+
local end = 105
|
2031 |
+
local bin_l = 15
|
2032 |
+
|
2033 |
+
g TRUMP_0 = 0
|
2034 |
+
forval ii = 1/9 {
|
2035 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2036 |
+
}
|
2037 |
+
|
2038 |
+
|
2039 |
+
forval ii = 1(`bin_l')`end'{
|
2040 |
+
local jj = `ii' + `bin_l' - 1
|
2041 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2042 |
+
forval ee = 1/9 {
|
2043 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2044 |
+
}
|
2045 |
+
}
|
2046 |
+
g TRUMP_POST_M`end' = 0
|
2047 |
+
forval ii = 1/9 {
|
2048 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2049 |
+
}
|
2050 |
+
*
|
2051 |
+
|
2052 |
+
|
2053 |
+
forval ii = `start'(`bin_l')0 {
|
2054 |
+
if `ii' < -`bin_l' {
|
2055 |
+
local jj = abs(`ii')
|
2056 |
+
local zz = `jj' - `bin_l' + 1
|
2057 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2058 |
+
forval ee = 1/9 {
|
2059 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2060 |
+
}
|
2061 |
+
}
|
2062 |
+
}
|
2063 |
+
*
|
2064 |
+
local jj = abs(`start')
|
2065 |
+
g TRUMP_PRE_M`jj' = 0
|
2066 |
+
forval ii = 1/9 {
|
2067 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2068 |
+
}
|
2069 |
+
|
2070 |
+
***number of counties 1,478
|
2071 |
+
qui: {
|
2072 |
+
forval ii = 1/1478 {
|
2073 |
+
su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2074 |
+
if r(N) != 0 {
|
2075 |
+
total n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2076 |
+
global stops`ii' = _b[n_stops]
|
2077 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2078 |
+
}
|
2079 |
+
}
|
2080 |
+
}
|
2081 |
+
*** Drop the first for collinearity
|
2082 |
+
drop TREATED_COUNTY_9
|
2083 |
+
|
2084 |
+
reghdfe black_ps 1.TRUMP_POST_91_105 1.TRUMP_POST_91_105#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2085 |
+
|
2086 |
+
|
2087 |
+
mat treat = 999* J(1478,2,1)
|
2088 |
+
|
2089 |
+
local numerator = 0
|
2090 |
+
local denominator = 0
|
2091 |
+
forval ii = 1/1478 {
|
2092 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2093 |
+
if r(N) != 0 {
|
2094 |
+
if `ii' == 9{
|
2095 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105])
|
2096 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2097 |
+
}
|
2098 |
+
else {
|
2099 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105] + _b[1.TRUMP_POST_91_105#1.TREATED_COUNTY_`ii'])
|
2100 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2101 |
+
}
|
2102 |
+
}
|
2103 |
+
}
|
2104 |
+
|
2105 |
+
g yy = treat[_n,1] in 1/1478
|
2106 |
+
g ww = treat[_n,2] in 1/1478
|
2107 |
+
replace yy = . if yy==999
|
2108 |
+
replace ww = . if ww==999
|
2109 |
+
|
2110 |
+
|
2111 |
+
|
2112 |
+
keep yy ww
|
2113 |
+
|
2114 |
+
g county_id = _n
|
2115 |
+
drop if county_id > 1478
|
2116 |
+
|
2117 |
+
|
2118 |
+
save "Results\SA_TRUMP_POST_91_105_TE_NT.dta", replace
|
2119 |
+
|
2120 |
+
|
2121 |
+
************************************************************************************************************************************
|
2122 |
+
|
2123 |
+
use "Data\stoplevel_data.dta", clear
|
2124 |
+
|
2125 |
+
g n_stops = 1
|
2126 |
+
foreach var of varlist black hispanic white api {
|
2127 |
+
replace `var' = `var'/100
|
2128 |
+
}
|
2129 |
+
|
2130 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2131 |
+
|
2132 |
+
g black_ps = black / n_stops
|
2133 |
+
keep if year==2015 | year==2016 | year==2017
|
2134 |
+
|
2135 |
+
local start = -105
|
2136 |
+
local end = 105
|
2137 |
+
local bin_l = 15
|
2138 |
+
|
2139 |
+
forval ii = 1/9 {
|
2140 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2141 |
+
}
|
2142 |
+
*
|
2143 |
+
|
2144 |
+
|
2145 |
+
g TRUMP_0 = 0
|
2146 |
+
forval ii = 1/9 {
|
2147 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2148 |
+
}
|
2149 |
+
|
2150 |
+
|
2151 |
+
forval ii = 1(`bin_l')`end'{
|
2152 |
+
local jj = `ii' + `bin_l' - 1
|
2153 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2154 |
+
forval ee = 1/9 {
|
2155 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2156 |
+
}
|
2157 |
+
}
|
2158 |
+
g TRUMP_POST_M`end' = 0
|
2159 |
+
forval ii = 1/9 {
|
2160 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2161 |
+
}
|
2162 |
+
*
|
2163 |
+
|
2164 |
+
|
2165 |
+
forval ii = `start'(`bin_l')0 {
|
2166 |
+
if `ii' < -`bin_l' {
|
2167 |
+
local jj = abs(`ii')
|
2168 |
+
local zz = `jj' - `bin_l' + 1
|
2169 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2170 |
+
forval ee = 1/9 {
|
2171 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2172 |
+
}
|
2173 |
+
}
|
2174 |
+
}
|
2175 |
+
*
|
2176 |
+
local jj = abs(`start')
|
2177 |
+
g TRUMP_PRE_M`jj' = 0
|
2178 |
+
forval ii = 1/9 {
|
2179 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2180 |
+
}
|
2181 |
+
|
2182 |
+
***number of counties 1,478
|
2183 |
+
qui: {
|
2184 |
+
forval ii = 1/1478 {
|
2185 |
+
su n_stops if county_id==`ii' & TRUMP_0==1
|
2186 |
+
if r(N) != 0 {
|
2187 |
+
total n_stops if county_id==`ii' & TRUMP_0==1
|
2188 |
+
global stops`ii' = _b[n_stops]
|
2189 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2190 |
+
}
|
2191 |
+
}
|
2192 |
+
}
|
2193 |
+
*** Drop the first for collinearity
|
2194 |
+
drop TREATED_COUNTY_9
|
2195 |
+
|
2196 |
+
|
2197 |
+
reghdfe black_ps 1.TRUMP_0 1.TRUMP_0#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2198 |
+
|
2199 |
+
|
2200 |
+
mat treat = 999* J(1478,2,1)
|
2201 |
+
|
2202 |
+
local numerator = 0
|
2203 |
+
local denominator = 0
|
2204 |
+
forval ii = 1/1478 {
|
2205 |
+
qui: su n_stops if county_id==`ii' & TRUMP_0==1
|
2206 |
+
if r(N) != 0 {
|
2207 |
+
if `ii' == 9{
|
2208 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0])
|
2209 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2210 |
+
}
|
2211 |
+
else {
|
2212 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0] + _b[1.TRUMP_0#1.TREATED_COUNTY_`ii'])
|
2213 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2214 |
+
}
|
2215 |
+
}
|
2216 |
+
}
|
2217 |
+
|
2218 |
+
g yy = treat[_n,1] in 1/1478
|
2219 |
+
g ww = treat[_n,2] in 1/1478
|
2220 |
+
replace yy = . if yy==999
|
2221 |
+
replace ww = . if ww==999
|
2222 |
+
|
2223 |
+
|
2224 |
+
|
2225 |
+
keep yy ww
|
2226 |
+
|
2227 |
+
g county_id = _n
|
2228 |
+
drop if county_id > 1478
|
2229 |
+
|
2230 |
+
|
2231 |
+
save "Results\SA_TRUMP_0_TE_NT.dta", replace
|
2232 |
+
|
2233 |
+
************************************************************************************************************************************
|
2234 |
+
|
2235 |
+
use "Data\stoplevel_data.dta", clear
|
2236 |
+
|
2237 |
+
g n_stops = 1
|
2238 |
+
foreach var of varlist black hispanic white api {
|
2239 |
+
replace `var' = `var'/100
|
2240 |
+
}
|
2241 |
+
|
2242 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2243 |
+
|
2244 |
+
g black_ps = black / n_stops
|
2245 |
+
keep if year==2015 | year==2016 | year==2017
|
2246 |
+
|
2247 |
+
local start = -105
|
2248 |
+
local end = 105
|
2249 |
+
local bin_l = 15
|
2250 |
+
|
2251 |
+
g TRUMP_0 = 0
|
2252 |
+
forval ii = 1/9 {
|
2253 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2254 |
+
}
|
2255 |
+
|
2256 |
+
|
2257 |
+
forval ii = 1(`bin_l')`end'{
|
2258 |
+
local jj = `ii' + `bin_l' - 1
|
2259 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2260 |
+
forval ee = 1/9 {
|
2261 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2262 |
+
}
|
2263 |
+
}
|
2264 |
+
g TRUMP_POST_M`end' = 0
|
2265 |
+
forval ii = 1/9 {
|
2266 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2267 |
+
}
|
2268 |
+
*
|
2269 |
+
|
2270 |
+
|
2271 |
+
forval ii = `start'(`bin_l')0 {
|
2272 |
+
if `ii' < -`bin_l' {
|
2273 |
+
local jj = abs(`ii')
|
2274 |
+
local zz = `jj' - `bin_l' + 1
|
2275 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2276 |
+
forval ee = 1/9 {
|
2277 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2278 |
+
}
|
2279 |
+
}
|
2280 |
+
}
|
2281 |
+
*
|
2282 |
+
local jj = abs(`start')
|
2283 |
+
g TRUMP_PRE_M`jj' = 0
|
2284 |
+
forval ii = 1/9 {
|
2285 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2286 |
+
}
|
2287 |
+
|
2288 |
+
***number of counties 1,478
|
2289 |
+
qui: {
|
2290 |
+
forval ii = 1/1478 {
|
2291 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2292 |
+
if r(N) != 0 {
|
2293 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2294 |
+
global stops`ii' = _b[n_stops]
|
2295 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2296 |
+
}
|
2297 |
+
}
|
2298 |
+
}
|
2299 |
+
*** Drop the first for collinearity
|
2300 |
+
drop TREATED_COUNTY_9
|
2301 |
+
|
2302 |
+
|
2303 |
+
reghdfe black_ps 1.TRUMP_PRE_30_16 1.TRUMP_PRE_30_16#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_M105) cluster(county_id day_id)
|
2304 |
+
|
2305 |
+
|
2306 |
+
mat treat = 999* J(1478,2,1)
|
2307 |
+
|
2308 |
+
local numerator = 0
|
2309 |
+
local denominator = 0
|
2310 |
+
forval ii = 1/1478 {
|
2311 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2312 |
+
if r(N) != 0 {
|
2313 |
+
if `ii' == 9{
|
2314 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16])
|
2315 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2316 |
+
}
|
2317 |
+
else {
|
2318 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16] + _b[1.TRUMP_PRE_30_16#1.TREATED_COUNTY_`ii'])
|
2319 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2320 |
+
}
|
2321 |
+
}
|
2322 |
+
}
|
2323 |
+
|
2324 |
+
g yy = treat[_n,1] in 1/1478
|
2325 |
+
g ww = treat[_n,2] in 1/1478
|
2326 |
+
replace yy = . if yy==999
|
2327 |
+
replace ww = . if ww==999
|
2328 |
+
|
2329 |
+
keep yy ww
|
2330 |
+
|
2331 |
+
g county_id = _n
|
2332 |
+
drop if county_id > 1478
|
2333 |
+
|
2334 |
+
save "Results\SA_TRUMP_PRE_30_16_TE_NT.dta", replace
|
2335 |
+
|
2336 |
+
************************************************************************************************************************************
|
2337 |
+
|
2338 |
+
use "Data\stoplevel_data.dta", clear
|
2339 |
+
|
2340 |
+
g n_stops = 1
|
2341 |
+
foreach var of varlist black hispanic white api {
|
2342 |
+
replace `var' = `var'/100
|
2343 |
+
}
|
2344 |
+
|
2345 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2346 |
+
|
2347 |
+
g black_ps = black / n_stops
|
2348 |
+
keep if year==2015 | year==2016 | year==2017
|
2349 |
+
|
2350 |
+
local start = -105
|
2351 |
+
local end = 105
|
2352 |
+
local bin_l = 15
|
2353 |
+
|
2354 |
+
g TRUMP_0 = 0
|
2355 |
+
forval ii = 1/9 {
|
2356 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2357 |
+
}
|
2358 |
+
|
2359 |
+
|
2360 |
+
forval ii = 1(`bin_l')`end'{
|
2361 |
+
local jj = `ii' + `bin_l' - 1
|
2362 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2363 |
+
forval ee = 1/9 {
|
2364 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2365 |
+
}
|
2366 |
+
}
|
2367 |
+
g TRUMP_POST_M`end' = 0
|
2368 |
+
forval ii = 1/9 {
|
2369 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2370 |
+
}
|
2371 |
+
*
|
2372 |
+
|
2373 |
+
forval ii = `start'(`bin_l')0 {
|
2374 |
+
if `ii' < -`bin_l' {
|
2375 |
+
local jj = abs(`ii')
|
2376 |
+
local zz = `jj' - `bin_l' + 1
|
2377 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2378 |
+
forval ee = 1/9 {
|
2379 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2380 |
+
}
|
2381 |
+
}
|
2382 |
+
}
|
2383 |
+
*
|
2384 |
+
local jj = abs(`start')
|
2385 |
+
g TRUMP_PRE_M`jj' = 0
|
2386 |
+
forval ii = 1/9 {
|
2387 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2388 |
+
}
|
2389 |
+
|
2390 |
+
***number of counties 1,478
|
2391 |
+
qui: {
|
2392 |
+
forval ii = 1/1478 {
|
2393 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2394 |
+
if r(N) != 0 {
|
2395 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2396 |
+
global stops`ii' = _b[n_stops]
|
2397 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2398 |
+
}
|
2399 |
+
}
|
2400 |
+
}
|
2401 |
+
*** Drop the first for collinearity
|
2402 |
+
drop TREATED_COUNTY_9
|
2403 |
+
|
2404 |
+
reghdfe black_ps 1.TRUMP_PRE_45_31 1.TRUMP_PRE_45_31#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2405 |
+
|
2406 |
+
mat treat = 999* J(1478,2,1)
|
2407 |
+
|
2408 |
+
local numerator = 0
|
2409 |
+
local denominator = 0
|
2410 |
+
forval ii = 1/1478 {
|
2411 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2412 |
+
if r(N) != 0 {
|
2413 |
+
if `ii' == 9{
|
2414 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31])
|
2415 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2416 |
+
}
|
2417 |
+
else {
|
2418 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31] + _b[1.TRUMP_PRE_45_31#1.TREATED_COUNTY_`ii'])
|
2419 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2420 |
+
}
|
2421 |
+
}
|
2422 |
+
}
|
2423 |
+
|
2424 |
+
g yy = treat[_n,1] in 1/1478
|
2425 |
+
g ww = treat[_n,2] in 1/1478
|
2426 |
+
replace yy = . if yy==999
|
2427 |
+
replace ww = . if ww==999
|
2428 |
+
|
2429 |
+
keep yy ww
|
2430 |
+
|
2431 |
+
g county_id = _n
|
2432 |
+
drop if county_id > 1478
|
2433 |
+
|
2434 |
+
save "Results\SA_TRUMP_PRE_45_31_TE_NT.dta", replace
|
2435 |
+
|
2436 |
+
************************************************************************************************************************************
|
2437 |
+
|
2438 |
+
use "Data\stoplevel_data.dta", clear
|
2439 |
+
|
2440 |
+
g n_stops = 1
|
2441 |
+
foreach var of varlist black hispanic white api {
|
2442 |
+
replace `var' = `var'/100
|
2443 |
+
}
|
2444 |
+
|
2445 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2446 |
+
|
2447 |
+
g black_ps = black / n_stops
|
2448 |
+
keep if year==2015 | year==2016 | year==2017
|
2449 |
+
|
2450 |
+
local start = -105
|
2451 |
+
local end = 105
|
2452 |
+
local bin_l = 15
|
2453 |
+
|
2454 |
+
g TRUMP_0 = 0
|
2455 |
+
forval ii = 1/9 {
|
2456 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2457 |
+
}
|
2458 |
+
|
2459 |
+
|
2460 |
+
forval ii = 1(`bin_l')`end'{
|
2461 |
+
local jj = `ii' + `bin_l' - 1
|
2462 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2463 |
+
forval ee = 1/9 {
|
2464 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2465 |
+
}
|
2466 |
+
}
|
2467 |
+
g TRUMP_POST_M`end' = 0
|
2468 |
+
forval ii = 1/9 {
|
2469 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2470 |
+
}
|
2471 |
+
*
|
2472 |
+
|
2473 |
+
|
2474 |
+
forval ii = `start'(`bin_l')0 {
|
2475 |
+
if `ii' < -`bin_l' {
|
2476 |
+
local jj = abs(`ii')
|
2477 |
+
local zz = `jj' - `bin_l' + 1
|
2478 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2479 |
+
forval ee = 1/9 {
|
2480 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2481 |
+
}
|
2482 |
+
}
|
2483 |
+
}
|
2484 |
+
*
|
2485 |
+
local jj = abs(`start')
|
2486 |
+
g TRUMP_PRE_M`jj' = 0
|
2487 |
+
forval ii = 1/9 {
|
2488 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
***number of counties 1,478
|
2492 |
+
qui: {
|
2493 |
+
forval ii = 1/1478 {
|
2494 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2495 |
+
if r(N) != 0 {
|
2496 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2497 |
+
global stops`ii' = _b[n_stops]
|
2498 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2499 |
+
}
|
2500 |
+
}
|
2501 |
+
}
|
2502 |
+
*** Drop the first for collinearity
|
2503 |
+
drop TREATED_COUNTY_9
|
2504 |
+
|
2505 |
+
reghdfe black_ps 1.TRUMP_PRE_60_46 1.TRUMP_PRE_60_46#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2506 |
+
|
2507 |
+
|
2508 |
+
mat treat = 999* J(1478,2,1)
|
2509 |
+
|
2510 |
+
local numerator = 0
|
2511 |
+
local denominator = 0
|
2512 |
+
forval ii = 1/1478 {
|
2513 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2514 |
+
if r(N) != 0 {
|
2515 |
+
if `ii' == 9{
|
2516 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46])
|
2517 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2518 |
+
}
|
2519 |
+
else {
|
2520 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46] + _b[1.TRUMP_PRE_60_46#1.TREATED_COUNTY_`ii'])
|
2521 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2522 |
+
}
|
2523 |
+
}
|
2524 |
+
}
|
2525 |
+
|
2526 |
+
g yy = treat[_n,1] in 1/1478
|
2527 |
+
g ww = treat[_n,2] in 1/1478
|
2528 |
+
replace yy = . if yy==999
|
2529 |
+
replace ww = . if ww==999
|
2530 |
+
|
2531 |
+
keep yy ww
|
2532 |
+
|
2533 |
+
g county_id = _n
|
2534 |
+
drop if county_id > 1478
|
2535 |
+
|
2536 |
+
|
2537 |
+
save "Results\SA_TRUMP_PRE_60_46_TE_NT.dta", replace
|
2538 |
+
|
2539 |
+
************************************************************************************************************************************
|
2540 |
+
|
2541 |
+
use "Data\stoplevel_data.dta", clear
|
2542 |
+
|
2543 |
+
g n_stops = 1
|
2544 |
+
foreach var of varlist black hispanic white api {
|
2545 |
+
replace `var' = `var'/100
|
2546 |
+
}
|
2547 |
+
|
2548 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2549 |
+
|
2550 |
+
g black_ps = black / n_stops
|
2551 |
+
keep if year==2015 | year==2016 | year==2017
|
2552 |
+
|
2553 |
+
local start = -105
|
2554 |
+
local end = 105
|
2555 |
+
local bin_l = 15
|
2556 |
+
|
2557 |
+
g TRUMP_0 = 0
|
2558 |
+
forval ii = 1/9 {
|
2559 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2560 |
+
}
|
2561 |
+
|
2562 |
+
|
2563 |
+
forval ii = 1(`bin_l')`end'{
|
2564 |
+
local jj = `ii' + `bin_l' - 1
|
2565 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2566 |
+
forval ee = 1/9 {
|
2567 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2568 |
+
}
|
2569 |
+
}
|
2570 |
+
g TRUMP_POST_M`end' = 0
|
2571 |
+
forval ii = 1/9 {
|
2572 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2573 |
+
}
|
2574 |
+
*
|
2575 |
+
|
2576 |
+
|
2577 |
+
forval ii = `start'(`bin_l')0 {
|
2578 |
+
if `ii' < -`bin_l' {
|
2579 |
+
local jj = abs(`ii')
|
2580 |
+
local zz = `jj' - `bin_l' + 1
|
2581 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2582 |
+
forval ee = 1/9 {
|
2583 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2584 |
+
}
|
2585 |
+
}
|
2586 |
+
}
|
2587 |
+
*
|
2588 |
+
local jj = abs(`start')
|
2589 |
+
g TRUMP_PRE_M`jj' = 0
|
2590 |
+
forval ii = 1/9 {
|
2591 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2592 |
+
}
|
2593 |
+
|
2594 |
+
***number of counties 1,478
|
2595 |
+
qui: {
|
2596 |
+
forval ii = 1/1478 {
|
2597 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2598 |
+
if r(N) != 0 {
|
2599 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2600 |
+
global stops`ii' = _b[n_stops]
|
2601 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2602 |
+
}
|
2603 |
+
}
|
2604 |
+
}
|
2605 |
+
*** Drop the first for collinearity
|
2606 |
+
drop TREATED_COUNTY_9
|
2607 |
+
|
2608 |
+
reghdfe black_ps 1.TRUMP_PRE_75_61 1.TRUMP_PRE_75_61#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2609 |
+
|
2610 |
+
mat treat = 999* J(1478,2,1)
|
2611 |
+
|
2612 |
+
local numerator = 0
|
2613 |
+
local denominator = 0
|
2614 |
+
forval ii = 1/1478 {
|
2615 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2616 |
+
if r(N) != 0 {
|
2617 |
+
if `ii' == 9{
|
2618 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61])
|
2619 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2620 |
+
}
|
2621 |
+
else {
|
2622 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61] + _b[1.TRUMP_PRE_75_61#1.TREATED_COUNTY_`ii'])
|
2623 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2624 |
+
}
|
2625 |
+
}
|
2626 |
+
}
|
2627 |
+
|
2628 |
+
g yy = treat[_n,1] in 1/1478
|
2629 |
+
g ww = treat[_n,2] in 1/1478
|
2630 |
+
replace yy = . if yy==999
|
2631 |
+
replace ww = . if ww==999
|
2632 |
+
|
2633 |
+
keep yy ww
|
2634 |
+
|
2635 |
+
g county_id = _n
|
2636 |
+
drop if county_id > 1478
|
2637 |
+
|
2638 |
+
save "Results\SA_TRUMP_PRE_75_61_TE_NT.dta", replace
|
2639 |
+
|
2640 |
+
************************************************************************************************************************************
|
2641 |
+
|
2642 |
+
use "Data\stoplevel_data.dta", clear
|
2643 |
+
|
2644 |
+
g n_stops = 1
|
2645 |
+
foreach var of varlist black hispanic white api {
|
2646 |
+
replace `var' = `var'/100
|
2647 |
+
}
|
2648 |
+
|
2649 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2650 |
+
|
2651 |
+
g black_ps = black / n_stops
|
2652 |
+
keep if year==2015 | year==2016 | year==2017
|
2653 |
+
|
2654 |
+
local start = -105
|
2655 |
+
local end = 105
|
2656 |
+
local bin_l = 15
|
2657 |
+
|
2658 |
+
g TRUMP_0 = 0
|
2659 |
+
forval ii = 1/9 {
|
2660 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2661 |
+
}
|
2662 |
+
|
2663 |
+
|
2664 |
+
forval ii = 1(`bin_l')`end'{
|
2665 |
+
local jj = `ii' + `bin_l' - 1
|
2666 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2667 |
+
forval ee = 1/9 {
|
2668 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2669 |
+
}
|
2670 |
+
}
|
2671 |
+
g TRUMP_POST_M`end' = 0
|
2672 |
+
forval ii = 1/9 {
|
2673 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2674 |
+
}
|
2675 |
+
*
|
2676 |
+
|
2677 |
+
|
2678 |
+
forval ii = `start'(`bin_l')0 {
|
2679 |
+
if `ii' < -`bin_l' {
|
2680 |
+
local jj = abs(`ii')
|
2681 |
+
local zz = `jj' - `bin_l' + 1
|
2682 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2683 |
+
forval ee = 1/9 {
|
2684 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2685 |
+
}
|
2686 |
+
}
|
2687 |
+
}
|
2688 |
+
*
|
2689 |
+
local jj = abs(`start')
|
2690 |
+
g TRUMP_PRE_M`jj' = 0
|
2691 |
+
forval ii = 1/9 {
|
2692 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2693 |
+
}
|
2694 |
+
|
2695 |
+
***number of counties 1,478
|
2696 |
+
qui: {
|
2697 |
+
forval ii = 1/1478 {
|
2698 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
2699 |
+
if r(N) != 0 {
|
2700 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
2701 |
+
global stops`ii' = _b[n_stops]
|
2702 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2703 |
+
}
|
2704 |
+
}
|
2705 |
+
}
|
2706 |
+
*** Drop the first for collinearity
|
2707 |
+
drop TREATED_COUNTY_9
|
2708 |
+
|
2709 |
+
reghdfe black_ps 1.TRUMP_PRE_90_76 1.TRUMP_PRE_90_76#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2710 |
+
|
2711 |
+
|
2712 |
+
mat treat = 999* J(1478,2,1)
|
2713 |
+
|
2714 |
+
local numerator = 0
|
2715 |
+
local denominator = 0
|
2716 |
+
forval ii = 1/1478 {
|
2717 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
2718 |
+
if r(N) != 0 {
|
2719 |
+
if `ii' == 9{
|
2720 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76])
|
2721 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2722 |
+
}
|
2723 |
+
else {
|
2724 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76] + _b[1.TRUMP_PRE_90_76#1.TREATED_COUNTY_`ii'])
|
2725 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2726 |
+
}
|
2727 |
+
}
|
2728 |
+
}
|
2729 |
+
|
2730 |
+
g yy = treat[_n,1] in 1/1478
|
2731 |
+
g ww = treat[_n,2] in 1/1478
|
2732 |
+
replace yy = . if yy==999
|
2733 |
+
replace ww = . if ww==999
|
2734 |
+
|
2735 |
+
keep yy ww
|
2736 |
+
|
2737 |
+
g county_id = _n
|
2738 |
+
drop if county_id > 1478
|
2739 |
+
|
2740 |
+
|
2741 |
+
save "Results\SA_TRUMP_PRE_90_76_TE_NT.dta", replace
|
2742 |
+
|
2743 |
+
************************************************************************************************************************************
|
2744 |
+
|
2745 |
+
use "Data\stoplevel_data.dta", clear
|
2746 |
+
|
2747 |
+
g n_stops = 1
|
2748 |
+
foreach var of varlist black hispanic white api {
|
2749 |
+
replace `var' = `var'/100
|
2750 |
+
}
|
2751 |
+
|
2752 |
+
collapse (sum) n_stops black (first) dist_event* year , by(county_fips day_id)
|
2753 |
+
|
2754 |
+
g black_ps = black / n_stops
|
2755 |
+
keep if year==2015 | year==2016 | year==2017
|
2756 |
+
|
2757 |
+
local start = -105
|
2758 |
+
local end = 105
|
2759 |
+
local bin_l = 15
|
2760 |
+
|
2761 |
+
g TRUMP_0 = 0
|
2762 |
+
forval ii = 1/9 {
|
2763 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2764 |
+
}
|
2765 |
+
|
2766 |
+
|
2767 |
+
forval ii = 1(`bin_l')`end'{
|
2768 |
+
local jj = `ii' + `bin_l' - 1
|
2769 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2770 |
+
forval ee = 1/9 {
|
2771 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2772 |
+
}
|
2773 |
+
}
|
2774 |
+
g TRUMP_POST_M`end' = 0
|
2775 |
+
forval ii = 1/9 {
|
2776 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2777 |
+
}
|
2778 |
+
*
|
2779 |
+
|
2780 |
+
|
2781 |
+
forval ii = `start'(`bin_l')0 {
|
2782 |
+
if `ii' < -`bin_l' {
|
2783 |
+
local jj = abs(`ii')
|
2784 |
+
local zz = `jj' - `bin_l' + 1
|
2785 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2786 |
+
forval ee = 1/9 {
|
2787 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2788 |
+
}
|
2789 |
+
}
|
2790 |
+
}
|
2791 |
+
*
|
2792 |
+
local jj = abs(`start')
|
2793 |
+
g TRUMP_PRE_M`jj' = 0
|
2794 |
+
forval ii = 1/9 {
|
2795 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2796 |
+
}
|
2797 |
+
|
2798 |
+
***number of counties 1,478
|
2799 |
+
qui: {
|
2800 |
+
forval ii = 1/1478 {
|
2801 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
2802 |
+
if r(N) != 0 {
|
2803 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
2804 |
+
global stops`ii' = _b[n_stops]
|
2805 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2806 |
+
}
|
2807 |
+
}
|
2808 |
+
}
|
2809 |
+
*** Drop the first for collinearity
|
2810 |
+
drop TREATED_COUNTY_9
|
2811 |
+
|
2812 |
+
reghdfe black_ps 1.TRUMP_PRE_105_91 1.TRUMP_PRE_105_91#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2813 |
+
|
2814 |
+
mat treat = 999* J(1478,2,1)
|
2815 |
+
|
2816 |
+
local numerator = 0
|
2817 |
+
local denominator = 0
|
2818 |
+
forval ii = 1/1478 {
|
2819 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
2820 |
+
if r(N) != 0 {
|
2821 |
+
if `ii' == 9{
|
2822 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91])
|
2823 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2824 |
+
}
|
2825 |
+
else {
|
2826 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91] + _b[1.TRUMP_PRE_105_91#1.TREATED_COUNTY_`ii'])
|
2827 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2828 |
+
}
|
2829 |
+
}
|
2830 |
+
}
|
2831 |
+
|
2832 |
+
g yy = treat[_n,1] in 1/1478
|
2833 |
+
g ww = treat[_n,2] in 1/1478
|
2834 |
+
replace yy = . if yy==999
|
2835 |
+
replace ww = . if ww==999
|
2836 |
+
|
2837 |
+
keep yy ww
|
2838 |
+
|
2839 |
+
g county_id = _n
|
2840 |
+
drop if county_id > 1478
|
2841 |
+
|
2842 |
+
save "Results\SA_TRUMP_PRE_105_91_TE_NT.dta", replace
|
2843 |
+
|
2844 |
+
|
2845 |
+
|
39/replication_package/Do/preparing_abrahamsun_es.do
ADDED
@@ -0,0 +1,3168 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
use "Data\county_day_data.dta", clear
|
3 |
+
|
4 |
+
keep if year==2015 | year==2016 | year==2017
|
5 |
+
|
6 |
+
local start = -105
|
7 |
+
local end = 105
|
8 |
+
local bin_l = 15
|
9 |
+
|
10 |
+
drop TRUMP*
|
11 |
+
forval ii = 1/9 {
|
12 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
13 |
+
}
|
14 |
+
|
15 |
+
g TRUMP_0 = 0
|
16 |
+
forval ii = 1/9 {
|
17 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
18 |
+
}
|
19 |
+
|
20 |
+
forval ii = 1(`bin_l')`end'{
|
21 |
+
local jj = `ii' + `bin_l' - 1
|
22 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
23 |
+
forval ee = 1/9 {
|
24 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
25 |
+
}
|
26 |
+
}
|
27 |
+
g TRUMP_POST_M`end' = 0
|
28 |
+
forval ii = 1/9 {
|
29 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
30 |
+
}
|
31 |
+
*
|
32 |
+
|
33 |
+
|
34 |
+
forval ii = `start'(`bin_l')0 {
|
35 |
+
if `ii' < -`bin_l' {
|
36 |
+
local jj = abs(`ii')
|
37 |
+
local zz = `jj' - `bin_l' + 1
|
38 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
39 |
+
forval ee = 1/9 {
|
40 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
*
|
45 |
+
local jj = abs(`start')
|
46 |
+
g TRUMP_PRE_M`jj' = 0
|
47 |
+
forval ii = 1/9 {
|
48 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
49 |
+
}
|
50 |
+
|
51 |
+
***number of counties 1,478
|
52 |
+
qui: {
|
53 |
+
forval ii = 1/1478 {
|
54 |
+
su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
55 |
+
if r(N) != 0 {
|
56 |
+
total n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
57 |
+
global stops`ii' = _b[n_stops]
|
58 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
59 |
+
}
|
60 |
+
}
|
61 |
+
}
|
62 |
+
**I drop the first for collinearity
|
63 |
+
drop TREATED_COUNTY_9
|
64 |
+
|
65 |
+
|
66 |
+
reghdfe black_ps 1.TRUMP_POST_1_15 1.TRUMP_POST_1_15#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
67 |
+
|
68 |
+
|
69 |
+
mat treat = 999* J(1478,2,1)
|
70 |
+
|
71 |
+
local numerator = 0
|
72 |
+
local denominator = 0
|
73 |
+
forval ii = 1/1478 {
|
74 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
75 |
+
if r(N) != 0 {
|
76 |
+
if `ii' == 9{
|
77 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15])
|
78 |
+
mat treat[`ii',2] = (${stops`ii'})
|
79 |
+
}
|
80 |
+
else {
|
81 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15] + _b[1.TRUMP_POST_1_15#1.TREATED_COUNTY_`ii'])
|
82 |
+
mat treat[`ii',2] = (${stops`ii'})
|
83 |
+
}
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
g yy = treat[_n,1] in 1/1478
|
88 |
+
g ww = treat[_n,2] in 1/1478
|
89 |
+
replace yy = . if yy==999
|
90 |
+
replace ww = . if ww==999
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
keep yy ww
|
95 |
+
drop if yy==.
|
96 |
+
|
97 |
+
|
98 |
+
expand ww
|
99 |
+
egen id = group(yy)
|
100 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
101 |
+
matrix b = e(b)
|
102 |
+
matrix ci = e(ci_normal)
|
103 |
+
g beta = b[1,1] in 1
|
104 |
+
g CI_lb = ci[1,1] in 1
|
105 |
+
g CI_ub = ci[2,1] in 1
|
106 |
+
|
107 |
+
keep if _n == 1
|
108 |
+
keep beta CI_*
|
109 |
+
|
110 |
+
save "Results\SA_TRUMP_POST_1_15.dta", replace
|
111 |
+
|
112 |
+
************************************************************************************************************************************
|
113 |
+
|
114 |
+
use "Data\county_day_data.dta", clear
|
115 |
+
|
116 |
+
|
117 |
+
keep if year==2015 | year==2016 | year==2017
|
118 |
+
|
119 |
+
local start = -105
|
120 |
+
local end = 105
|
121 |
+
local bin_l = 15
|
122 |
+
|
123 |
+
drop TRUMP*
|
124 |
+
forval ii = 1/9 {
|
125 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
126 |
+
}
|
127 |
+
|
128 |
+
g TRUMP_0 = 0
|
129 |
+
forval ii = 1/9 {
|
130 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
131 |
+
}
|
132 |
+
|
133 |
+
|
134 |
+
forval ii = 1(`bin_l')`end'{
|
135 |
+
local jj = `ii' + `bin_l' - 1
|
136 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
137 |
+
forval ee = 1/9 {
|
138 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
139 |
+
}
|
140 |
+
}
|
141 |
+
g TRUMP_POST_M`end' = 0
|
142 |
+
forval ii = 1/9 {
|
143 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
144 |
+
}
|
145 |
+
*
|
146 |
+
|
147 |
+
|
148 |
+
forval ii = `start'(`bin_l')0 {
|
149 |
+
if `ii' < -`bin_l' {
|
150 |
+
local jj = abs(`ii')
|
151 |
+
local zz = `jj' - `bin_l' + 1
|
152 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
153 |
+
forval ee = 1/9 {
|
154 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
*
|
159 |
+
local jj = abs(`start')
|
160 |
+
g TRUMP_PRE_M`jj' = 0
|
161 |
+
forval ii = 1/9 {
|
162 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
163 |
+
}
|
164 |
+
|
165 |
+
***number of counties 1,478
|
166 |
+
qui: {
|
167 |
+
forval ii = 1/1478 {
|
168 |
+
su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
169 |
+
if r(N) != 0 {
|
170 |
+
total n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
171 |
+
global stops`ii' = _b[n_stops]
|
172 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
173 |
+
}
|
174 |
+
}
|
175 |
+
}
|
176 |
+
**I drop the first for collinearity
|
177 |
+
drop TREATED_COUNTY_9
|
178 |
+
|
179 |
+
|
180 |
+
reghdfe black_ps 1.TRUMP_POST_16_30 1.TRUMP_POST_16_30#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
181 |
+
|
182 |
+
|
183 |
+
mat treat = 999* J(1478,2,1)
|
184 |
+
|
185 |
+
local numerator = 0
|
186 |
+
local denominator = 0
|
187 |
+
forval ii = 1/1478 {
|
188 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
189 |
+
if r(N) != 0 {
|
190 |
+
if `ii' == 9{
|
191 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30])
|
192 |
+
mat treat[`ii',2] = (${stops`ii'})
|
193 |
+
}
|
194 |
+
else {
|
195 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30] + _b[1.TRUMP_POST_16_30#1.TREATED_COUNTY_`ii'])
|
196 |
+
mat treat[`ii',2] = (${stops`ii'})
|
197 |
+
}
|
198 |
+
}
|
199 |
+
}
|
200 |
+
|
201 |
+
g yy = treat[_n,1] in 1/1478
|
202 |
+
g ww = treat[_n,2] in 1/1478
|
203 |
+
replace yy = . if yy==999
|
204 |
+
replace ww = . if ww==999
|
205 |
+
|
206 |
+
|
207 |
+
|
208 |
+
keep yy ww
|
209 |
+
drop if yy==.
|
210 |
+
|
211 |
+
|
212 |
+
expand ww
|
213 |
+
egen id = group(yy)
|
214 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
215 |
+
matrix b = e(b)
|
216 |
+
matrix ci = e(ci_normal)
|
217 |
+
g beta = b[1,1] in 1
|
218 |
+
g CI_lb = ci[1,1] in 1
|
219 |
+
g CI_ub = ci[2,1] in 1
|
220 |
+
|
221 |
+
keep if _n == 1
|
222 |
+
keep beta CI_*
|
223 |
+
|
224 |
+
save "Results\SA_TRUMP_POST_16_30.dta", replace
|
225 |
+
|
226 |
+
************************************************************************************************************************************
|
227 |
+
|
228 |
+
use "Data\county_day_data.dta", clear
|
229 |
+
|
230 |
+
|
231 |
+
|
232 |
+
keep if year==2015 | year==2016 | year==2017
|
233 |
+
|
234 |
+
local start = -105
|
235 |
+
local end = 105
|
236 |
+
local bin_l = 15
|
237 |
+
drop TRUMP*
|
238 |
+
forval ii = 1/9 {
|
239 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
240 |
+
}
|
241 |
+
g TRUMP_0 = 0
|
242 |
+
forval ii = 1/9 {
|
243 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
244 |
+
}
|
245 |
+
|
246 |
+
|
247 |
+
forval ii = 1(`bin_l')`end'{
|
248 |
+
local jj = `ii' + `bin_l' - 1
|
249 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
250 |
+
forval ee = 1/9 {
|
251 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
252 |
+
}
|
253 |
+
}
|
254 |
+
g TRUMP_POST_M`end' = 0
|
255 |
+
forval ii = 1/9 {
|
256 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
257 |
+
}
|
258 |
+
*
|
259 |
+
|
260 |
+
|
261 |
+
forval ii = `start'(`bin_l')0 {
|
262 |
+
if `ii' < -`bin_l' {
|
263 |
+
local jj = abs(`ii')
|
264 |
+
local zz = `jj' - `bin_l' + 1
|
265 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
266 |
+
forval ee = 1/9 {
|
267 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
268 |
+
}
|
269 |
+
}
|
270 |
+
}
|
271 |
+
*
|
272 |
+
local jj = abs(`start')
|
273 |
+
g TRUMP_PRE_M`jj' = 0
|
274 |
+
forval ii = 1/9 {
|
275 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
276 |
+
}
|
277 |
+
|
278 |
+
***number of counties 1,478
|
279 |
+
qui: {
|
280 |
+
forval ii = 1/1478 {
|
281 |
+
su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
282 |
+
if r(N) != 0 {
|
283 |
+
total n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
284 |
+
global stops`ii' = _b[n_stops]
|
285 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
286 |
+
}
|
287 |
+
}
|
288 |
+
}
|
289 |
+
**I drop the first for collinearity
|
290 |
+
drop TREATED_COUNTY_9
|
291 |
+
|
292 |
+
|
293 |
+
reghdfe black_ps 1.TRUMP_POST_31_45 1.TRUMP_POST_31_45#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
294 |
+
|
295 |
+
|
296 |
+
mat treat = 999* J(1478,2,1)
|
297 |
+
|
298 |
+
local numerator = 0
|
299 |
+
local denominator = 0
|
300 |
+
forval ii = 1/1478 {
|
301 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
302 |
+
if r(N) != 0 {
|
303 |
+
if `ii' == 9{
|
304 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45])
|
305 |
+
mat treat[`ii',2] = (${stops`ii'})
|
306 |
+
}
|
307 |
+
else {
|
308 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45] + _b[1.TRUMP_POST_31_45#1.TREATED_COUNTY_`ii'])
|
309 |
+
mat treat[`ii',2] = (${stops`ii'})
|
310 |
+
}
|
311 |
+
}
|
312 |
+
}
|
313 |
+
|
314 |
+
g yy = treat[_n,1] in 1/1478
|
315 |
+
g ww = treat[_n,2] in 1/1478
|
316 |
+
replace yy = . if yy==999
|
317 |
+
replace ww = . if ww==999
|
318 |
+
|
319 |
+
|
320 |
+
|
321 |
+
keep yy ww
|
322 |
+
drop if yy==.
|
323 |
+
|
324 |
+
|
325 |
+
expand ww
|
326 |
+
egen id = group(yy)
|
327 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
328 |
+
matrix b = e(b)
|
329 |
+
matrix ci = e(ci_normal)
|
330 |
+
g beta = b[1,1] in 1
|
331 |
+
g CI_lb = ci[1,1] in 1
|
332 |
+
g CI_ub = ci[2,1] in 1
|
333 |
+
|
334 |
+
keep if _n == 1
|
335 |
+
keep beta CI_*
|
336 |
+
|
337 |
+
save "Results\SA_TRUMP_POST_31_45.dta", replace
|
338 |
+
|
339 |
+
************************************************************************************************************************************
|
340 |
+
|
341 |
+
use "Data\county_day_data.dta", clear
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
|
346 |
+
keep if year==2015 | year==2016 | year==2017
|
347 |
+
|
348 |
+
local start = -105
|
349 |
+
local end = 105
|
350 |
+
local bin_l = 15
|
351 |
+
|
352 |
+
drop TRUMP*
|
353 |
+
forval ii = 1/9 {
|
354 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
355 |
+
}
|
356 |
+
|
357 |
+
g TRUMP_0 = 0
|
358 |
+
forval ii = 1/9 {
|
359 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
360 |
+
}
|
361 |
+
|
362 |
+
|
363 |
+
forval ii = 1(`bin_l')`end'{
|
364 |
+
local jj = `ii' + `bin_l' - 1
|
365 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
366 |
+
forval ee = 1/9 {
|
367 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
368 |
+
}
|
369 |
+
}
|
370 |
+
g TRUMP_POST_M`end' = 0
|
371 |
+
forval ii = 1/9 {
|
372 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
373 |
+
}
|
374 |
+
*
|
375 |
+
|
376 |
+
|
377 |
+
forval ii = `start'(`bin_l')0 {
|
378 |
+
if `ii' < -`bin_l' {
|
379 |
+
local jj = abs(`ii')
|
380 |
+
local zz = `jj' - `bin_l' + 1
|
381 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
382 |
+
forval ee = 1/9 {
|
383 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
384 |
+
}
|
385 |
+
}
|
386 |
+
}
|
387 |
+
*
|
388 |
+
local jj = abs(`start')
|
389 |
+
g TRUMP_PRE_M`jj' = 0
|
390 |
+
forval ii = 1/9 {
|
391 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
392 |
+
}
|
393 |
+
|
394 |
+
***number of counties 1,478
|
395 |
+
qui: {
|
396 |
+
forval ii = 1/1478 {
|
397 |
+
su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
398 |
+
if r(N) != 0 {
|
399 |
+
total n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
400 |
+
global stops`ii' = _b[n_stops]
|
401 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
402 |
+
}
|
403 |
+
}
|
404 |
+
}
|
405 |
+
**I drop the first for collinearity
|
406 |
+
drop TREATED_COUNTY_9
|
407 |
+
|
408 |
+
|
409 |
+
reghdfe black_ps 1.TRUMP_POST_46_60 1.TRUMP_POST_46_60#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
410 |
+
|
411 |
+
|
412 |
+
mat treat = 999* J(1478,2,1)
|
413 |
+
|
414 |
+
local numerator = 0
|
415 |
+
local denominator = 0
|
416 |
+
forval ii = 1/1478 {
|
417 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
418 |
+
if r(N) != 0 {
|
419 |
+
if `ii' == 9{
|
420 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60])
|
421 |
+
mat treat[`ii',2] = (${stops`ii'})
|
422 |
+
}
|
423 |
+
else {
|
424 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60] + _b[1.TRUMP_POST_46_60#1.TREATED_COUNTY_`ii'])
|
425 |
+
mat treat[`ii',2] = (${stops`ii'})
|
426 |
+
}
|
427 |
+
}
|
428 |
+
}
|
429 |
+
|
430 |
+
g yy = treat[_n,1] in 1/1478
|
431 |
+
g ww = treat[_n,2] in 1/1478
|
432 |
+
replace yy = . if yy==999
|
433 |
+
replace ww = . if ww==999
|
434 |
+
|
435 |
+
|
436 |
+
|
437 |
+
keep yy ww
|
438 |
+
drop if yy==.
|
439 |
+
|
440 |
+
|
441 |
+
expand ww
|
442 |
+
egen id = group(yy)
|
443 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
444 |
+
matrix b = e(b)
|
445 |
+
matrix ci = e(ci_normal)
|
446 |
+
g beta = b[1,1] in 1
|
447 |
+
g CI_lb = ci[1,1] in 1
|
448 |
+
g CI_ub = ci[2,1] in 1
|
449 |
+
|
450 |
+
keep if _n == 1
|
451 |
+
keep beta CI_*
|
452 |
+
|
453 |
+
save "Results\SA_TRUMP_POST_46_60.dta", replace
|
454 |
+
|
455 |
+
************************************************************************************************************************************
|
456 |
+
|
457 |
+
use "Data\county_day_data.dta", clear
|
458 |
+
|
459 |
+
|
460 |
+
|
461 |
+
|
462 |
+
keep if year==2015 | year==2016 | year==2017
|
463 |
+
|
464 |
+
local start = -105
|
465 |
+
local end = 105
|
466 |
+
local bin_l = 15
|
467 |
+
|
468 |
+
drop TRUMP*
|
469 |
+
forval ii = 1/9 {
|
470 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
471 |
+
}
|
472 |
+
|
473 |
+
g TRUMP_0 = 0
|
474 |
+
forval ii = 1/9 {
|
475 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
476 |
+
}
|
477 |
+
|
478 |
+
|
479 |
+
forval ii = 1(`bin_l')`end'{
|
480 |
+
local jj = `ii' + `bin_l' - 1
|
481 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
482 |
+
forval ee = 1/9 {
|
483 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
484 |
+
}
|
485 |
+
}
|
486 |
+
g TRUMP_POST_M`end' = 0
|
487 |
+
forval ii = 1/9 {
|
488 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
489 |
+
}
|
490 |
+
*
|
491 |
+
|
492 |
+
|
493 |
+
forval ii = `start'(`bin_l')0 {
|
494 |
+
if `ii' < -`bin_l' {
|
495 |
+
local jj = abs(`ii')
|
496 |
+
local zz = `jj' - `bin_l' + 1
|
497 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
498 |
+
forval ee = 1/9 {
|
499 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
500 |
+
}
|
501 |
+
}
|
502 |
+
}
|
503 |
+
*
|
504 |
+
local jj = abs(`start')
|
505 |
+
g TRUMP_PRE_M`jj' = 0
|
506 |
+
forval ii = 1/9 {
|
507 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
508 |
+
}
|
509 |
+
|
510 |
+
***number of counties 1,478
|
511 |
+
qui: {
|
512 |
+
forval ii = 1/1478 {
|
513 |
+
su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
514 |
+
if r(N) != 0 {
|
515 |
+
total n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
516 |
+
global stops`ii' = _b[n_stops]
|
517 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
518 |
+
}
|
519 |
+
}
|
520 |
+
}
|
521 |
+
**I drop the first for collinearity
|
522 |
+
drop TREATED_COUNTY_9
|
523 |
+
|
524 |
+
|
525 |
+
reghdfe black_ps 1.TRUMP_POST_61_75 1.TRUMP_POST_61_75#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
526 |
+
|
527 |
+
|
528 |
+
mat treat = 999* J(1478,2,1)
|
529 |
+
|
530 |
+
local numerator = 0
|
531 |
+
local denominator = 0
|
532 |
+
forval ii = 1/1478 {
|
533 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
534 |
+
if r(N) != 0 {
|
535 |
+
if `ii' == 9{
|
536 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75])
|
537 |
+
mat treat[`ii',2] = (${stops`ii'})
|
538 |
+
}
|
539 |
+
else {
|
540 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75] + _b[1.TRUMP_POST_61_75#1.TREATED_COUNTY_`ii'])
|
541 |
+
mat treat[`ii',2] = (${stops`ii'})
|
542 |
+
}
|
543 |
+
}
|
544 |
+
}
|
545 |
+
|
546 |
+
g yy = treat[_n,1] in 1/1478
|
547 |
+
g ww = treat[_n,2] in 1/1478
|
548 |
+
replace yy = . if yy==999
|
549 |
+
replace ww = . if ww==999
|
550 |
+
|
551 |
+
|
552 |
+
|
553 |
+
keep yy ww
|
554 |
+
drop if yy==.
|
555 |
+
|
556 |
+
|
557 |
+
expand ww
|
558 |
+
egen id = group(yy)
|
559 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
560 |
+
matrix b = e(b)
|
561 |
+
matrix ci = e(ci_normal)
|
562 |
+
g beta = b[1,1] in 1
|
563 |
+
g CI_lb = ci[1,1] in 1
|
564 |
+
g CI_ub = ci[2,1] in 1
|
565 |
+
|
566 |
+
keep if _n == 1
|
567 |
+
keep beta CI_*
|
568 |
+
|
569 |
+
save "Results\SA_TRUMP_POST_61_75.dta", replace
|
570 |
+
|
571 |
+
************************************************************************************************************************************
|
572 |
+
|
573 |
+
use "Data\county_day_data.dta", clear
|
574 |
+
|
575 |
+
|
576 |
+
|
577 |
+
keep if year==2015 | year==2016 | year==2017
|
578 |
+
|
579 |
+
local start = -105
|
580 |
+
local end = 105
|
581 |
+
local bin_l = 15
|
582 |
+
|
583 |
+
drop TRUMP*
|
584 |
+
forval ii = 1/9 {
|
585 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
586 |
+
}
|
587 |
+
|
588 |
+
g TRUMP_0 = 0
|
589 |
+
forval ii = 1/9 {
|
590 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
591 |
+
}
|
592 |
+
|
593 |
+
|
594 |
+
forval ii = 1(`bin_l')`end'{
|
595 |
+
local jj = `ii' + `bin_l' - 1
|
596 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
597 |
+
forval ee = 1/9 {
|
598 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
599 |
+
}
|
600 |
+
}
|
601 |
+
g TRUMP_POST_M`end' = 0
|
602 |
+
forval ii = 1/9 {
|
603 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
604 |
+
}
|
605 |
+
*
|
606 |
+
|
607 |
+
|
608 |
+
forval ii = `start'(`bin_l')0 {
|
609 |
+
if `ii' < -`bin_l' {
|
610 |
+
local jj = abs(`ii')
|
611 |
+
local zz = `jj' - `bin_l' + 1
|
612 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
613 |
+
forval ee = 1/9 {
|
614 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
615 |
+
}
|
616 |
+
}
|
617 |
+
}
|
618 |
+
*
|
619 |
+
local jj = abs(`start')
|
620 |
+
g TRUMP_PRE_M`jj' = 0
|
621 |
+
forval ii = 1/9 {
|
622 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
623 |
+
}
|
624 |
+
|
625 |
+
***number of counties 1,478
|
626 |
+
qui: {
|
627 |
+
forval ii = 1/1478 {
|
628 |
+
su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
629 |
+
if r(N) != 0 {
|
630 |
+
total n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
631 |
+
global stops`ii' = _b[n_stops]
|
632 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
633 |
+
}
|
634 |
+
}
|
635 |
+
}
|
636 |
+
**I drop the first for collinearity
|
637 |
+
drop TREATED_COUNTY_9
|
638 |
+
|
639 |
+
|
640 |
+
reghdfe black_ps 1.TRUMP_POST_76_90 1.TRUMP_POST_76_90#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
641 |
+
|
642 |
+
|
643 |
+
mat treat = 999* J(1478,2,1)
|
644 |
+
|
645 |
+
local numerator = 0
|
646 |
+
local denominator = 0
|
647 |
+
forval ii = 1/1478 {
|
648 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
649 |
+
if r(N) != 0 {
|
650 |
+
if `ii' == 9{
|
651 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90])
|
652 |
+
mat treat[`ii',2] = (${stops`ii'})
|
653 |
+
}
|
654 |
+
else {
|
655 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90] + _b[1.TRUMP_POST_76_90#1.TREATED_COUNTY_`ii'])
|
656 |
+
mat treat[`ii',2] = (${stops`ii'})
|
657 |
+
}
|
658 |
+
}
|
659 |
+
}
|
660 |
+
|
661 |
+
g yy = treat[_n,1] in 1/1478
|
662 |
+
g ww = treat[_n,2] in 1/1478
|
663 |
+
replace yy = . if yy==999
|
664 |
+
replace ww = . if ww==999
|
665 |
+
|
666 |
+
|
667 |
+
|
668 |
+
keep yy ww
|
669 |
+
drop if yy==.
|
670 |
+
|
671 |
+
|
672 |
+
expand ww
|
673 |
+
egen id = group(yy)
|
674 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
675 |
+
matrix b = e(b)
|
676 |
+
matrix ci = e(ci_normal)
|
677 |
+
g beta = b[1,1] in 1
|
678 |
+
g CI_lb = ci[1,1] in 1
|
679 |
+
g CI_ub = ci[2,1] in 1
|
680 |
+
|
681 |
+
keep if _n == 1
|
682 |
+
keep beta CI_*
|
683 |
+
|
684 |
+
save "Results\SA_TRUMP_POST_76_90.dta", replace
|
685 |
+
|
686 |
+
************************************************************************************************************************************
|
687 |
+
|
688 |
+
use "Data\county_day_data.dta", clear
|
689 |
+
|
690 |
+
|
691 |
+
|
692 |
+
keep if year==2015 | year==2016 | year==2017
|
693 |
+
|
694 |
+
local start = -105
|
695 |
+
local end = 105
|
696 |
+
local bin_l = 15
|
697 |
+
|
698 |
+
drop TRUMP*
|
699 |
+
forval ii = 1/9 {
|
700 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
701 |
+
}
|
702 |
+
g TRUMP_0 = 0
|
703 |
+
forval ii = 1/9 {
|
704 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
705 |
+
}
|
706 |
+
|
707 |
+
|
708 |
+
forval ii = 1(`bin_l')`end'{
|
709 |
+
local jj = `ii' + `bin_l' - 1
|
710 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
711 |
+
forval ee = 1/9 {
|
712 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
713 |
+
}
|
714 |
+
}
|
715 |
+
g TRUMP_POST_M`end' = 0
|
716 |
+
forval ii = 1/9 {
|
717 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
718 |
+
}
|
719 |
+
*
|
720 |
+
|
721 |
+
|
722 |
+
forval ii = `start'(`bin_l')0 {
|
723 |
+
if `ii' < -`bin_l' {
|
724 |
+
local jj = abs(`ii')
|
725 |
+
local zz = `jj' - `bin_l' + 1
|
726 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
727 |
+
forval ee = 1/9 {
|
728 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
729 |
+
}
|
730 |
+
}
|
731 |
+
}
|
732 |
+
*
|
733 |
+
local jj = abs(`start')
|
734 |
+
g TRUMP_PRE_M`jj' = 0
|
735 |
+
forval ii = 1/9 {
|
736 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
737 |
+
}
|
738 |
+
|
739 |
+
***number of counties 1,478
|
740 |
+
qui: {
|
741 |
+
forval ii = 1/1478 {
|
742 |
+
su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
743 |
+
if r(N) != 0 {
|
744 |
+
total n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
745 |
+
global stops`ii' = _b[n_stops]
|
746 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
747 |
+
}
|
748 |
+
}
|
749 |
+
}
|
750 |
+
**I drop the first for collinearity
|
751 |
+
drop TREATED_COUNTY_9
|
752 |
+
|
753 |
+
|
754 |
+
reghdfe black_ps 1.TRUMP_POST_91_105 1.TRUMP_POST_91_105#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
755 |
+
|
756 |
+
|
757 |
+
mat treat = 999* J(1478,2,1)
|
758 |
+
|
759 |
+
local numerator = 0
|
760 |
+
local denominator = 0
|
761 |
+
forval ii = 1/1478 {
|
762 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
763 |
+
if r(N) != 0 {
|
764 |
+
if `ii' == 9{
|
765 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105])
|
766 |
+
mat treat[`ii',2] = (${stops`ii'})
|
767 |
+
}
|
768 |
+
else {
|
769 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105] + _b[1.TRUMP_POST_91_105#1.TREATED_COUNTY_`ii'])
|
770 |
+
mat treat[`ii',2] = (${stops`ii'})
|
771 |
+
}
|
772 |
+
}
|
773 |
+
}
|
774 |
+
|
775 |
+
g yy = treat[_n,1] in 1/1478
|
776 |
+
g ww = treat[_n,2] in 1/1478
|
777 |
+
replace yy = . if yy==999
|
778 |
+
replace ww = . if ww==999
|
779 |
+
|
780 |
+
|
781 |
+
|
782 |
+
keep yy ww
|
783 |
+
drop if yy==.
|
784 |
+
|
785 |
+
|
786 |
+
expand ww
|
787 |
+
egen id = group(yy)
|
788 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
789 |
+
matrix b = e(b)
|
790 |
+
matrix ci = e(ci_normal)
|
791 |
+
g beta = b[1,1] in 1
|
792 |
+
g CI_lb = ci[1,1] in 1
|
793 |
+
g CI_ub = ci[2,1] in 1
|
794 |
+
|
795 |
+
keep if _n == 1
|
796 |
+
keep beta CI_*
|
797 |
+
|
798 |
+
save "Results\SA_TRUMP_POST_91_105.dta", replace
|
799 |
+
|
800 |
+
************************************************************************************************************************************
|
801 |
+
|
802 |
+
use "Data\county_day_data.dta", clear
|
803 |
+
|
804 |
+
|
805 |
+
|
806 |
+
keep if year==2015 | year==2016 | year==2017
|
807 |
+
|
808 |
+
local start = -105
|
809 |
+
local end = 105
|
810 |
+
local bin_l = 15
|
811 |
+
|
812 |
+
drop TRUMP*
|
813 |
+
forval ii = 1/9 {
|
814 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
815 |
+
}
|
816 |
+
|
817 |
+
g TRUMP_0 = 0
|
818 |
+
forval ii = 1/9 {
|
819 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
820 |
+
}
|
821 |
+
|
822 |
+
|
823 |
+
forval ii = 1(`bin_l')`end'{
|
824 |
+
local jj = `ii' + `bin_l' - 1
|
825 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
826 |
+
forval ee = 1/9 {
|
827 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
828 |
+
}
|
829 |
+
}
|
830 |
+
g TRUMP_POST_M`end' = 0
|
831 |
+
forval ii = 1/9 {
|
832 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
833 |
+
}
|
834 |
+
*
|
835 |
+
|
836 |
+
|
837 |
+
forval ii = `start'(`bin_l')0 {
|
838 |
+
if `ii' < -`bin_l' {
|
839 |
+
local jj = abs(`ii')
|
840 |
+
local zz = `jj' - `bin_l' + 1
|
841 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
842 |
+
forval ee = 1/9 {
|
843 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
844 |
+
}
|
845 |
+
}
|
846 |
+
}
|
847 |
+
*
|
848 |
+
local jj = abs(`start')
|
849 |
+
g TRUMP_PRE_M`jj' = 0
|
850 |
+
forval ii = 1/9 {
|
851 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
852 |
+
}
|
853 |
+
|
854 |
+
***number of counties 1,478
|
855 |
+
qui: {
|
856 |
+
forval ii = 1/1478 {
|
857 |
+
su n_stops if county_id==`ii' & TRUMP_0==1
|
858 |
+
if r(N) != 0 {
|
859 |
+
total n_stops if county_id==`ii' & TRUMP_0==1
|
860 |
+
global stops`ii' = _b[n_stops]
|
861 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
862 |
+
}
|
863 |
+
}
|
864 |
+
}
|
865 |
+
**I drop the first for collinearity
|
866 |
+
drop TREATED_COUNTY_9
|
867 |
+
|
868 |
+
|
869 |
+
reghdfe black_ps 1.TRUMP_0 1.TRUMP_0#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
870 |
+
|
871 |
+
|
872 |
+
mat treat = 999* J(1478,2,1)
|
873 |
+
|
874 |
+
local numerator = 0
|
875 |
+
local denominator = 0
|
876 |
+
forval ii = 1/1478 {
|
877 |
+
qui: su n_stops if county_id==`ii' & TRUMP_0==1
|
878 |
+
if r(N) != 0 {
|
879 |
+
if `ii' == 9{
|
880 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0])
|
881 |
+
mat treat[`ii',2] = (${stops`ii'})
|
882 |
+
}
|
883 |
+
else {
|
884 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0] + _b[1.TRUMP_0#1.TREATED_COUNTY_`ii'])
|
885 |
+
mat treat[`ii',2] = (${stops`ii'})
|
886 |
+
}
|
887 |
+
}
|
888 |
+
}
|
889 |
+
|
890 |
+
g yy = treat[_n,1] in 1/1478
|
891 |
+
g ww = treat[_n,2] in 1/1478
|
892 |
+
replace yy = . if yy==999
|
893 |
+
replace ww = . if ww==999
|
894 |
+
|
895 |
+
keep yy ww
|
896 |
+
drop if yy==.
|
897 |
+
|
898 |
+
expand ww
|
899 |
+
egen id = group(yy)
|
900 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
901 |
+
matrix b = e(b)
|
902 |
+
matrix ci = e(ci_normal)
|
903 |
+
g beta = b[1,1] in 1
|
904 |
+
g CI_lb = ci[1,1] in 1
|
905 |
+
g CI_ub = ci[2,1] in 1
|
906 |
+
|
907 |
+
keep if _n == 1
|
908 |
+
keep beta CI_*
|
909 |
+
|
910 |
+
save "Results\SA_TRUMP_0.dta", replace
|
911 |
+
|
912 |
+
************************************************************************************************************************************
|
913 |
+
|
914 |
+
use "Data\county_day_data.dta", clear
|
915 |
+
|
916 |
+
|
917 |
+
keep if year==2015 | year==2016 | year==2017
|
918 |
+
|
919 |
+
local start = -105
|
920 |
+
local end = 105
|
921 |
+
local bin_l = 15
|
922 |
+
|
923 |
+
drop TRUMP*
|
924 |
+
forval ii = 1/9 {
|
925 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
926 |
+
}
|
927 |
+
|
928 |
+
g TRUMP_0 = 0
|
929 |
+
forval ii = 1/9 {
|
930 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
931 |
+
}
|
932 |
+
|
933 |
+
|
934 |
+
forval ii = 1(`bin_l')`end'{
|
935 |
+
local jj = `ii' + `bin_l' - 1
|
936 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
937 |
+
forval ee = 1/9 {
|
938 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
939 |
+
}
|
940 |
+
}
|
941 |
+
g TRUMP_POST_M`end' = 0
|
942 |
+
forval ii = 1/9 {
|
943 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
944 |
+
}
|
945 |
+
*
|
946 |
+
|
947 |
+
forval ii = `start'(`bin_l')0 {
|
948 |
+
if `ii' < -`bin_l' {
|
949 |
+
local jj = abs(`ii')
|
950 |
+
local zz = `jj' - `bin_l' + 1
|
951 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
952 |
+
forval ee = 1/9 {
|
953 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
954 |
+
}
|
955 |
+
}
|
956 |
+
}
|
957 |
+
*
|
958 |
+
local jj = abs(`start')
|
959 |
+
g TRUMP_PRE_M`jj' = 0
|
960 |
+
forval ii = 1/9 {
|
961 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
962 |
+
}
|
963 |
+
|
964 |
+
***number of counties 1,478
|
965 |
+
qui: {
|
966 |
+
forval ii = 1/1478 {
|
967 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
968 |
+
if r(N) != 0 {
|
969 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
970 |
+
global stops`ii' = _b[n_stops]
|
971 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
972 |
+
}
|
973 |
+
}
|
974 |
+
}
|
975 |
+
**I drop the first for collinearity
|
976 |
+
drop TREATED_COUNTY_9
|
977 |
+
|
978 |
+
reghdfe black_ps 1.TRUMP_PRE_30_16 1.TRUMP_PRE_30_16#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_M105) cluster(county_id day_id)
|
979 |
+
|
980 |
+
|
981 |
+
mat treat = 999* J(1478,2,1)
|
982 |
+
|
983 |
+
local numerator = 0
|
984 |
+
local denominator = 0
|
985 |
+
forval ii = 1/1478 {
|
986 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
987 |
+
if r(N) != 0 {
|
988 |
+
if `ii' == 9{
|
989 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16])
|
990 |
+
mat treat[`ii',2] = (${stops`ii'})
|
991 |
+
}
|
992 |
+
else {
|
993 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16] + _b[1.TRUMP_PRE_30_16#1.TREATED_COUNTY_`ii'])
|
994 |
+
mat treat[`ii',2] = (${stops`ii'})
|
995 |
+
}
|
996 |
+
}
|
997 |
+
}
|
998 |
+
|
999 |
+
g yy = treat[_n,1] in 1/1478
|
1000 |
+
g ww = treat[_n,2] in 1/1478
|
1001 |
+
replace yy = . if yy==999
|
1002 |
+
replace ww = . if ww==999
|
1003 |
+
|
1004 |
+
|
1005 |
+
|
1006 |
+
keep yy ww
|
1007 |
+
drop if yy==.
|
1008 |
+
|
1009 |
+
|
1010 |
+
expand ww
|
1011 |
+
egen id = group(yy)
|
1012 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1013 |
+
matrix b = e(b)
|
1014 |
+
matrix ci = e(ci_normal)
|
1015 |
+
g beta = b[1,1] in 1
|
1016 |
+
g CI_lb = ci[1,1] in 1
|
1017 |
+
g CI_ub = ci[2,1] in 1
|
1018 |
+
|
1019 |
+
keep if _n == 1
|
1020 |
+
keep beta CI_*
|
1021 |
+
|
1022 |
+
save "Results\SA_TRUMP_PRE_30_16.dta", replace
|
1023 |
+
|
1024 |
+
************************************************************************************************************************************
|
1025 |
+
|
1026 |
+
use "Data\county_day_data.dta", clear
|
1027 |
+
|
1028 |
+
|
1029 |
+
keep if year==2015 | year==2016 | year==2017
|
1030 |
+
|
1031 |
+
local start = -105
|
1032 |
+
local end = 105
|
1033 |
+
local bin_l = 15
|
1034 |
+
|
1035 |
+
drop TRUMP*
|
1036 |
+
forval ii = 1/9 {
|
1037 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1038 |
+
}
|
1039 |
+
|
1040 |
+
g TRUMP_0 = 0
|
1041 |
+
forval ii = 1/9 {
|
1042 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1043 |
+
}
|
1044 |
+
|
1045 |
+
|
1046 |
+
forval ii = 1(`bin_l')`end'{
|
1047 |
+
local jj = `ii' + `bin_l' - 1
|
1048 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1049 |
+
forval ee = 1/9 {
|
1050 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1051 |
+
}
|
1052 |
+
}
|
1053 |
+
g TRUMP_POST_M`end' = 0
|
1054 |
+
forval ii = 1/9 {
|
1055 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1056 |
+
}
|
1057 |
+
*
|
1058 |
+
|
1059 |
+
|
1060 |
+
forval ii = `start'(`bin_l')0 {
|
1061 |
+
if `ii' < -`bin_l' {
|
1062 |
+
local jj = abs(`ii')
|
1063 |
+
local zz = `jj' - `bin_l' + 1
|
1064 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1065 |
+
forval ee = 1/9 {
|
1066 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1067 |
+
}
|
1068 |
+
}
|
1069 |
+
}
|
1070 |
+
*
|
1071 |
+
local jj = abs(`start')
|
1072 |
+
g TRUMP_PRE_M`jj' = 0
|
1073 |
+
forval ii = 1/9 {
|
1074 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1075 |
+
}
|
1076 |
+
|
1077 |
+
***number of counties 1,478
|
1078 |
+
qui: {
|
1079 |
+
forval ii = 1/1478 {
|
1080 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
1081 |
+
if r(N) != 0 {
|
1082 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
1083 |
+
global stops`ii' = _b[n_stops]
|
1084 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1085 |
+
}
|
1086 |
+
}
|
1087 |
+
}
|
1088 |
+
**I drop the first for collinearity
|
1089 |
+
drop TREATED_COUNTY_9
|
1090 |
+
|
1091 |
+
|
1092 |
+
reghdfe black_ps 1.TRUMP_PRE_45_31 1.TRUMP_PRE_45_31#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1093 |
+
|
1094 |
+
|
1095 |
+
mat treat = 999* J(1478,2,1)
|
1096 |
+
|
1097 |
+
local numerator = 0
|
1098 |
+
local denominator = 0
|
1099 |
+
forval ii = 1/1478 {
|
1100 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
1101 |
+
if r(N) != 0 {
|
1102 |
+
if `ii' == 9{
|
1103 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31])
|
1104 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1105 |
+
}
|
1106 |
+
else {
|
1107 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31] + _b[1.TRUMP_PRE_45_31#1.TREATED_COUNTY_`ii'])
|
1108 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1109 |
+
}
|
1110 |
+
}
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
g yy = treat[_n,1] in 1/1478
|
1114 |
+
g ww = treat[_n,2] in 1/1478
|
1115 |
+
replace yy = . if yy==999
|
1116 |
+
replace ww = . if ww==999
|
1117 |
+
|
1118 |
+
|
1119 |
+
|
1120 |
+
keep yy ww
|
1121 |
+
drop if yy==.
|
1122 |
+
|
1123 |
+
|
1124 |
+
expand ww
|
1125 |
+
egen id = group(yy)
|
1126 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1127 |
+
matrix b = e(b)
|
1128 |
+
matrix ci = e(ci_normal)
|
1129 |
+
g beta = b[1,1] in 1
|
1130 |
+
g CI_lb = ci[1,1] in 1
|
1131 |
+
g CI_ub = ci[2,1] in 1
|
1132 |
+
|
1133 |
+
keep if _n == 1
|
1134 |
+
keep beta CI_*
|
1135 |
+
|
1136 |
+
save "Results\SA_TRUMP_PRE_45_31.dta", replace
|
1137 |
+
|
1138 |
+
************************************************************************************************************************************
|
1139 |
+
|
1140 |
+
use "Data\county_day_data.dta", clear
|
1141 |
+
|
1142 |
+
|
1143 |
+
keep if year==2015 | year==2016 | year==2017
|
1144 |
+
|
1145 |
+
local start = -105
|
1146 |
+
local end = 105
|
1147 |
+
local bin_l = 15
|
1148 |
+
|
1149 |
+
drop TRUMP*
|
1150 |
+
forval ii = 1/9 {
|
1151 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1152 |
+
}
|
1153 |
+
|
1154 |
+
g TRUMP_0 = 0
|
1155 |
+
forval ii = 1/9 {
|
1156 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1157 |
+
}
|
1158 |
+
|
1159 |
+
|
1160 |
+
forval ii = 1(`bin_l')`end'{
|
1161 |
+
local jj = `ii' + `bin_l' - 1
|
1162 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1163 |
+
forval ee = 1/9 {
|
1164 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1165 |
+
}
|
1166 |
+
}
|
1167 |
+
g TRUMP_POST_M`end' = 0
|
1168 |
+
forval ii = 1/9 {
|
1169 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1170 |
+
}
|
1171 |
+
*
|
1172 |
+
|
1173 |
+
|
1174 |
+
forval ii = `start'(`bin_l')0 {
|
1175 |
+
if `ii' < -`bin_l' {
|
1176 |
+
local jj = abs(`ii')
|
1177 |
+
local zz = `jj' - `bin_l' + 1
|
1178 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1179 |
+
forval ee = 1/9 {
|
1180 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1181 |
+
}
|
1182 |
+
}
|
1183 |
+
}
|
1184 |
+
*
|
1185 |
+
local jj = abs(`start')
|
1186 |
+
g TRUMP_PRE_M`jj' = 0
|
1187 |
+
forval ii = 1/9 {
|
1188 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
***number of counties 1,478
|
1192 |
+
qui: {
|
1193 |
+
forval ii = 1/1478 {
|
1194 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1195 |
+
if r(N) != 0 {
|
1196 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1197 |
+
global stops`ii' = _b[n_stops]
|
1198 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1199 |
+
}
|
1200 |
+
}
|
1201 |
+
}
|
1202 |
+
**I drop the first for collinearity
|
1203 |
+
drop TREATED_COUNTY_9
|
1204 |
+
|
1205 |
+
|
1206 |
+
reghdfe black_ps 1.TRUMP_PRE_60_46 1.TRUMP_PRE_60_46#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1207 |
+
|
1208 |
+
|
1209 |
+
mat treat = 999* J(1478,2,1)
|
1210 |
+
|
1211 |
+
local numerator = 0
|
1212 |
+
local denominator = 0
|
1213 |
+
forval ii = 1/1478 {
|
1214 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
1215 |
+
if r(N) != 0 {
|
1216 |
+
if `ii' == 9{
|
1217 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46])
|
1218 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1219 |
+
}
|
1220 |
+
else {
|
1221 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46] + _b[1.TRUMP_PRE_60_46#1.TREATED_COUNTY_`ii'])
|
1222 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1223 |
+
}
|
1224 |
+
}
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
g yy = treat[_n,1] in 1/1478
|
1228 |
+
g ww = treat[_n,2] in 1/1478
|
1229 |
+
replace yy = . if yy==999
|
1230 |
+
replace ww = . if ww==999
|
1231 |
+
|
1232 |
+
keep yy ww
|
1233 |
+
drop if yy==.
|
1234 |
+
|
1235 |
+
|
1236 |
+
expand ww
|
1237 |
+
egen id = group(yy)
|
1238 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1239 |
+
matrix b = e(b)
|
1240 |
+
matrix ci = e(ci_normal)
|
1241 |
+
g beta = b[1,1] in 1
|
1242 |
+
g CI_lb = ci[1,1] in 1
|
1243 |
+
g CI_ub = ci[2,1] in 1
|
1244 |
+
|
1245 |
+
keep if _n == 1
|
1246 |
+
keep beta CI_*
|
1247 |
+
|
1248 |
+
save "Results\SA_TRUMP_PRE_60_46.dta", replace
|
1249 |
+
|
1250 |
+
************************************************************************************************************************************
|
1251 |
+
|
1252 |
+
use "Data\county_day_data.dta", clear
|
1253 |
+
|
1254 |
+
drop TRUMP*
|
1255 |
+
forval ii = 1/9 {
|
1256 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1257 |
+
}
|
1258 |
+
|
1259 |
+
keep if year==2015 | year==2016 | year==2017
|
1260 |
+
|
1261 |
+
local start = -105
|
1262 |
+
local end = 105
|
1263 |
+
local bin_l = 15
|
1264 |
+
|
1265 |
+
g TRUMP_0 = 0
|
1266 |
+
forval ii = 1/9 {
|
1267 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1268 |
+
}
|
1269 |
+
|
1270 |
+
forval ii = 1(`bin_l')`end'{
|
1271 |
+
local jj = `ii' + `bin_l' - 1
|
1272 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1273 |
+
forval ee = 1/9 {
|
1274 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1275 |
+
}
|
1276 |
+
}
|
1277 |
+
g TRUMP_POST_M`end' = 0
|
1278 |
+
forval ii = 1/9 {
|
1279 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1280 |
+
}
|
1281 |
+
*
|
1282 |
+
|
1283 |
+
|
1284 |
+
forval ii = `start'(`bin_l')0 {
|
1285 |
+
if `ii' < -`bin_l' {
|
1286 |
+
local jj = abs(`ii')
|
1287 |
+
local zz = `jj' - `bin_l' + 1
|
1288 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1289 |
+
forval ee = 1/9 {
|
1290 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1291 |
+
}
|
1292 |
+
}
|
1293 |
+
}
|
1294 |
+
*
|
1295 |
+
local jj = abs(`start')
|
1296 |
+
g TRUMP_PRE_M`jj' = 0
|
1297 |
+
forval ii = 1/9 {
|
1298 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1299 |
+
}
|
1300 |
+
|
1301 |
+
***number of counties 1,478
|
1302 |
+
qui: {
|
1303 |
+
forval ii = 1/1478 {
|
1304 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1305 |
+
if r(N) != 0 {
|
1306 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1307 |
+
global stops`ii' = _b[n_stops]
|
1308 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1309 |
+
}
|
1310 |
+
}
|
1311 |
+
}
|
1312 |
+
**I drop the first for collinearity
|
1313 |
+
drop TREATED_COUNTY_9
|
1314 |
+
|
1315 |
+
|
1316 |
+
reghdfe black_ps 1.TRUMP_PRE_75_61 1.TRUMP_PRE_75_61#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1317 |
+
|
1318 |
+
|
1319 |
+
mat treat = 999* J(1478,2,1)
|
1320 |
+
|
1321 |
+
local numerator = 0
|
1322 |
+
local denominator = 0
|
1323 |
+
forval ii = 1/1478 {
|
1324 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
1325 |
+
if r(N) != 0 {
|
1326 |
+
if `ii' == 9{
|
1327 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61])
|
1328 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1329 |
+
}
|
1330 |
+
else {
|
1331 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61] + _b[1.TRUMP_PRE_75_61#1.TREATED_COUNTY_`ii'])
|
1332 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
}
|
1336 |
+
|
1337 |
+
g yy = treat[_n,1] in 1/1478
|
1338 |
+
g ww = treat[_n,2] in 1/1478
|
1339 |
+
replace yy = . if yy==999
|
1340 |
+
replace ww = . if ww==999
|
1341 |
+
|
1342 |
+
keep yy ww
|
1343 |
+
drop if yy==.
|
1344 |
+
|
1345 |
+
|
1346 |
+
expand ww
|
1347 |
+
egen id = group(yy)
|
1348 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1349 |
+
matrix b = e(b)
|
1350 |
+
matrix ci = e(ci_normal)
|
1351 |
+
g beta = b[1,1] in 1
|
1352 |
+
g CI_lb = ci[1,1] in 1
|
1353 |
+
g CI_ub = ci[2,1] in 1
|
1354 |
+
|
1355 |
+
keep if _n == 1
|
1356 |
+
keep beta CI_*
|
1357 |
+
|
1358 |
+
save "Results\SA_TRUMP_PRE_75_61.dta", replace
|
1359 |
+
|
1360 |
+
************************************************************************************************************************************
|
1361 |
+
|
1362 |
+
use "Data\county_day_data.dta", clear
|
1363 |
+
|
1364 |
+
drop TRUMP*
|
1365 |
+
forval ii = 1/9 {
|
1366 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1367 |
+
}
|
1368 |
+
|
1369 |
+
keep if year==2015 | year==2016 | year==2017
|
1370 |
+
|
1371 |
+
local start = -105
|
1372 |
+
local end = 105
|
1373 |
+
local bin_l = 15
|
1374 |
+
|
1375 |
+
g TRUMP_0 = 0
|
1376 |
+
forval ii = 1/9 {
|
1377 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1378 |
+
}
|
1379 |
+
|
1380 |
+
|
1381 |
+
forval ii = 1(`bin_l')`end'{
|
1382 |
+
local jj = `ii' + `bin_l' - 1
|
1383 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1384 |
+
forval ee = 1/9 {
|
1385 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1386 |
+
}
|
1387 |
+
}
|
1388 |
+
g TRUMP_POST_M`end' = 0
|
1389 |
+
forval ii = 1/9 {
|
1390 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1391 |
+
}
|
1392 |
+
*
|
1393 |
+
|
1394 |
+
forval ii = `start'(`bin_l')0 {
|
1395 |
+
if `ii' < -`bin_l' {
|
1396 |
+
local jj = abs(`ii')
|
1397 |
+
local zz = `jj' - `bin_l' + 1
|
1398 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1399 |
+
forval ee = 1/9 {
|
1400 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1401 |
+
}
|
1402 |
+
}
|
1403 |
+
}
|
1404 |
+
*
|
1405 |
+
local jj = abs(`start')
|
1406 |
+
g TRUMP_PRE_M`jj' = 0
|
1407 |
+
forval ii = 1/9 {
|
1408 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1409 |
+
}
|
1410 |
+
|
1411 |
+
***number of counties 1,478
|
1412 |
+
qui: {
|
1413 |
+
forval ii = 1/1478 {
|
1414 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1415 |
+
if r(N) != 0 {
|
1416 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1417 |
+
global stops`ii' = _b[n_stops]
|
1418 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1419 |
+
}
|
1420 |
+
}
|
1421 |
+
}
|
1422 |
+
**I drop the first for collinearity
|
1423 |
+
drop TREATED_COUNTY_9
|
1424 |
+
|
1425 |
+
reghdfe black_ps 1.TRUMP_PRE_90_76 1.TRUMP_PRE_90_76#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1426 |
+
|
1427 |
+
|
1428 |
+
mat treat = 999* J(1478,2,1)
|
1429 |
+
|
1430 |
+
local numerator = 0
|
1431 |
+
local denominator = 0
|
1432 |
+
forval ii = 1/1478 {
|
1433 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
1434 |
+
if r(N) != 0 {
|
1435 |
+
if `ii' == 9{
|
1436 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76])
|
1437 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1438 |
+
}
|
1439 |
+
else {
|
1440 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76] + _b[1.TRUMP_PRE_90_76#1.TREATED_COUNTY_`ii'])
|
1441 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1442 |
+
}
|
1443 |
+
}
|
1444 |
+
}
|
1445 |
+
|
1446 |
+
g yy = treat[_n,1] in 1/1478
|
1447 |
+
g ww = treat[_n,2] in 1/1478
|
1448 |
+
replace yy = . if yy==999
|
1449 |
+
replace ww = . if ww==999
|
1450 |
+
|
1451 |
+
keep yy ww
|
1452 |
+
drop if yy==.
|
1453 |
+
|
1454 |
+
expand ww
|
1455 |
+
egen id = group(yy)
|
1456 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1457 |
+
matrix b = e(b)
|
1458 |
+
matrix ci = e(ci_normal)
|
1459 |
+
g beta = b[1,1] in 1
|
1460 |
+
g CI_lb = ci[1,1] in 1
|
1461 |
+
g CI_ub = ci[2,1] in 1
|
1462 |
+
|
1463 |
+
keep if _n == 1
|
1464 |
+
keep beta CI_*
|
1465 |
+
|
1466 |
+
save "Results\SA_TRUMP_PRE_90_76.dta", replace
|
1467 |
+
|
1468 |
+
************************************************************************************************************************************
|
1469 |
+
|
1470 |
+
use "Data\county_day_data.dta", clear
|
1471 |
+
|
1472 |
+
|
1473 |
+
drop TRUMP*
|
1474 |
+
forval ii = 1/9 {
|
1475 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1476 |
+
}
|
1477 |
+
|
1478 |
+
|
1479 |
+
keep if year==2015 | year==2016 | year==2017
|
1480 |
+
|
1481 |
+
local start = -105
|
1482 |
+
local end = 105
|
1483 |
+
local bin_l = 15
|
1484 |
+
|
1485 |
+
|
1486 |
+
g TRUMP_0 = 0
|
1487 |
+
forval ii = 1/9 {
|
1488 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1489 |
+
}
|
1490 |
+
|
1491 |
+
|
1492 |
+
forval ii = 1(`bin_l')`end'{
|
1493 |
+
local jj = `ii' + `bin_l' - 1
|
1494 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1495 |
+
forval ee = 1/9 {
|
1496 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1497 |
+
}
|
1498 |
+
}
|
1499 |
+
g TRUMP_POST_M`end' = 0
|
1500 |
+
forval ii = 1/9 {
|
1501 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1502 |
+
}
|
1503 |
+
*
|
1504 |
+
|
1505 |
+
|
1506 |
+
forval ii = `start'(`bin_l')0 {
|
1507 |
+
if `ii' < -`bin_l' {
|
1508 |
+
local jj = abs(`ii')
|
1509 |
+
local zz = `jj' - `bin_l' + 1
|
1510 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1511 |
+
forval ee = 1/9 {
|
1512 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1513 |
+
}
|
1514 |
+
}
|
1515 |
+
}
|
1516 |
+
*
|
1517 |
+
local jj = abs(`start')
|
1518 |
+
g TRUMP_PRE_M`jj' = 0
|
1519 |
+
forval ii = 1/9 {
|
1520 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1521 |
+
}
|
1522 |
+
|
1523 |
+
***number of counties 1,478
|
1524 |
+
qui: {
|
1525 |
+
forval ii = 1/1478 {
|
1526 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1527 |
+
if r(N) != 0 {
|
1528 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1529 |
+
global stops`ii' = _b[n_stops]
|
1530 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1531 |
+
}
|
1532 |
+
}
|
1533 |
+
}
|
1534 |
+
**I drop the first for collinearity
|
1535 |
+
drop TREATED_COUNTY_9
|
1536 |
+
|
1537 |
+
|
1538 |
+
reghdfe black_ps 1.TRUMP_PRE_105_91 1.TRUMP_PRE_105_91#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id i.county_id#c.day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1539 |
+
|
1540 |
+
|
1541 |
+
mat treat = 999* J(1478,2,1)
|
1542 |
+
|
1543 |
+
local numerator = 0
|
1544 |
+
local denominator = 0
|
1545 |
+
forval ii = 1/1478 {
|
1546 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
1547 |
+
if r(N) != 0 {
|
1548 |
+
if `ii' == 9{
|
1549 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91])
|
1550 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1551 |
+
}
|
1552 |
+
else {
|
1553 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91] + _b[1.TRUMP_PRE_105_91#1.TREATED_COUNTY_`ii'])
|
1554 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1555 |
+
}
|
1556 |
+
}
|
1557 |
+
}
|
1558 |
+
|
1559 |
+
g yy = treat[_n,1] in 1/1478
|
1560 |
+
g ww = treat[_n,2] in 1/1478
|
1561 |
+
replace yy = . if yy==999
|
1562 |
+
replace ww = . if ww==999
|
1563 |
+
|
1564 |
+
|
1565 |
+
|
1566 |
+
keep yy ww
|
1567 |
+
drop if yy==.
|
1568 |
+
|
1569 |
+
|
1570 |
+
expand ww
|
1571 |
+
egen id = group(yy)
|
1572 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1573 |
+
matrix b = e(b)
|
1574 |
+
matrix ci = e(ci_normal)
|
1575 |
+
g beta = b[1,1] in 1
|
1576 |
+
g CI_lb = ci[1,1] in 1
|
1577 |
+
g CI_ub = ci[2,1] in 1
|
1578 |
+
|
1579 |
+
keep if _n == 1
|
1580 |
+
keep beta CI_*
|
1581 |
+
|
1582 |
+
save "Results\SA_TRUMP_PRE_105_91.dta", replace
|
1583 |
+
|
1584 |
+
|
1585 |
+
|
1586 |
+
use "Data\county_day_data.dta", clear
|
1587 |
+
|
1588 |
+
|
1589 |
+
drop TRUMP*
|
1590 |
+
forval ii = 1/9 {
|
1591 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1592 |
+
}
|
1593 |
+
|
1594 |
+
|
1595 |
+
keep if year==2015 | year==2016 | year==2017
|
1596 |
+
|
1597 |
+
local start = -105
|
1598 |
+
local end = 105
|
1599 |
+
local bin_l = 15
|
1600 |
+
|
1601 |
+
g TRUMP_0 = 0
|
1602 |
+
forval ii = 1/9 {
|
1603 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1604 |
+
}
|
1605 |
+
|
1606 |
+
|
1607 |
+
forval ii = 1(`bin_l')`end'{
|
1608 |
+
local jj = `ii' + `bin_l' - 1
|
1609 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1610 |
+
forval ee = 1/9 {
|
1611 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1612 |
+
}
|
1613 |
+
}
|
1614 |
+
g TRUMP_POST_M`end' = 0
|
1615 |
+
forval ii = 1/9 {
|
1616 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1617 |
+
}
|
1618 |
+
*
|
1619 |
+
|
1620 |
+
|
1621 |
+
forval ii = `start'(`bin_l')0 {
|
1622 |
+
if `ii' < -`bin_l' {
|
1623 |
+
local jj = abs(`ii')
|
1624 |
+
local zz = `jj' - `bin_l' + 1
|
1625 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1626 |
+
forval ee = 1/9 {
|
1627 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1628 |
+
}
|
1629 |
+
}
|
1630 |
+
}
|
1631 |
+
*
|
1632 |
+
local jj = abs(`start')
|
1633 |
+
g TRUMP_PRE_M`jj' = 0
|
1634 |
+
forval ii = 1/9 {
|
1635 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1636 |
+
}
|
1637 |
+
|
1638 |
+
***number of counties 1,478
|
1639 |
+
qui: {
|
1640 |
+
forval ii = 1/1478 {
|
1641 |
+
su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1642 |
+
if r(N) != 0 {
|
1643 |
+
total n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1644 |
+
global stops`ii' = _b[n_stops]
|
1645 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1646 |
+
}
|
1647 |
+
}
|
1648 |
+
}
|
1649 |
+
**I drop the first for collinearity
|
1650 |
+
drop TREATED_COUNTY_9
|
1651 |
+
|
1652 |
+
|
1653 |
+
reghdfe black_ps 1.TRUMP_POST_1_15 1.TRUMP_POST_1_15#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1654 |
+
|
1655 |
+
|
1656 |
+
mat treat = 999* J(1478,2,1)
|
1657 |
+
|
1658 |
+
local numerator = 0
|
1659 |
+
local denominator = 0
|
1660 |
+
forval ii = 1/1478 {
|
1661 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_1_15==1
|
1662 |
+
if r(N) != 0 {
|
1663 |
+
if `ii' == 9{
|
1664 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15])
|
1665 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1666 |
+
}
|
1667 |
+
else {
|
1668 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_1_15] + _b[1.TRUMP_POST_1_15#1.TREATED_COUNTY_`ii'])
|
1669 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1670 |
+
}
|
1671 |
+
}
|
1672 |
+
}
|
1673 |
+
|
1674 |
+
g yy = treat[_n,1] in 1/1478
|
1675 |
+
g ww = treat[_n,2] in 1/1478
|
1676 |
+
replace yy = . if yy==999
|
1677 |
+
replace ww = . if ww==999
|
1678 |
+
|
1679 |
+
|
1680 |
+
|
1681 |
+
keep yy ww
|
1682 |
+
drop if yy==.
|
1683 |
+
|
1684 |
+
|
1685 |
+
expand ww
|
1686 |
+
egen id = group(yy)
|
1687 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1688 |
+
matrix b = e(b)
|
1689 |
+
matrix ci = e(ci_normal)
|
1690 |
+
g beta = b[1,1] in 1
|
1691 |
+
g CI_lb = ci[1,1] in 1
|
1692 |
+
g CI_ub = ci[2,1] in 1
|
1693 |
+
|
1694 |
+
keep if _n == 1
|
1695 |
+
keep beta CI_*
|
1696 |
+
|
1697 |
+
save "Results\SA_TRUMP_POST_1_15_NT.dta", replace
|
1698 |
+
|
1699 |
+
************************************************************************************************************************************
|
1700 |
+
|
1701 |
+
use "Data\county_day_data.dta", clear
|
1702 |
+
|
1703 |
+
drop TRUMP*
|
1704 |
+
forval ii = 1/9 {
|
1705 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
|
1709 |
+
keep if year==2015 | year==2016 | year==2017
|
1710 |
+
|
1711 |
+
local start = -105
|
1712 |
+
local end = 105
|
1713 |
+
local bin_l = 15
|
1714 |
+
|
1715 |
+
|
1716 |
+
|
1717 |
+
g TRUMP_0 = 0
|
1718 |
+
forval ii = 1/9 {
|
1719 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1720 |
+
}
|
1721 |
+
|
1722 |
+
|
1723 |
+
forval ii = 1(`bin_l')`end'{
|
1724 |
+
local jj = `ii' + `bin_l' - 1
|
1725 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1726 |
+
forval ee = 1/9 {
|
1727 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1728 |
+
}
|
1729 |
+
}
|
1730 |
+
g TRUMP_POST_M`end' = 0
|
1731 |
+
forval ii = 1/9 {
|
1732 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1733 |
+
}
|
1734 |
+
*
|
1735 |
+
|
1736 |
+
|
1737 |
+
forval ii = `start'(`bin_l')0 {
|
1738 |
+
if `ii' < -`bin_l' {
|
1739 |
+
local jj = abs(`ii')
|
1740 |
+
local zz = `jj' - `bin_l' + 1
|
1741 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1742 |
+
forval ee = 1/9 {
|
1743 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1744 |
+
}
|
1745 |
+
}
|
1746 |
+
}
|
1747 |
+
*
|
1748 |
+
local jj = abs(`start')
|
1749 |
+
g TRUMP_PRE_M`jj' = 0
|
1750 |
+
forval ii = 1/9 {
|
1751 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1752 |
+
}
|
1753 |
+
|
1754 |
+
***number of counties 1,478
|
1755 |
+
qui: {
|
1756 |
+
forval ii = 1/1478 {
|
1757 |
+
su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1758 |
+
if r(N) != 0 {
|
1759 |
+
total n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1760 |
+
global stops`ii' = _b[n_stops]
|
1761 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1762 |
+
}
|
1763 |
+
}
|
1764 |
+
}
|
1765 |
+
**I drop the first for collinearity
|
1766 |
+
drop TREATED_COUNTY_9
|
1767 |
+
|
1768 |
+
|
1769 |
+
reghdfe black_ps 1.TRUMP_POST_16_30 1.TRUMP_POST_16_30#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1770 |
+
|
1771 |
+
|
1772 |
+
mat treat = 999* J(1478,2,1)
|
1773 |
+
|
1774 |
+
local numerator = 0
|
1775 |
+
local denominator = 0
|
1776 |
+
forval ii = 1/1478 {
|
1777 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_16_30==1
|
1778 |
+
if r(N) != 0 {
|
1779 |
+
if `ii' == 9{
|
1780 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30])
|
1781 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1782 |
+
}
|
1783 |
+
else {
|
1784 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_16_30] + _b[1.TRUMP_POST_16_30#1.TREATED_COUNTY_`ii'])
|
1785 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1786 |
+
}
|
1787 |
+
}
|
1788 |
+
}
|
1789 |
+
|
1790 |
+
g yy = treat[_n,1] in 1/1478
|
1791 |
+
g ww = treat[_n,2] in 1/1478
|
1792 |
+
replace yy = . if yy==999
|
1793 |
+
replace ww = . if ww==999
|
1794 |
+
|
1795 |
+
|
1796 |
+
|
1797 |
+
keep yy ww
|
1798 |
+
drop if yy==.
|
1799 |
+
|
1800 |
+
|
1801 |
+
expand ww
|
1802 |
+
egen id = group(yy)
|
1803 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1804 |
+
matrix b = e(b)
|
1805 |
+
matrix ci = e(ci_normal)
|
1806 |
+
g beta = b[1,1] in 1
|
1807 |
+
g CI_lb = ci[1,1] in 1
|
1808 |
+
g CI_ub = ci[2,1] in 1
|
1809 |
+
|
1810 |
+
keep if _n == 1
|
1811 |
+
keep beta CI_*
|
1812 |
+
|
1813 |
+
save "Results\SA_TRUMP_POST_16_30_NT.dta", replace
|
1814 |
+
|
1815 |
+
************************************************************************************************************************************
|
1816 |
+
|
1817 |
+
use "Data\county_day_data.dta", clear
|
1818 |
+
|
1819 |
+
drop TRUMP*
|
1820 |
+
forval ii = 1/9 {
|
1821 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1822 |
+
}
|
1823 |
+
|
1824 |
+
|
1825 |
+
keep if year==2015 | year==2016 | year==2017
|
1826 |
+
|
1827 |
+
local start = -105
|
1828 |
+
local end = 105
|
1829 |
+
local bin_l = 15
|
1830 |
+
|
1831 |
+
g TRUMP_0 = 0
|
1832 |
+
forval ii = 1/9 {
|
1833 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
|
1837 |
+
forval ii = 1(`bin_l')`end'{
|
1838 |
+
local jj = `ii' + `bin_l' - 1
|
1839 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1840 |
+
forval ee = 1/9 {
|
1841 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1842 |
+
}
|
1843 |
+
}
|
1844 |
+
g TRUMP_POST_M`end' = 0
|
1845 |
+
forval ii = 1/9 {
|
1846 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1847 |
+
}
|
1848 |
+
*
|
1849 |
+
|
1850 |
+
|
1851 |
+
forval ii = `start'(`bin_l')0 {
|
1852 |
+
if `ii' < -`bin_l' {
|
1853 |
+
local jj = abs(`ii')
|
1854 |
+
local zz = `jj' - `bin_l' + 1
|
1855 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1856 |
+
forval ee = 1/9 {
|
1857 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1858 |
+
}
|
1859 |
+
}
|
1860 |
+
}
|
1861 |
+
*
|
1862 |
+
local jj = abs(`start')
|
1863 |
+
g TRUMP_PRE_M`jj' = 0
|
1864 |
+
forval ii = 1/9 {
|
1865 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1866 |
+
}
|
1867 |
+
|
1868 |
+
***number of counties 1,478
|
1869 |
+
qui: {
|
1870 |
+
forval ii = 1/1478 {
|
1871 |
+
su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1872 |
+
if r(N) != 0 {
|
1873 |
+
total n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1874 |
+
global stops`ii' = _b[n_stops]
|
1875 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1876 |
+
}
|
1877 |
+
}
|
1878 |
+
}
|
1879 |
+
**I drop the first for collinearity
|
1880 |
+
drop TREATED_COUNTY_9
|
1881 |
+
|
1882 |
+
|
1883 |
+
reghdfe black_ps 1.TRUMP_POST_31_45 1.TRUMP_POST_31_45#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
1884 |
+
|
1885 |
+
|
1886 |
+
mat treat = 999* J(1478,2,1)
|
1887 |
+
|
1888 |
+
local numerator = 0
|
1889 |
+
local denominator = 0
|
1890 |
+
forval ii = 1/1478 {
|
1891 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_31_45==1
|
1892 |
+
if r(N) != 0 {
|
1893 |
+
if `ii' == 9{
|
1894 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45])
|
1895 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1896 |
+
}
|
1897 |
+
else {
|
1898 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_31_45] + _b[1.TRUMP_POST_31_45#1.TREATED_COUNTY_`ii'])
|
1899 |
+
mat treat[`ii',2] = (${stops`ii'})
|
1900 |
+
}
|
1901 |
+
}
|
1902 |
+
}
|
1903 |
+
|
1904 |
+
g yy = treat[_n,1] in 1/1478
|
1905 |
+
g ww = treat[_n,2] in 1/1478
|
1906 |
+
replace yy = . if yy==999
|
1907 |
+
replace ww = . if ww==999
|
1908 |
+
|
1909 |
+
|
1910 |
+
|
1911 |
+
keep yy ww
|
1912 |
+
drop if yy==.
|
1913 |
+
|
1914 |
+
|
1915 |
+
expand ww
|
1916 |
+
egen id = group(yy)
|
1917 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
1918 |
+
matrix b = e(b)
|
1919 |
+
matrix ci = e(ci_normal)
|
1920 |
+
g beta = b[1,1] in 1
|
1921 |
+
g CI_lb = ci[1,1] in 1
|
1922 |
+
g CI_ub = ci[2,1] in 1
|
1923 |
+
|
1924 |
+
keep if _n == 1
|
1925 |
+
keep beta CI_*
|
1926 |
+
|
1927 |
+
save "Results\SA_TRUMP_POST_31_45_NT.dta", replace
|
1928 |
+
|
1929 |
+
************************************************************************************************************************************
|
1930 |
+
|
1931 |
+
use "Data\county_day_data.dta", clear
|
1932 |
+
|
1933 |
+
|
1934 |
+
drop TRUMP*
|
1935 |
+
forval ii = 1/9 {
|
1936 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
1937 |
+
}
|
1938 |
+
|
1939 |
+
keep if year==2015 | year==2016 | year==2017
|
1940 |
+
|
1941 |
+
local start = -105
|
1942 |
+
local end = 105
|
1943 |
+
local bin_l = 15
|
1944 |
+
|
1945 |
+
|
1946 |
+
|
1947 |
+
g TRUMP_0 = 0
|
1948 |
+
forval ii = 1/9 {
|
1949 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
1950 |
+
}
|
1951 |
+
|
1952 |
+
|
1953 |
+
forval ii = 1(`bin_l')`end'{
|
1954 |
+
local jj = `ii' + `bin_l' - 1
|
1955 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
1956 |
+
forval ee = 1/9 {
|
1957 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
1958 |
+
}
|
1959 |
+
}
|
1960 |
+
g TRUMP_POST_M`end' = 0
|
1961 |
+
forval ii = 1/9 {
|
1962 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
1963 |
+
}
|
1964 |
+
*
|
1965 |
+
|
1966 |
+
|
1967 |
+
forval ii = `start'(`bin_l')0 {
|
1968 |
+
if `ii' < -`bin_l' {
|
1969 |
+
local jj = abs(`ii')
|
1970 |
+
local zz = `jj' - `bin_l' + 1
|
1971 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
1972 |
+
forval ee = 1/9 {
|
1973 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
1974 |
+
}
|
1975 |
+
}
|
1976 |
+
}
|
1977 |
+
*
|
1978 |
+
local jj = abs(`start')
|
1979 |
+
g TRUMP_PRE_M`jj' = 0
|
1980 |
+
forval ii = 1/9 {
|
1981 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
1982 |
+
}
|
1983 |
+
|
1984 |
+
***number of counties 1,478
|
1985 |
+
qui: {
|
1986 |
+
forval ii = 1/1478 {
|
1987 |
+
su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
1988 |
+
if r(N) != 0 {
|
1989 |
+
total n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
1990 |
+
global stops`ii' = _b[n_stops]
|
1991 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
1992 |
+
}
|
1993 |
+
}
|
1994 |
+
}
|
1995 |
+
**I drop the first for collinearity
|
1996 |
+
drop TREATED_COUNTY_9
|
1997 |
+
|
1998 |
+
|
1999 |
+
reghdfe black_ps 1.TRUMP_POST_46_60 1.TRUMP_POST_46_60#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2000 |
+
|
2001 |
+
|
2002 |
+
mat treat = 999* J(1478,2,1)
|
2003 |
+
|
2004 |
+
local numerator = 0
|
2005 |
+
local denominator = 0
|
2006 |
+
forval ii = 1/1478 {
|
2007 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_46_60==1
|
2008 |
+
if r(N) != 0 {
|
2009 |
+
if `ii' == 9{
|
2010 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60])
|
2011 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2012 |
+
}
|
2013 |
+
else {
|
2014 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_46_60] + _b[1.TRUMP_POST_46_60#1.TREATED_COUNTY_`ii'])
|
2015 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2016 |
+
}
|
2017 |
+
}
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
g yy = treat[_n,1] in 1/1478
|
2021 |
+
g ww = treat[_n,2] in 1/1478
|
2022 |
+
replace yy = . if yy==999
|
2023 |
+
replace ww = . if ww==999
|
2024 |
+
|
2025 |
+
|
2026 |
+
|
2027 |
+
keep yy ww
|
2028 |
+
drop if yy==.
|
2029 |
+
|
2030 |
+
|
2031 |
+
expand ww
|
2032 |
+
egen id = group(yy)
|
2033 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2034 |
+
matrix b = e(b)
|
2035 |
+
matrix ci = e(ci_normal)
|
2036 |
+
g beta = b[1,1] in 1
|
2037 |
+
g CI_lb = ci[1,1] in 1
|
2038 |
+
g CI_ub = ci[2,1] in 1
|
2039 |
+
|
2040 |
+
keep if _n == 1
|
2041 |
+
keep beta CI_*
|
2042 |
+
|
2043 |
+
save "Results\SA_TRUMP_POST_46_60_NT.dta", replace
|
2044 |
+
|
2045 |
+
************************************************************************************************************************************
|
2046 |
+
|
2047 |
+
use "Data\county_day_data.dta", clear
|
2048 |
+
|
2049 |
+
|
2050 |
+
|
2051 |
+
drop TRUMP*
|
2052 |
+
forval ii = 1/9 {
|
2053 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2054 |
+
}
|
2055 |
+
|
2056 |
+
keep if year==2015 | year==2016 | year==2017
|
2057 |
+
|
2058 |
+
local start = -105
|
2059 |
+
local end = 105
|
2060 |
+
local bin_l = 15
|
2061 |
+
|
2062 |
+
g TRUMP_0 = 0
|
2063 |
+
forval ii = 1/9 {
|
2064 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2065 |
+
}
|
2066 |
+
|
2067 |
+
|
2068 |
+
forval ii = 1(`bin_l')`end'{
|
2069 |
+
local jj = `ii' + `bin_l' - 1
|
2070 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2071 |
+
forval ee = 1/9 {
|
2072 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2073 |
+
}
|
2074 |
+
}
|
2075 |
+
g TRUMP_POST_M`end' = 0
|
2076 |
+
forval ii = 1/9 {
|
2077 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2078 |
+
}
|
2079 |
+
*
|
2080 |
+
|
2081 |
+
|
2082 |
+
forval ii = `start'(`bin_l')0 {
|
2083 |
+
if `ii' < -`bin_l' {
|
2084 |
+
local jj = abs(`ii')
|
2085 |
+
local zz = `jj' - `bin_l' + 1
|
2086 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2087 |
+
forval ee = 1/9 {
|
2088 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2089 |
+
}
|
2090 |
+
}
|
2091 |
+
}
|
2092 |
+
*
|
2093 |
+
local jj = abs(`start')
|
2094 |
+
g TRUMP_PRE_M`jj' = 0
|
2095 |
+
forval ii = 1/9 {
|
2096 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2097 |
+
}
|
2098 |
+
|
2099 |
+
***number of counties 1,478
|
2100 |
+
qui: {
|
2101 |
+
forval ii = 1/1478 {
|
2102 |
+
su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
2103 |
+
if r(N) != 0 {
|
2104 |
+
total n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
2105 |
+
global stops`ii' = _b[n_stops]
|
2106 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2107 |
+
}
|
2108 |
+
}
|
2109 |
+
}
|
2110 |
+
**I drop the first for collinearity
|
2111 |
+
drop TREATED_COUNTY_9
|
2112 |
+
|
2113 |
+
|
2114 |
+
reghdfe black_ps 1.TRUMP_POST_61_75 1.TRUMP_POST_61_75#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2115 |
+
|
2116 |
+
|
2117 |
+
mat treat = 999* J(1478,2,1)
|
2118 |
+
|
2119 |
+
local numerator = 0
|
2120 |
+
local denominator = 0
|
2121 |
+
forval ii = 1/1478 {
|
2122 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_61_75==1
|
2123 |
+
if r(N) != 0 {
|
2124 |
+
if `ii' == 9{
|
2125 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75])
|
2126 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2127 |
+
}
|
2128 |
+
else {
|
2129 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_61_75] + _b[1.TRUMP_POST_61_75#1.TREATED_COUNTY_`ii'])
|
2130 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2131 |
+
}
|
2132 |
+
}
|
2133 |
+
}
|
2134 |
+
|
2135 |
+
g yy = treat[_n,1] in 1/1478
|
2136 |
+
g ww = treat[_n,2] in 1/1478
|
2137 |
+
replace yy = . if yy==999
|
2138 |
+
replace ww = . if ww==999
|
2139 |
+
|
2140 |
+
|
2141 |
+
|
2142 |
+
keep yy ww
|
2143 |
+
drop if yy==.
|
2144 |
+
|
2145 |
+
|
2146 |
+
expand ww
|
2147 |
+
egen id = group(yy)
|
2148 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2149 |
+
matrix b = e(b)
|
2150 |
+
matrix ci = e(ci_normal)
|
2151 |
+
g beta = b[1,1] in 1
|
2152 |
+
g CI_lb = ci[1,1] in 1
|
2153 |
+
g CI_ub = ci[2,1] in 1
|
2154 |
+
|
2155 |
+
keep if _n == 1
|
2156 |
+
keep beta CI_*
|
2157 |
+
|
2158 |
+
save "Results\SA_TRUMP_POST_61_75_NT.dta", replace
|
2159 |
+
|
2160 |
+
************************************************************************************************************************************
|
2161 |
+
|
2162 |
+
use "Data\county_day_data.dta", clear
|
2163 |
+
|
2164 |
+
|
2165 |
+
drop TRUMP*
|
2166 |
+
forval ii = 1/9 {
|
2167 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2168 |
+
}
|
2169 |
+
|
2170 |
+
|
2171 |
+
keep if year==2015 | year==2016 | year==2017
|
2172 |
+
|
2173 |
+
local start = -105
|
2174 |
+
local end = 105
|
2175 |
+
local bin_l = 15
|
2176 |
+
|
2177 |
+
g TRUMP_0 = 0
|
2178 |
+
forval ii = 1/9 {
|
2179 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2180 |
+
}
|
2181 |
+
|
2182 |
+
|
2183 |
+
forval ii = 1(`bin_l')`end'{
|
2184 |
+
local jj = `ii' + `bin_l' - 1
|
2185 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2186 |
+
forval ee = 1/9 {
|
2187 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2188 |
+
}
|
2189 |
+
}
|
2190 |
+
g TRUMP_POST_M`end' = 0
|
2191 |
+
forval ii = 1/9 {
|
2192 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2193 |
+
}
|
2194 |
+
*
|
2195 |
+
|
2196 |
+
|
2197 |
+
forval ii = `start'(`bin_l')0 {
|
2198 |
+
if `ii' < -`bin_l' {
|
2199 |
+
local jj = abs(`ii')
|
2200 |
+
local zz = `jj' - `bin_l' + 1
|
2201 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2202 |
+
forval ee = 1/9 {
|
2203 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2204 |
+
}
|
2205 |
+
}
|
2206 |
+
}
|
2207 |
+
*
|
2208 |
+
local jj = abs(`start')
|
2209 |
+
g TRUMP_PRE_M`jj' = 0
|
2210 |
+
forval ii = 1/9 {
|
2211 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2212 |
+
}
|
2213 |
+
|
2214 |
+
***number of counties 1,478
|
2215 |
+
qui: {
|
2216 |
+
forval ii = 1/1478 {
|
2217 |
+
su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
2218 |
+
if r(N) != 0 {
|
2219 |
+
total n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
2220 |
+
global stops`ii' = _b[n_stops]
|
2221 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2222 |
+
}
|
2223 |
+
}
|
2224 |
+
}
|
2225 |
+
**I drop the first for collinearity
|
2226 |
+
drop TREATED_COUNTY_9
|
2227 |
+
|
2228 |
+
|
2229 |
+
reghdfe black_ps 1.TRUMP_POST_76_90 1.TRUMP_POST_76_90#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2230 |
+
|
2231 |
+
|
2232 |
+
mat treat = 999* J(1478,2,1)
|
2233 |
+
|
2234 |
+
local numerator = 0
|
2235 |
+
local denominator = 0
|
2236 |
+
forval ii = 1/1478 {
|
2237 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_76_90==1
|
2238 |
+
if r(N) != 0 {
|
2239 |
+
if `ii' == 9{
|
2240 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90])
|
2241 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2242 |
+
}
|
2243 |
+
else {
|
2244 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_76_90] + _b[1.TRUMP_POST_76_90#1.TREATED_COUNTY_`ii'])
|
2245 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2246 |
+
}
|
2247 |
+
}
|
2248 |
+
}
|
2249 |
+
|
2250 |
+
g yy = treat[_n,1] in 1/1478
|
2251 |
+
g ww = treat[_n,2] in 1/1478
|
2252 |
+
replace yy = . if yy==999
|
2253 |
+
replace ww = . if ww==999
|
2254 |
+
|
2255 |
+
|
2256 |
+
|
2257 |
+
keep yy ww
|
2258 |
+
drop if yy==.
|
2259 |
+
|
2260 |
+
|
2261 |
+
expand ww
|
2262 |
+
egen id = group(yy)
|
2263 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2264 |
+
matrix b = e(b)
|
2265 |
+
matrix ci = e(ci_normal)
|
2266 |
+
g beta = b[1,1] in 1
|
2267 |
+
g CI_lb = ci[1,1] in 1
|
2268 |
+
g CI_ub = ci[2,1] in 1
|
2269 |
+
|
2270 |
+
keep if _n == 1
|
2271 |
+
keep beta CI_*
|
2272 |
+
|
2273 |
+
save "Results\SA_TRUMP_POST_76_90_NT.dta", replace
|
2274 |
+
|
2275 |
+
************************************************************************************************************************************
|
2276 |
+
|
2277 |
+
use "Data\county_day_data.dta", clear
|
2278 |
+
|
2279 |
+
|
2280 |
+
drop TRUMP*
|
2281 |
+
forval ii = 1/9 {
|
2282 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2283 |
+
}
|
2284 |
+
|
2285 |
+
|
2286 |
+
keep if year==2015 | year==2016 | year==2017
|
2287 |
+
|
2288 |
+
local start = -105
|
2289 |
+
local end = 105
|
2290 |
+
local bin_l = 15
|
2291 |
+
|
2292 |
+
|
2293 |
+
g TRUMP_0 = 0
|
2294 |
+
forval ii = 1/9 {
|
2295 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2296 |
+
}
|
2297 |
+
|
2298 |
+
|
2299 |
+
forval ii = 1(`bin_l')`end'{
|
2300 |
+
local jj = `ii' + `bin_l' - 1
|
2301 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2302 |
+
forval ee = 1/9 {
|
2303 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2304 |
+
}
|
2305 |
+
}
|
2306 |
+
g TRUMP_POST_M`end' = 0
|
2307 |
+
forval ii = 1/9 {
|
2308 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2309 |
+
}
|
2310 |
+
*
|
2311 |
+
|
2312 |
+
|
2313 |
+
forval ii = `start'(`bin_l')0 {
|
2314 |
+
if `ii' < -`bin_l' {
|
2315 |
+
local jj = abs(`ii')
|
2316 |
+
local zz = `jj' - `bin_l' + 1
|
2317 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2318 |
+
forval ee = 1/9 {
|
2319 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2320 |
+
}
|
2321 |
+
}
|
2322 |
+
}
|
2323 |
+
*
|
2324 |
+
local jj = abs(`start')
|
2325 |
+
g TRUMP_PRE_M`jj' = 0
|
2326 |
+
forval ii = 1/9 {
|
2327 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2328 |
+
}
|
2329 |
+
|
2330 |
+
***number of counties 1,478
|
2331 |
+
qui: {
|
2332 |
+
forval ii = 1/1478 {
|
2333 |
+
su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2334 |
+
if r(N) != 0 {
|
2335 |
+
total n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2336 |
+
global stops`ii' = _b[n_stops]
|
2337 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2338 |
+
}
|
2339 |
+
}
|
2340 |
+
}
|
2341 |
+
**I drop the first for collinearity
|
2342 |
+
drop TREATED_COUNTY_9
|
2343 |
+
|
2344 |
+
|
2345 |
+
reghdfe black_ps 1.TRUMP_POST_91_105 1.TRUMP_POST_91_105#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2346 |
+
|
2347 |
+
|
2348 |
+
mat treat = 999* J(1478,2,1)
|
2349 |
+
|
2350 |
+
local numerator = 0
|
2351 |
+
local denominator = 0
|
2352 |
+
forval ii = 1/1478 {
|
2353 |
+
qui: su n_stops if county_id==`ii' & TRUMP_POST_91_105==1
|
2354 |
+
if r(N) != 0 {
|
2355 |
+
if `ii' == 9{
|
2356 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105])
|
2357 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2358 |
+
}
|
2359 |
+
else {
|
2360 |
+
mat treat[`ii',1] = (_b[1.TRUMP_POST_91_105] + _b[1.TRUMP_POST_91_105#1.TREATED_COUNTY_`ii'])
|
2361 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2362 |
+
}
|
2363 |
+
}
|
2364 |
+
}
|
2365 |
+
|
2366 |
+
g yy = treat[_n,1] in 1/1478
|
2367 |
+
g ww = treat[_n,2] in 1/1478
|
2368 |
+
replace yy = . if yy==999
|
2369 |
+
replace ww = . if ww==999
|
2370 |
+
|
2371 |
+
|
2372 |
+
|
2373 |
+
keep yy ww
|
2374 |
+
drop if yy==.
|
2375 |
+
|
2376 |
+
|
2377 |
+
expand ww
|
2378 |
+
egen id = group(yy)
|
2379 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2380 |
+
matrix b = e(b)
|
2381 |
+
matrix ci = e(ci_normal)
|
2382 |
+
g beta = b[1,1] in 1
|
2383 |
+
g CI_lb = ci[1,1] in 1
|
2384 |
+
g CI_ub = ci[2,1] in 1
|
2385 |
+
|
2386 |
+
keep if _n == 1
|
2387 |
+
keep beta CI_*
|
2388 |
+
|
2389 |
+
save "Results\SA_TRUMP_POST_91_105_NT.dta", replace
|
2390 |
+
|
2391 |
+
************************************************************************************************************************************
|
2392 |
+
|
2393 |
+
use "Data\county_day_data.dta", clear
|
2394 |
+
|
2395 |
+
drop TRUMP*
|
2396 |
+
forval ii = 1/9 {
|
2397 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2398 |
+
}
|
2399 |
+
|
2400 |
+
keep if year==2015 | year==2016 | year==2017
|
2401 |
+
|
2402 |
+
local start = -105
|
2403 |
+
local end = 105
|
2404 |
+
local bin_l = 15
|
2405 |
+
|
2406 |
+
g TRUMP_0 = 0
|
2407 |
+
forval ii = 1/9 {
|
2408 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2409 |
+
}
|
2410 |
+
|
2411 |
+
|
2412 |
+
forval ii = 1(`bin_l')`end'{
|
2413 |
+
local jj = `ii' + `bin_l' - 1
|
2414 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2415 |
+
forval ee = 1/9 {
|
2416 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2417 |
+
}
|
2418 |
+
}
|
2419 |
+
g TRUMP_POST_M`end' = 0
|
2420 |
+
forval ii = 1/9 {
|
2421 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2422 |
+
}
|
2423 |
+
*
|
2424 |
+
|
2425 |
+
|
2426 |
+
forval ii = `start'(`bin_l')0 {
|
2427 |
+
if `ii' < -`bin_l' {
|
2428 |
+
local jj = abs(`ii')
|
2429 |
+
local zz = `jj' - `bin_l' + 1
|
2430 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2431 |
+
forval ee = 1/9 {
|
2432 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2433 |
+
}
|
2434 |
+
}
|
2435 |
+
}
|
2436 |
+
*
|
2437 |
+
local jj = abs(`start')
|
2438 |
+
g TRUMP_PRE_M`jj' = 0
|
2439 |
+
forval ii = 1/9 {
|
2440 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2441 |
+
}
|
2442 |
+
|
2443 |
+
***number of counties 1,478
|
2444 |
+
qui: {
|
2445 |
+
forval ii = 1/1478 {
|
2446 |
+
su n_stops if county_id==`ii' & TRUMP_0==1
|
2447 |
+
if r(N) != 0 {
|
2448 |
+
total n_stops if county_id==`ii' & TRUMP_0==1
|
2449 |
+
global stops`ii' = _b[n_stops]
|
2450 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2451 |
+
}
|
2452 |
+
}
|
2453 |
+
}
|
2454 |
+
**I drop the first for collinearity
|
2455 |
+
drop TREATED_COUNTY_9
|
2456 |
+
|
2457 |
+
|
2458 |
+
reghdfe black_ps 1.TRUMP_0 1.TRUMP_0#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2459 |
+
|
2460 |
+
|
2461 |
+
mat treat = 999* J(1478,2,1)
|
2462 |
+
|
2463 |
+
local numerator = 0
|
2464 |
+
local denominator = 0
|
2465 |
+
forval ii = 1/1478 {
|
2466 |
+
qui: su n_stops if county_id==`ii' & TRUMP_0==1
|
2467 |
+
if r(N) != 0 {
|
2468 |
+
if `ii' == 9{
|
2469 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0])
|
2470 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2471 |
+
}
|
2472 |
+
else {
|
2473 |
+
mat treat[`ii',1] = (_b[1.TRUMP_0] + _b[1.TRUMP_0#1.TREATED_COUNTY_`ii'])
|
2474 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2475 |
+
}
|
2476 |
+
}
|
2477 |
+
}
|
2478 |
+
|
2479 |
+
g yy = treat[_n,1] in 1/1478
|
2480 |
+
g ww = treat[_n,2] in 1/1478
|
2481 |
+
replace yy = . if yy==999
|
2482 |
+
replace ww = . if ww==999
|
2483 |
+
|
2484 |
+
keep yy ww
|
2485 |
+
drop if yy==.
|
2486 |
+
|
2487 |
+
expand ww
|
2488 |
+
egen id = group(yy)
|
2489 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2490 |
+
matrix b = e(b)
|
2491 |
+
matrix ci = e(ci_normal)
|
2492 |
+
g beta = b[1,1] in 1
|
2493 |
+
g CI_lb = ci[1,1] in 1
|
2494 |
+
g CI_ub = ci[2,1] in 1
|
2495 |
+
|
2496 |
+
keep if _n == 1
|
2497 |
+
keep beta CI_*
|
2498 |
+
|
2499 |
+
save "Results\SA_TRUMP_0_NT.dta", replace
|
2500 |
+
|
2501 |
+
************************************************************************************************************************************
|
2502 |
+
|
2503 |
+
use "Data\county_day_data.dta", clear
|
2504 |
+
|
2505 |
+
drop TRUMP*
|
2506 |
+
forval ii = 1/9 {
|
2507 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2508 |
+
}
|
2509 |
+
|
2510 |
+
keep if year==2015 | year==2016 | year==2017
|
2511 |
+
|
2512 |
+
local start = -105
|
2513 |
+
local end = 105
|
2514 |
+
local bin_l = 15
|
2515 |
+
|
2516 |
+
g TRUMP_0 = 0
|
2517 |
+
forval ii = 1/9 {
|
2518 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2519 |
+
}
|
2520 |
+
|
2521 |
+
|
2522 |
+
forval ii = 1(`bin_l')`end'{
|
2523 |
+
local jj = `ii' + `bin_l' - 1
|
2524 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2525 |
+
forval ee = 1/9 {
|
2526 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2527 |
+
}
|
2528 |
+
}
|
2529 |
+
g TRUMP_POST_M`end' = 0
|
2530 |
+
forval ii = 1/9 {
|
2531 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2532 |
+
}
|
2533 |
+
*
|
2534 |
+
|
2535 |
+
forval ii = `start'(`bin_l')0 {
|
2536 |
+
if `ii' < -`bin_l' {
|
2537 |
+
local jj = abs(`ii')
|
2538 |
+
local zz = `jj' - `bin_l' + 1
|
2539 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2540 |
+
forval ee = 1/9 {
|
2541 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2542 |
+
}
|
2543 |
+
}
|
2544 |
+
}
|
2545 |
+
*
|
2546 |
+
local jj = abs(`start')
|
2547 |
+
g TRUMP_PRE_M`jj' = 0
|
2548 |
+
forval ii = 1/9 {
|
2549 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2550 |
+
}
|
2551 |
+
|
2552 |
+
***number of counties 1,478
|
2553 |
+
qui: {
|
2554 |
+
forval ii = 1/1478 {
|
2555 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2556 |
+
if r(N) != 0 {
|
2557 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2558 |
+
global stops`ii' = _b[n_stops]
|
2559 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2560 |
+
}
|
2561 |
+
}
|
2562 |
+
}
|
2563 |
+
**I drop the first for collinearity
|
2564 |
+
drop TREATED_COUNTY_9
|
2565 |
+
|
2566 |
+
reghdfe black_ps 1.TRUMP_PRE_30_16 1.TRUMP_PRE_30_16#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_M105) cluster(county_id day_id)
|
2567 |
+
|
2568 |
+
|
2569 |
+
mat treat = 999* J(1478,2,1)
|
2570 |
+
|
2571 |
+
local numerator = 0
|
2572 |
+
local denominator = 0
|
2573 |
+
forval ii = 1/1478 {
|
2574 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_30_16==1
|
2575 |
+
if r(N) != 0 {
|
2576 |
+
if `ii' == 9{
|
2577 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16])
|
2578 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2579 |
+
}
|
2580 |
+
else {
|
2581 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_30_16] + _b[1.TRUMP_PRE_30_16#1.TREATED_COUNTY_`ii'])
|
2582 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2583 |
+
}
|
2584 |
+
}
|
2585 |
+
}
|
2586 |
+
|
2587 |
+
g yy = treat[_n,1] in 1/1478
|
2588 |
+
g ww = treat[_n,2] in 1/1478
|
2589 |
+
replace yy = . if yy==999
|
2590 |
+
replace ww = . if ww==999
|
2591 |
+
|
2592 |
+
|
2593 |
+
|
2594 |
+
keep yy ww
|
2595 |
+
drop if yy==.
|
2596 |
+
|
2597 |
+
|
2598 |
+
expand ww
|
2599 |
+
egen id = group(yy)
|
2600 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2601 |
+
matrix b = e(b)
|
2602 |
+
matrix ci = e(ci_normal)
|
2603 |
+
g beta = b[1,1] in 1
|
2604 |
+
g CI_lb = ci[1,1] in 1
|
2605 |
+
g CI_ub = ci[2,1] in 1
|
2606 |
+
|
2607 |
+
keep if _n == 1
|
2608 |
+
keep beta CI_*
|
2609 |
+
|
2610 |
+
save "Results\SA_TRUMP_PRE_30_16_NT.dta", replace
|
2611 |
+
|
2612 |
+
************************************************************************************************************************************
|
2613 |
+
|
2614 |
+
use "Data\county_day_data.dta", clear
|
2615 |
+
drop TRUMP*
|
2616 |
+
forval ii = 1/9 {
|
2617 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2618 |
+
}
|
2619 |
+
|
2620 |
+
keep if year==2015 | year==2016 | year==2017
|
2621 |
+
|
2622 |
+
local start = -105
|
2623 |
+
local end = 105
|
2624 |
+
local bin_l = 15
|
2625 |
+
|
2626 |
+
g TRUMP_0 = 0
|
2627 |
+
forval ii = 1/9 {
|
2628 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2629 |
+
}
|
2630 |
+
|
2631 |
+
|
2632 |
+
forval ii = 1(`bin_l')`end'{
|
2633 |
+
local jj = `ii' + `bin_l' - 1
|
2634 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2635 |
+
forval ee = 1/9 {
|
2636 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2637 |
+
}
|
2638 |
+
}
|
2639 |
+
g TRUMP_POST_M`end' = 0
|
2640 |
+
forval ii = 1/9 {
|
2641 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2642 |
+
}
|
2643 |
+
*
|
2644 |
+
|
2645 |
+
|
2646 |
+
forval ii = `start'(`bin_l')0 {
|
2647 |
+
if `ii' < -`bin_l' {
|
2648 |
+
local jj = abs(`ii')
|
2649 |
+
local zz = `jj' - `bin_l' + 1
|
2650 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2651 |
+
forval ee = 1/9 {
|
2652 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2653 |
+
}
|
2654 |
+
}
|
2655 |
+
}
|
2656 |
+
*
|
2657 |
+
local jj = abs(`start')
|
2658 |
+
g TRUMP_PRE_M`jj' = 0
|
2659 |
+
forval ii = 1/9 {
|
2660 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2661 |
+
}
|
2662 |
+
|
2663 |
+
***number of counties 1,478
|
2664 |
+
qui: {
|
2665 |
+
forval ii = 1/1478 {
|
2666 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2667 |
+
if r(N) != 0 {
|
2668 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2669 |
+
global stops`ii' = _b[n_stops]
|
2670 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2671 |
+
}
|
2672 |
+
}
|
2673 |
+
}
|
2674 |
+
**I drop the first for collinearity
|
2675 |
+
drop TREATED_COUNTY_9
|
2676 |
+
|
2677 |
+
|
2678 |
+
reghdfe black_ps 1.TRUMP_PRE_45_31 1.TRUMP_PRE_45_31#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2679 |
+
|
2680 |
+
|
2681 |
+
mat treat = 999* J(1478,2,1)
|
2682 |
+
|
2683 |
+
local numerator = 0
|
2684 |
+
local denominator = 0
|
2685 |
+
forval ii = 1/1478 {
|
2686 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_45_31==1
|
2687 |
+
if r(N) != 0 {
|
2688 |
+
if `ii' == 9{
|
2689 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31])
|
2690 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2691 |
+
}
|
2692 |
+
else {
|
2693 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_45_31] + _b[1.TRUMP_PRE_45_31#1.TREATED_COUNTY_`ii'])
|
2694 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2695 |
+
}
|
2696 |
+
}
|
2697 |
+
}
|
2698 |
+
|
2699 |
+
g yy = treat[_n,1] in 1/1478
|
2700 |
+
g ww = treat[_n,2] in 1/1478
|
2701 |
+
replace yy = . if yy==999
|
2702 |
+
replace ww = . if ww==999
|
2703 |
+
|
2704 |
+
|
2705 |
+
|
2706 |
+
keep yy ww
|
2707 |
+
drop if yy==.
|
2708 |
+
|
2709 |
+
|
2710 |
+
expand ww
|
2711 |
+
egen id = group(yy)
|
2712 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2713 |
+
matrix b = e(b)
|
2714 |
+
matrix ci = e(ci_normal)
|
2715 |
+
g beta = b[1,1] in 1
|
2716 |
+
g CI_lb = ci[1,1] in 1
|
2717 |
+
g CI_ub = ci[2,1] in 1
|
2718 |
+
|
2719 |
+
keep if _n == 1
|
2720 |
+
keep beta CI_*
|
2721 |
+
|
2722 |
+
save "Results\SA_TRUMP_PRE_45_31_NT.dta", replace
|
2723 |
+
|
2724 |
+
************************************************************************************************************************************
|
2725 |
+
|
2726 |
+
use "Data\county_day_data.dta", clear
|
2727 |
+
|
2728 |
+
drop TRUMP*
|
2729 |
+
forval ii = 1/9 {
|
2730 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2731 |
+
}
|
2732 |
+
keep if year==2015 | year==2016 | year==2017
|
2733 |
+
|
2734 |
+
local start = -105
|
2735 |
+
local end = 105
|
2736 |
+
local bin_l = 15
|
2737 |
+
|
2738 |
+
g TRUMP_0 = 0
|
2739 |
+
forval ii = 1/9 {
|
2740 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2741 |
+
}
|
2742 |
+
|
2743 |
+
|
2744 |
+
forval ii = 1(`bin_l')`end'{
|
2745 |
+
local jj = `ii' + `bin_l' - 1
|
2746 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2747 |
+
forval ee = 1/9 {
|
2748 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2749 |
+
}
|
2750 |
+
}
|
2751 |
+
g TRUMP_POST_M`end' = 0
|
2752 |
+
forval ii = 1/9 {
|
2753 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2754 |
+
}
|
2755 |
+
*
|
2756 |
+
|
2757 |
+
|
2758 |
+
forval ii = `start'(`bin_l')0 {
|
2759 |
+
if `ii' < -`bin_l' {
|
2760 |
+
local jj = abs(`ii')
|
2761 |
+
local zz = `jj' - `bin_l' + 1
|
2762 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2763 |
+
forval ee = 1/9 {
|
2764 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2765 |
+
}
|
2766 |
+
}
|
2767 |
+
}
|
2768 |
+
*
|
2769 |
+
local jj = abs(`start')
|
2770 |
+
g TRUMP_PRE_M`jj' = 0
|
2771 |
+
forval ii = 1/9 {
|
2772 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2773 |
+
}
|
2774 |
+
|
2775 |
+
***number of counties 1,478
|
2776 |
+
qui: {
|
2777 |
+
forval ii = 1/1478 {
|
2778 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2779 |
+
if r(N) != 0 {
|
2780 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2781 |
+
global stops`ii' = _b[n_stops]
|
2782 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2783 |
+
}
|
2784 |
+
}
|
2785 |
+
}
|
2786 |
+
**I drop the first for collinearity
|
2787 |
+
drop TREATED_COUNTY_9
|
2788 |
+
|
2789 |
+
|
2790 |
+
reghdfe black_ps 1.TRUMP_PRE_60_46 1.TRUMP_PRE_60_46#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2791 |
+
|
2792 |
+
|
2793 |
+
mat treat = 999* J(1478,2,1)
|
2794 |
+
|
2795 |
+
local numerator = 0
|
2796 |
+
local denominator = 0
|
2797 |
+
forval ii = 1/1478 {
|
2798 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_60_46==1
|
2799 |
+
if r(N) != 0 {
|
2800 |
+
if `ii' == 9{
|
2801 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46])
|
2802 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2803 |
+
}
|
2804 |
+
else {
|
2805 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_60_46] + _b[1.TRUMP_PRE_60_46#1.TREATED_COUNTY_`ii'])
|
2806 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2807 |
+
}
|
2808 |
+
}
|
2809 |
+
}
|
2810 |
+
|
2811 |
+
g yy = treat[_n,1] in 1/1478
|
2812 |
+
g ww = treat[_n,2] in 1/1478
|
2813 |
+
replace yy = . if yy==999
|
2814 |
+
replace ww = . if ww==999
|
2815 |
+
|
2816 |
+
keep yy ww
|
2817 |
+
drop if yy==.
|
2818 |
+
|
2819 |
+
|
2820 |
+
expand ww
|
2821 |
+
egen id = group(yy)
|
2822 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2823 |
+
matrix b = e(b)
|
2824 |
+
matrix ci = e(ci_normal)
|
2825 |
+
g beta = b[1,1] in 1
|
2826 |
+
g CI_lb = ci[1,1] in 1
|
2827 |
+
g CI_ub = ci[2,1] in 1
|
2828 |
+
|
2829 |
+
keep if _n == 1
|
2830 |
+
keep beta CI_*
|
2831 |
+
|
2832 |
+
save "Results\SA_TRUMP_PRE_60_46_NT.dta", replace
|
2833 |
+
|
2834 |
+
************************************************************************************************************************************
|
2835 |
+
|
2836 |
+
use "Data\county_day_data.dta", clear
|
2837 |
+
|
2838 |
+
drop TRUMP*
|
2839 |
+
forval ii = 1/9 {
|
2840 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2841 |
+
}
|
2842 |
+
|
2843 |
+
keep if year==2015 | year==2016 | year==2017
|
2844 |
+
|
2845 |
+
local start = -105
|
2846 |
+
local end = 105
|
2847 |
+
local bin_l = 15
|
2848 |
+
|
2849 |
+
g TRUMP_0 = 0
|
2850 |
+
forval ii = 1/9 {
|
2851 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2852 |
+
}
|
2853 |
+
|
2854 |
+
forval ii = 1(`bin_l')`end'{
|
2855 |
+
local jj = `ii' + `bin_l' - 1
|
2856 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2857 |
+
forval ee = 1/9 {
|
2858 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2859 |
+
}
|
2860 |
+
}
|
2861 |
+
g TRUMP_POST_M`end' = 0
|
2862 |
+
forval ii = 1/9 {
|
2863 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2864 |
+
}
|
2865 |
+
*
|
2866 |
+
|
2867 |
+
|
2868 |
+
forval ii = `start'(`bin_l')0 {
|
2869 |
+
if `ii' < -`bin_l' {
|
2870 |
+
local jj = abs(`ii')
|
2871 |
+
local zz = `jj' - `bin_l' + 1
|
2872 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2873 |
+
forval ee = 1/9 {
|
2874 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2875 |
+
}
|
2876 |
+
}
|
2877 |
+
}
|
2878 |
+
*
|
2879 |
+
local jj = abs(`start')
|
2880 |
+
g TRUMP_PRE_M`jj' = 0
|
2881 |
+
forval ii = 1/9 {
|
2882 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2883 |
+
}
|
2884 |
+
|
2885 |
+
***number of counties 1,478
|
2886 |
+
qui: {
|
2887 |
+
forval ii = 1/1478 {
|
2888 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2889 |
+
if r(N) != 0 {
|
2890 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2891 |
+
global stops`ii' = _b[n_stops]
|
2892 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
2893 |
+
}
|
2894 |
+
}
|
2895 |
+
}
|
2896 |
+
**I drop the first for collinearity
|
2897 |
+
drop TREATED_COUNTY_9
|
2898 |
+
|
2899 |
+
|
2900 |
+
reghdfe black_ps 1.TRUMP_PRE_75_61 1.TRUMP_PRE_75_61#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_90_76 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
2901 |
+
|
2902 |
+
|
2903 |
+
mat treat = 999* J(1478,2,1)
|
2904 |
+
|
2905 |
+
local numerator = 0
|
2906 |
+
local denominator = 0
|
2907 |
+
forval ii = 1/1478 {
|
2908 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_75_61==1
|
2909 |
+
if r(N) != 0 {
|
2910 |
+
if `ii' == 9{
|
2911 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61])
|
2912 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2913 |
+
}
|
2914 |
+
else {
|
2915 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_75_61] + _b[1.TRUMP_PRE_75_61#1.TREATED_COUNTY_`ii'])
|
2916 |
+
mat treat[`ii',2] = (${stops`ii'})
|
2917 |
+
}
|
2918 |
+
}
|
2919 |
+
}
|
2920 |
+
|
2921 |
+
g yy = treat[_n,1] in 1/1478
|
2922 |
+
g ww = treat[_n,2] in 1/1478
|
2923 |
+
replace yy = . if yy==999
|
2924 |
+
replace ww = . if ww==999
|
2925 |
+
|
2926 |
+
keep yy ww
|
2927 |
+
drop if yy==.
|
2928 |
+
|
2929 |
+
|
2930 |
+
expand ww
|
2931 |
+
egen id = group(yy)
|
2932 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
2933 |
+
matrix b = e(b)
|
2934 |
+
matrix ci = e(ci_normal)
|
2935 |
+
g beta = b[1,1] in 1
|
2936 |
+
g CI_lb = ci[1,1] in 1
|
2937 |
+
g CI_ub = ci[2,1] in 1
|
2938 |
+
|
2939 |
+
keep if _n == 1
|
2940 |
+
keep beta CI_*
|
2941 |
+
|
2942 |
+
save "Results\SA_TRUMP_PRE_75_61_NT.dta", replace
|
2943 |
+
|
2944 |
+
************************************************************************************************************************************
|
2945 |
+
|
2946 |
+
use "Data\county_day_data.dta", clear
|
2947 |
+
|
2948 |
+
|
2949 |
+
drop TRUMP*
|
2950 |
+
forval ii = 1/9 {
|
2951 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
2952 |
+
}
|
2953 |
+
|
2954 |
+
keep if year==2015 | year==2016 | year==2017
|
2955 |
+
|
2956 |
+
local start = -105
|
2957 |
+
local end = 105
|
2958 |
+
local bin_l = 15
|
2959 |
+
|
2960 |
+
g TRUMP_0 = 0
|
2961 |
+
forval ii = 1/9 {
|
2962 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
2963 |
+
}
|
2964 |
+
|
2965 |
+
|
2966 |
+
forval ii = 1(`bin_l')`end'{
|
2967 |
+
local jj = `ii' + `bin_l' - 1
|
2968 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
2969 |
+
forval ee = 1/9 {
|
2970 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
2971 |
+
}
|
2972 |
+
}
|
2973 |
+
g TRUMP_POST_M`end' = 0
|
2974 |
+
forval ii = 1/9 {
|
2975 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
2976 |
+
}
|
2977 |
+
*
|
2978 |
+
|
2979 |
+
forval ii = `start'(`bin_l')0 {
|
2980 |
+
if `ii' < -`bin_l' {
|
2981 |
+
local jj = abs(`ii')
|
2982 |
+
local zz = `jj' - `bin_l' + 1
|
2983 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
2984 |
+
forval ee = 1/9 {
|
2985 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
2986 |
+
}
|
2987 |
+
}
|
2988 |
+
}
|
2989 |
+
*
|
2990 |
+
local jj = abs(`start')
|
2991 |
+
g TRUMP_PRE_M`jj' = 0
|
2992 |
+
forval ii = 1/9 {
|
2993 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
2994 |
+
}
|
2995 |
+
|
2996 |
+
***number of counties 1,478
|
2997 |
+
qui: {
|
2998 |
+
forval ii = 1/1478 {
|
2999 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
3000 |
+
if r(N) != 0 {
|
3001 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
3002 |
+
global stops`ii' = _b[n_stops]
|
3003 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
3004 |
+
}
|
3005 |
+
}
|
3006 |
+
}
|
3007 |
+
**I drop the first for collinearity
|
3008 |
+
drop TREATED_COUNTY_9
|
3009 |
+
|
3010 |
+
reghdfe black_ps 1.TRUMP_PRE_90_76 1.TRUMP_PRE_90_76#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_105_91 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
3011 |
+
|
3012 |
+
|
3013 |
+
mat treat = 999* J(1478,2,1)
|
3014 |
+
|
3015 |
+
local numerator = 0
|
3016 |
+
local denominator = 0
|
3017 |
+
forval ii = 1/1478 {
|
3018 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_90_76==1
|
3019 |
+
if r(N) != 0 {
|
3020 |
+
if `ii' == 9{
|
3021 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76])
|
3022 |
+
mat treat[`ii',2] = (${stops`ii'})
|
3023 |
+
}
|
3024 |
+
else {
|
3025 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_90_76] + _b[1.TRUMP_PRE_90_76#1.TREATED_COUNTY_`ii'])
|
3026 |
+
mat treat[`ii',2] = (${stops`ii'})
|
3027 |
+
}
|
3028 |
+
}
|
3029 |
+
}
|
3030 |
+
|
3031 |
+
g yy = treat[_n,1] in 1/1478
|
3032 |
+
g ww = treat[_n,2] in 1/1478
|
3033 |
+
replace yy = . if yy==999
|
3034 |
+
replace ww = . if ww==999
|
3035 |
+
|
3036 |
+
keep yy ww
|
3037 |
+
drop if yy==.
|
3038 |
+
|
3039 |
+
expand ww
|
3040 |
+
egen id = group(yy)
|
3041 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
3042 |
+
matrix b = e(b)
|
3043 |
+
matrix ci = e(ci_normal)
|
3044 |
+
g beta = b[1,1] in 1
|
3045 |
+
g CI_lb = ci[1,1] in 1
|
3046 |
+
g CI_ub = ci[2,1] in 1
|
3047 |
+
|
3048 |
+
keep if _n == 1
|
3049 |
+
keep beta CI_*
|
3050 |
+
|
3051 |
+
save "Results\SA_TRUMP_PRE_90_76_NT.dta", replace
|
3052 |
+
|
3053 |
+
************************************************************************************************************************************
|
3054 |
+
|
3055 |
+
use "Data\county_day_data.dta", clear
|
3056 |
+
keep if year==2015 | year==2016 | year==2017
|
3057 |
+
drop TRUMP*
|
3058 |
+
forval ii = 1/9 {
|
3059 |
+
g dist_event`ii' = day_id - event_day_Trump_`ii'
|
3060 |
+
}
|
3061 |
+
local start = -105
|
3062 |
+
local end = 105
|
3063 |
+
local bin_l = 15
|
3064 |
+
|
3065 |
+
|
3066 |
+
g TRUMP_0 = 0
|
3067 |
+
forval ii = 1/9 {
|
3068 |
+
replace TRUMP_0 = 1 if dist_event`ii' == 0
|
3069 |
+
}
|
3070 |
+
|
3071 |
+
|
3072 |
+
forval ii = 1(`bin_l')`end'{
|
3073 |
+
local jj = `ii' + `bin_l' - 1
|
3074 |
+
g TRUMP_POST_`ii'_`jj' = 0
|
3075 |
+
forval ee = 1/9 {
|
3076 |
+
replace TRUMP_POST_`ii'_`jj' = 1 if (dist_event`ee' >= `ii' & dist_event`ee'<=`jj' & dist_event`ee'!=.)
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
g TRUMP_POST_M`end' = 0
|
3080 |
+
forval ii = 1/9 {
|
3081 |
+
replace TRUMP_POST_M`end' = 1 if (dist_event`ii' > `end' & dist_event`ii'!=.)
|
3082 |
+
}
|
3083 |
+
*
|
3084 |
+
|
3085 |
+
|
3086 |
+
forval ii = `start'(`bin_l')0 {
|
3087 |
+
if `ii' < -`bin_l' {
|
3088 |
+
local jj = abs(`ii')
|
3089 |
+
local zz = `jj' - `bin_l' + 1
|
3090 |
+
g TRUMP_PRE_`jj'_`zz' = 0
|
3091 |
+
forval ee = 1/9 {
|
3092 |
+
replace TRUMP_PRE_`jj'_`zz' = 1 if (dist_event`ee' <= -`zz' & dist_event`ee'>=-`jj' & dist_event`ee'!=.)
|
3093 |
+
}
|
3094 |
+
}
|
3095 |
+
}
|
3096 |
+
*
|
3097 |
+
local jj = abs(`start')
|
3098 |
+
g TRUMP_PRE_M`jj' = 0
|
3099 |
+
forval ii = 1/9 {
|
3100 |
+
replace TRUMP_PRE_M`jj' = 1 if (dist_event`ii' < `start' & dist_event`ii'!=.)
|
3101 |
+
}
|
3102 |
+
|
3103 |
+
***number of counties 1,478
|
3104 |
+
qui: {
|
3105 |
+
forval ii = 1/1478 {
|
3106 |
+
su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
3107 |
+
if r(N) != 0 {
|
3108 |
+
total n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
3109 |
+
global stops`ii' = _b[n_stops]
|
3110 |
+
g TREATED_COUNTY_`ii' = (county_id==`ii')
|
3111 |
+
}
|
3112 |
+
}
|
3113 |
+
}
|
3114 |
+
**I drop the first for collinearity
|
3115 |
+
drop TREATED_COUNTY_9
|
3116 |
+
|
3117 |
+
|
3118 |
+
reghdfe black_ps 1.TRUMP_PRE_105_91 1.TRUMP_PRE_105_91#1.TREATED_COUNTY_* [w=n_stops], a(county_id day_id TRUMP_0 TRUMP_POST_1_15 TRUMP_POST_16_30 TRUMP_POST_31_45 TRUMP_POST_46_60 TRUMP_POST_61_75 TRUMP_POST_76_90 TRUMP_POST_91_105 TRUMP_POST_M105 TRUMP_PRE_90_76 TRUMP_PRE_75_61 TRUMP_PRE_60_46 TRUMP_PRE_45_31 TRUMP_PRE_30_16 TRUMP_PRE_M105) cluster(county_id day_id)
|
3119 |
+
|
3120 |
+
|
3121 |
+
mat treat = 999* J(1478,2,1)
|
3122 |
+
|
3123 |
+
local numerator = 0
|
3124 |
+
local denominator = 0
|
3125 |
+
forval ii = 1/1478 {
|
3126 |
+
qui: su n_stops if county_id==`ii' & TRUMP_PRE_105_91==1
|
3127 |
+
if r(N) != 0 {
|
3128 |
+
if `ii' == 9{
|
3129 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91])
|
3130 |
+
mat treat[`ii',2] = (${stops`ii'})
|
3131 |
+
}
|
3132 |
+
else {
|
3133 |
+
mat treat[`ii',1] = (_b[1.TRUMP_PRE_105_91] + _b[1.TRUMP_PRE_105_91#1.TREATED_COUNTY_`ii'])
|
3134 |
+
mat treat[`ii',2] = (${stops`ii'})
|
3135 |
+
}
|
3136 |
+
}
|
3137 |
+
}
|
3138 |
+
|
3139 |
+
g yy = treat[_n,1] in 1/1478
|
3140 |
+
g ww = treat[_n,2] in 1/1478
|
3141 |
+
replace yy = . if yy==999
|
3142 |
+
replace ww = . if ww==999
|
3143 |
+
|
3144 |
+
|
3145 |
+
|
3146 |
+
keep yy ww
|
3147 |
+
drop if yy==.
|
3148 |
+
|
3149 |
+
|
3150 |
+
expand ww
|
3151 |
+
egen id = group(yy)
|
3152 |
+
bootstrap r(mean), reps(1000) cluster(id): su yy
|
3153 |
+
matrix b = e(b)
|
3154 |
+
matrix ci = e(ci_normal)
|
3155 |
+
g beta = b[1,1] in 1
|
3156 |
+
g CI_lb = ci[1,1] in 1
|
3157 |
+
g CI_ub = ci[2,1] in 1
|
3158 |
+
|
3159 |
+
keep if _n == 1
|
3160 |
+
keep beta CI_*
|
3161 |
+
|
3162 |
+
save "Results\SA_TRUMP_PRE_105_91_NT.dta", replace
|
3163 |
+
|
3164 |
+
|
3165 |
+
|
3166 |
+
|
3167 |
+
|
3168 |
+
|
39/replication_package/Readme.pdf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:408733ed19bc06a6e71e929c732ddd0584cab0e5bdcf2bb04ef82eda2818856e
|
3 |
+
size 97940
|
39/replication_package/data/allcandidates_rallies.dta
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:19870c082619ff3bf1b4deda021f508b0b7d9dafffdc856603b35c2d85fd0a67
|
3 |
+
size 31393
|
39/replication_package/data/allcandidates_words.dta
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4b92e64cf1235a83f3226e1d7d243a9de70e9eb10d4f6a2f81be0cb91d1631f8
|
3 |
+
size 5090157
|
39/replication_package/data/blm.dta
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:de48002d0da0ee8080528e5eed0834c96015a23e85563790f6d08f250167e96c
|
3 |
+
size 19611
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.cpg
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
UTF-8
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.dbf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1ece339e91ce5de305ff0cd669ce3b638567f0ff545869ba0fdf13d9e176e8fa
|
3 |
+
size 1106264
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.prj
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:06463cf329d6f412d7f3323748225aca1ca495a8c04af58cfaf169fc3a8c8df4
|
3 |
+
size 16817256
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp.ea.iso.xml
ADDED
@@ -0,0 +1,404 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<!--This file contains all the Entity and Attribute Information--><gfc:FC_FeatureCatalogue xmlns:gmx="http://www.isotc211.org/2005/gmx"
|
3 |
+
xmlns:gco="http://www.isotc211.org/2005/gco"
|
4 |
+
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
5 |
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
6 |
+
xmlns:gml="http://www.opengis.net/gml/3.2"
|
7 |
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
8 |
+
xmlns:gfc="http://www.isotc211.org/2005/gfc"
|
9 |
+
xsi:schemaLocation="https://www.ngdc.noaa.gov/metadata/published/xsd/schema/gfc/featureCataloging.xsd">
|
10 |
+
<gmx:name>
|
11 |
+
<gco:CharacterString>Feature Catalog for the 2016 Current County and Equivalent 1:500,000 Cartographic Boundary File</gco:CharacterString>
|
12 |
+
</gmx:name>
|
13 |
+
<gmx:scope>
|
14 |
+
<gco:CharacterString>The Current County and Equivalent at a scale of 1:500,000</gco:CharacterString>
|
15 |
+
</gmx:scope>
|
16 |
+
<gmx:versionNumber>
|
17 |
+
<gco:CharacterString>cb_2016_county_500k</gco:CharacterString>
|
18 |
+
</gmx:versionNumber>
|
19 |
+
<gmx:versionDate>
|
20 |
+
<gco:Date>2017-03</gco:Date>
|
21 |
+
</gmx:versionDate>
|
22 |
+
<gmx:language>
|
23 |
+
<gco:CharacterString>eng</gco:CharacterString>
|
24 |
+
</gmx:language>
|
25 |
+
<gmx:characterSet>
|
26 |
+
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
|
27 |
+
codeListValue="utf8"
|
28 |
+
codeSpace="004">utf8
|
29 |
+
</gmd:MD_CharacterSetCode>
|
30 |
+
</gmx:characterSet>
|
31 |
+
<gfc:producer xlink:href="https://www.ngdc.noaa.gov/docucomp/1df27e57-4768-42de-909b-52f530601fba"
|
32 |
+
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch"/>
|
33 |
+
<gfc:featureType>
|
34 |
+
<gfc:FC_FeatureType>
|
35 |
+
<gfc:typeName>
|
36 |
+
<gco:LocalName>cb_2016_us_county_500k.shp</gco:LocalName>
|
37 |
+
</gfc:typeName>
|
38 |
+
<gfc:definition>
|
39 |
+
<gco:CharacterString>Current County and Equivalent (national)</gco:CharacterString>
|
40 |
+
</gfc:definition>
|
41 |
+
<gfc:isAbstract>
|
42 |
+
<gco:Boolean>false</gco:Boolean>
|
43 |
+
</gfc:isAbstract>
|
44 |
+
<gfc:featureCatalogue uuidref="2016_county_500k.ea.iso.xml"/>
|
45 |
+
<gfc:carrierOfCharacteristics>
|
46 |
+
<gfc:FC_FeatureAttribute>
|
47 |
+
<gfc:memberName>
|
48 |
+
<gco:LocalName>STATEFP</gco:LocalName>
|
49 |
+
</gfc:memberName>
|
50 |
+
<gfc:definition>
|
51 |
+
<gco:CharacterString>Current state Federal Information Processing Series (FIPS) code</gco:CharacterString>
|
52 |
+
</gfc:definition>
|
53 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
54 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
55 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
56 |
+
<gfc:listedValue>
|
57 |
+
<gfc:FC_ListedValue>
|
58 |
+
<gfc:label>
|
59 |
+
<gco:CharacterString>National Standard Codes (ANSI INCITS 38-2009), Federal Information Processing Series (FIPS) - States/State Equivalents</gco:CharacterString>
|
60 |
+
</gfc:label>
|
61 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
62 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
63 |
+
</gfc:FC_ListedValue>
|
64 |
+
</gfc:listedValue>
|
65 |
+
</gfc:FC_FeatureAttribute>
|
66 |
+
</gfc:carrierOfCharacteristics>
|
67 |
+
<gfc:carrierOfCharacteristics>
|
68 |
+
<gfc:FC_FeatureAttribute>
|
69 |
+
<gfc:memberName>
|
70 |
+
<gco:LocalName>COUNTYFP</gco:LocalName>
|
71 |
+
</gfc:memberName>
|
72 |
+
<gfc:definition>
|
73 |
+
<gco:CharacterString>Current county Federal Information Processing Series (FIPS) code</gco:CharacterString>
|
74 |
+
</gfc:definition>
|
75 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
76 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
77 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
78 |
+
<gfc:listedValue>
|
79 |
+
<gfc:FC_ListedValue>
|
80 |
+
<gfc:label>
|
81 |
+
<gco:CharacterString>National Standard Codes (ANSI INCITS 31-2009), Federal Information Processing Series (FIPS) - Counties/County Equivalents</gco:CharacterString>
|
82 |
+
</gfc:label>
|
83 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
84 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
85 |
+
</gfc:FC_ListedValue>
|
86 |
+
</gfc:listedValue>
|
87 |
+
</gfc:FC_FeatureAttribute>
|
88 |
+
</gfc:carrierOfCharacteristics>
|
89 |
+
<gfc:carrierOfCharacteristics>
|
90 |
+
<gfc:FC_FeatureAttribute>
|
91 |
+
<gfc:memberName>
|
92 |
+
<gco:LocalName>COUNTYNS</gco:LocalName>
|
93 |
+
</gfc:memberName>
|
94 |
+
<gfc:definition>
|
95 |
+
<gco:CharacterString>Current county Geographic Names Information System (GNIS) code</gco:CharacterString>
|
96 |
+
</gfc:definition>
|
97 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
98 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
99 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
100 |
+
<gfc:listedValue>
|
101 |
+
<gfc:FC_ListedValue>
|
102 |
+
<gfc:label>
|
103 |
+
<gco:CharacterString>INCITS 446:2008 (Geographic Names Information System (GNIS)), Identifying Attributes for Named Physical and Cultural Geographic Features (Except Roads and Highways) of the United States, Its Territories, Outlying Areas, and Freely Associated Areas, and the Waters of the Same to the Limit of the Twelve-Mile Statutory Zone</gco:CharacterString>
|
104 |
+
</gfc:label>
|
105 |
+
<gfc:definitionReference>
|
106 |
+
<gfc:FC_DefinitionReference>
|
107 |
+
<gfc:definitionSource>
|
108 |
+
<gfc:FC_DefinitionSource>
|
109 |
+
<gfc:source>
|
110 |
+
<gmd:CI_Citation>
|
111 |
+
<gmd:title gco:nilReason="inapplicable"/>
|
112 |
+
<gmd:date gco:nilReason="unknown"/>
|
113 |
+
<gmd:citedResponsibleParty>
|
114 |
+
<gmd:CI_ResponsibleParty>
|
115 |
+
<gmd:organisationName>
|
116 |
+
<gco:CharacterString>U.S. Geological Survey (USGS)</gco:CharacterString>
|
117 |
+
</gmd:organisationName>
|
118 |
+
<gmd:role>
|
119 |
+
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode"
|
120 |
+
codeListValue="resourceProvider"
|
121 |
+
codeSpace="001">resourceProvider
|
122 |
+
</gmd:CI_RoleCode>
|
123 |
+
</gmd:role>
|
124 |
+
</gmd:CI_ResponsibleParty>
|
125 |
+
</gmd:citedResponsibleParty>
|
126 |
+
</gmd:CI_Citation>
|
127 |
+
</gfc:source>
|
128 |
+
</gfc:FC_DefinitionSource>
|
129 |
+
</gfc:definitionSource>
|
130 |
+
</gfc:FC_DefinitionReference>
|
131 |
+
</gfc:definitionReference>
|
132 |
+
</gfc:FC_ListedValue>
|
133 |
+
</gfc:listedValue>
|
134 |
+
</gfc:FC_FeatureAttribute>
|
135 |
+
</gfc:carrierOfCharacteristics>
|
136 |
+
<gfc:carrierOfCharacteristics>
|
137 |
+
<gfc:FC_FeatureAttribute>
|
138 |
+
<gfc:memberName>
|
139 |
+
<gco:LocalName>AFFGEOID</gco:LocalName>
|
140 |
+
</gfc:memberName>
|
141 |
+
<gfc:definition>
|
142 |
+
<gco:CharacterString>American FactFinder summary level code + geovariant code + '00US' + GEOID</gco:CharacterString>
|
143 |
+
</gfc:definition>
|
144 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
145 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
146 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
147 |
+
<gfc:listedValue>
|
148 |
+
<gfc:FC_ListedValue>
|
149 |
+
<gfc:label>
|
150 |
+
<gco:CharacterString>American FactFinder geographic identifier</gco:CharacterString>
|
151 |
+
</gfc:label>
|
152 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
153 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
154 |
+
</gfc:FC_ListedValue>
|
155 |
+
</gfc:listedValue>
|
156 |
+
</gfc:FC_FeatureAttribute>
|
157 |
+
</gfc:carrierOfCharacteristics>
|
158 |
+
<gfc:carrierOfCharacteristics>
|
159 |
+
<gfc:FC_FeatureAttribute>
|
160 |
+
<gfc:memberName>
|
161 |
+
<gco:LocalName>GEOID</gco:LocalName>
|
162 |
+
</gfc:memberName>
|
163 |
+
<gfc:definition>
|
164 |
+
<gco:CharacterString>County identifier; a concatenation of current state Federal Information Processing Series (FIPS) code and county FIPS code</gco:CharacterString>
|
165 |
+
</gfc:definition>
|
166 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
167 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
168 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
169 |
+
<gfc:listedValue>
|
170 |
+
<gfc:FC_ListedValue>
|
171 |
+
<gfc:label gco:nilReason="inapplicable"/>
|
172 |
+
<gfc:definition>
|
173 |
+
<gco:CharacterString>The GEOID attribute is a concatenation of the state FIPS code followed by the county FIPS code. No spaces are allowed between the two codes. The state FIPS code is taken from "National Standard Codes (ANSI INCITS 38-2009), Federal Information Processing Series (FIPS) - States". The county FIPS code is taken from "National Standard Codes (ANSI INCITS 31-2009), Federal Information Processing Series (FIPS) - Counties/County Equivalents".</gco:CharacterString>
|
174 |
+
</gfc:definition>
|
175 |
+
</gfc:FC_ListedValue>
|
176 |
+
</gfc:listedValue>
|
177 |
+
</gfc:FC_FeatureAttribute>
|
178 |
+
</gfc:carrierOfCharacteristics>
|
179 |
+
<gfc:carrierOfCharacteristics>
|
180 |
+
<gfc:FC_FeatureAttribute>
|
181 |
+
<gfc:memberName>
|
182 |
+
<gco:LocalName>NAME</gco:LocalName>
|
183 |
+
</gfc:memberName>
|
184 |
+
<gfc:definition>
|
185 |
+
<gco:CharacterString>Current county name</gco:CharacterString>
|
186 |
+
</gfc:definition>
|
187 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
188 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
189 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
190 |
+
<gfc:listedValue>
|
191 |
+
<gfc:FC_ListedValue>
|
192 |
+
<gfc:label>
|
193 |
+
<gco:CharacterString>National Standard Codes (ANSI INCITS 31-2009), Federal Information Processing Series (FIPS) - Counties/County Equivalents</gco:CharacterString>
|
194 |
+
</gfc:label>
|
195 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
196 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
197 |
+
</gfc:FC_ListedValue>
|
198 |
+
</gfc:listedValue>
|
199 |
+
</gfc:FC_FeatureAttribute>
|
200 |
+
</gfc:carrierOfCharacteristics>
|
201 |
+
<gfc:carrierOfCharacteristics>
|
202 |
+
<gfc:FC_FeatureAttribute>
|
203 |
+
<gfc:memberName>
|
204 |
+
<gco:LocalName>LSAD</gco:LocalName>
|
205 |
+
</gfc:memberName>
|
206 |
+
<gfc:definition>
|
207 |
+
<gco:CharacterString>Current legal/statistical area description code for county</gco:CharacterString>
|
208 |
+
</gfc:definition>
|
209 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
210 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
211 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
212 |
+
<gfc:listedValue>
|
213 |
+
<gfc:FC_ListedValue>
|
214 |
+
<gfc:label>
|
215 |
+
<gco:CharacterString>00</gco:CharacterString>
|
216 |
+
</gfc:label>
|
217 |
+
<gfc:definition>
|
218 |
+
<gco:CharacterString>Blank</gco:CharacterString>
|
219 |
+
</gfc:definition>
|
220 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
221 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
222 |
+
</gfc:FC_ListedValue>
|
223 |
+
</gfc:listedValue>
|
224 |
+
<gfc:listedValue>
|
225 |
+
<gfc:FC_ListedValue>
|
226 |
+
<gfc:label>
|
227 |
+
<gco:CharacterString>03</gco:CharacterString>
|
228 |
+
</gfc:label>
|
229 |
+
<gfc:definition>
|
230 |
+
<gco:CharacterString>City and Borough (suffix)</gco:CharacterString>
|
231 |
+
</gfc:definition>
|
232 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
233 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
234 |
+
</gfc:FC_ListedValue>
|
235 |
+
</gfc:listedValue>
|
236 |
+
<gfc:listedValue>
|
237 |
+
<gfc:FC_ListedValue>
|
238 |
+
<gfc:label>
|
239 |
+
<gco:CharacterString>04</gco:CharacterString>
|
240 |
+
</gfc:label>
|
241 |
+
<gfc:definition>
|
242 |
+
<gco:CharacterString>Borough (suffix)</gco:CharacterString>
|
243 |
+
</gfc:definition>
|
244 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
245 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
246 |
+
</gfc:FC_ListedValue>
|
247 |
+
</gfc:listedValue>
|
248 |
+
<gfc:listedValue>
|
249 |
+
<gfc:FC_ListedValue>
|
250 |
+
<gfc:label>
|
251 |
+
<gco:CharacterString>05</gco:CharacterString>
|
252 |
+
</gfc:label>
|
253 |
+
<gfc:definition>
|
254 |
+
<gco:CharacterString>Census Area (suffix)</gco:CharacterString>
|
255 |
+
</gfc:definition>
|
256 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
257 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
258 |
+
</gfc:FC_ListedValue>
|
259 |
+
</gfc:listedValue>
|
260 |
+
<gfc:listedValue>
|
261 |
+
<gfc:FC_ListedValue>
|
262 |
+
<gfc:label>
|
263 |
+
<gco:CharacterString>06</gco:CharacterString>
|
264 |
+
</gfc:label>
|
265 |
+
<gfc:definition>
|
266 |
+
<gco:CharacterString>County (suffix)</gco:CharacterString>
|
267 |
+
</gfc:definition>
|
268 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
269 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
270 |
+
</gfc:FC_ListedValue>
|
271 |
+
</gfc:listedValue>
|
272 |
+
<gfc:listedValue>
|
273 |
+
<gfc:FC_ListedValue>
|
274 |
+
<gfc:label>
|
275 |
+
<gco:CharacterString>07</gco:CharacterString>
|
276 |
+
</gfc:label>
|
277 |
+
<gfc:definition>
|
278 |
+
<gco:CharacterString>District (suffix)</gco:CharacterString>
|
279 |
+
</gfc:definition>
|
280 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
281 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
282 |
+
</gfc:FC_ListedValue>
|
283 |
+
</gfc:listedValue>
|
284 |
+
<gfc:listedValue>
|
285 |
+
<gfc:FC_ListedValue>
|
286 |
+
<gfc:label>
|
287 |
+
<gco:CharacterString>10</gco:CharacterString>
|
288 |
+
</gfc:label>
|
289 |
+
<gfc:definition>
|
290 |
+
<gco:CharacterString>Island (suffix)</gco:CharacterString>
|
291 |
+
</gfc:definition>
|
292 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
293 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
294 |
+
</gfc:FC_ListedValue>
|
295 |
+
</gfc:listedValue>
|
296 |
+
<gfc:listedValue>
|
297 |
+
<gfc:FC_ListedValue>
|
298 |
+
<gfc:label>
|
299 |
+
<gco:CharacterString>12</gco:CharacterString>
|
300 |
+
</gfc:label>
|
301 |
+
<gfc:definition>
|
302 |
+
<gco:CharacterString>Municipality (suffix)</gco:CharacterString>
|
303 |
+
</gfc:definition>
|
304 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
305 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
306 |
+
</gfc:FC_ListedValue>
|
307 |
+
</gfc:listedValue>
|
308 |
+
<gfc:listedValue>
|
309 |
+
<gfc:FC_ListedValue>
|
310 |
+
<gfc:label>
|
311 |
+
<gco:CharacterString>13</gco:CharacterString>
|
312 |
+
</gfc:label>
|
313 |
+
<gfc:definition>
|
314 |
+
<gco:CharacterString>Municipio (suffix)</gco:CharacterString>
|
315 |
+
</gfc:definition>
|
316 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
317 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
318 |
+
</gfc:FC_ListedValue>
|
319 |
+
</gfc:listedValue>
|
320 |
+
<gfc:listedValue>
|
321 |
+
<gfc:FC_ListedValue>
|
322 |
+
<gfc:label>
|
323 |
+
<gco:CharacterString>15</gco:CharacterString>
|
324 |
+
</gfc:label>
|
325 |
+
<gfc:definition>
|
326 |
+
<gco:CharacterString>Parish (suffix)</gco:CharacterString>
|
327 |
+
</gfc:definition>
|
328 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
329 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
330 |
+
</gfc:FC_ListedValue>
|
331 |
+
</gfc:listedValue>
|
332 |
+
<gfc:listedValue>
|
333 |
+
<gfc:FC_ListedValue>
|
334 |
+
<gfc:label>
|
335 |
+
<gco:CharacterString>25</gco:CharacterString>
|
336 |
+
</gfc:label>
|
337 |
+
<gfc:definition>
|
338 |
+
<gco:CharacterString>city (suffix)</gco:CharacterString>
|
339 |
+
</gfc:definition>
|
340 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
341 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
342 |
+
</gfc:FC_ListedValue>
|
343 |
+
</gfc:listedValue>
|
344 |
+
</gfc:FC_FeatureAttribute>
|
345 |
+
</gfc:carrierOfCharacteristics>
|
346 |
+
<gfc:carrierOfCharacteristics>
|
347 |
+
<gfc:FC_FeatureAttribute>
|
348 |
+
<gfc:memberName>
|
349 |
+
<gco:LocalName>ALAND</gco:LocalName>
|
350 |
+
</gfc:memberName>
|
351 |
+
<gfc:definition>
|
352 |
+
<gco:CharacterString>Current land area (square meters)</gco:CharacterString>
|
353 |
+
</gfc:definition>
|
354 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
355 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
356 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
357 |
+
<gfc:valueMeasurementUnit>
|
358 |
+
<gml:DerivedUnit gml:id="areaInMetersSquaredforALAND">
|
359 |
+
<gml:identifier codeSpace="area"/>
|
360 |
+
<gml:derivationUnitTerm uom="m" exponent="2"/>
|
361 |
+
</gml:DerivedUnit>
|
362 |
+
</gfc:valueMeasurementUnit>
|
363 |
+
<gfc:listedValue>
|
364 |
+
<gfc:FC_ListedValue>
|
365 |
+
<gfc:label gco:nilReason="inapplicable"/>
|
366 |
+
<gfc:definition>
|
367 |
+
<gco:CharacterString> Range Domain Minimum: 0
|
368 |
+
Range Domain Maximum: 9,999,999,999,999</gco:CharacterString>
|
369 |
+
</gfc:definition>
|
370 |
+
</gfc:FC_ListedValue>
|
371 |
+
</gfc:listedValue>
|
372 |
+
</gfc:FC_FeatureAttribute>
|
373 |
+
</gfc:carrierOfCharacteristics>
|
374 |
+
<gfc:carrierOfCharacteristics>
|
375 |
+
<gfc:FC_FeatureAttribute>
|
376 |
+
<gfc:memberName>
|
377 |
+
<gco:LocalName>AWATER</gco:LocalName>
|
378 |
+
</gfc:memberName>
|
379 |
+
<gfc:definition>
|
380 |
+
<gco:CharacterString>Current water area (square meters)</gco:CharacterString>
|
381 |
+
</gfc:definition>
|
382 |
+
<gfc:cardinality gco:nilReason="unknown"/>
|
383 |
+
<gfc:definitionReference xlink:title="U.S. Census Bureau"
|
384 |
+
xlink:href="http://www.ngdc.noaa.gov/docucomp/eb139e38-ee29-4d59-b157-5e874d4420c4"/>
|
385 |
+
<gfc:valueMeasurementUnit>
|
386 |
+
<gml:DerivedUnit gml:id="areaInMetersSquaredforAWATER">
|
387 |
+
<gml:identifier codeSpace="area"/>
|
388 |
+
<gml:derivationUnitTerm uom="m" exponent="2"/>
|
389 |
+
</gml:DerivedUnit>
|
390 |
+
</gfc:valueMeasurementUnit>
|
391 |
+
<gfc:listedValue>
|
392 |
+
<gfc:FC_ListedValue>
|
393 |
+
<gfc:label gco:nilReason="inapplicable"/>
|
394 |
+
<gfc:definition>
|
395 |
+
<gco:CharacterString> Range Domain Minimum: 0
|
396 |
+
Range Domain Maximum: 9,999,999,999,999</gco:CharacterString>
|
397 |
+
</gfc:definition>
|
398 |
+
</gfc:FC_ListedValue>
|
399 |
+
</gfc:listedValue>
|
400 |
+
</gfc:FC_FeatureAttribute>
|
401 |
+
</gfc:carrierOfCharacteristics>
|
402 |
+
</gfc:FC_FeatureType>
|
403 |
+
</gfc:featureType>
|
404 |
+
</gfc:FC_FeatureCatalogue>
|
39/replication_package/data/county shapefile/cb_2016_us_county_500k.shp.iso.xml
ADDED
@@ -0,0 +1,539 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<gmi:MI_Metadata xmlns:xlink="http://www.w3.org/1999/xlink"
|
3 |
+
xmlns:gmd="http://www.isotc211.org/2005/gmd"
|
4 |
+
xmlns:gco="http://www.isotc211.org/2005/gco"
|
5 |
+
xmlns:gml="http://www.opengis.net/gml/3.2"
|
6 |
+
xmlns:gmi="http://www.isotc211.org/2005/gmi">
|
7 |
+
<gmd:fileIdentifier>
|
8 |
+
<gco:CharacterString>cb_2016_us_county_500k.shp.iso.xml</gco:CharacterString>
|
9 |
+
</gmd:fileIdentifier>
|
10 |
+
<gmd:language>
|
11 |
+
<gco:CharacterString>eng</gco:CharacterString>
|
12 |
+
</gmd:language>
|
13 |
+
<gmd:characterSet>
|
14 |
+
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
|
15 |
+
codeListValue="UTF-8"
|
16 |
+
codeSpace="">UTF-8</gmd:MD_CharacterSetCode>
|
17 |
+
</gmd:characterSet>
|
18 |
+
<gmd:hierarchyLevel>
|
19 |
+
<gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode"
|
20 |
+
codeListValue="dataset">
|
21 |
+
dataset
|
22 |
+
</gmd:MD_ScopeCode>
|
23 |
+
</gmd:hierarchyLevel>
|
24 |
+
<gmd:contact xlink:href="https://www.ngdc.noaa.gov/docucomp/1df27e57-4768-42de-909b-52f530601fba"
|
25 |
+
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch (point of Contact)"/>
|
26 |
+
<gmd:dateStamp>
|
27 |
+
<gco:Date>2017-03</gco:Date>
|
28 |
+
</gmd:dateStamp>
|
29 |
+
<gmd:metadataStandardName>
|
30 |
+
<gco:CharacterString>ISO 19115 Geographic Information - Metadata </gco:CharacterString>
|
31 |
+
</gmd:metadataStandardName>
|
32 |
+
<gmd:metadataStandardVersion>
|
33 |
+
<gco:CharacterString>2009-02-15 </gco:CharacterString>
|
34 |
+
</gmd:metadataStandardVersion>
|
35 |
+
<gmd:dataSetURI>
|
36 |
+
<gco:CharacterString>https://www2.census.gov/geo/tiger/GENZ2016/shp/cb_2016_us_county_500k.zip</gco:CharacterString>
|
37 |
+
</gmd:dataSetURI>
|
38 |
+
<!-- This is the ptvctinf/sdtsterm/sdtstype from section 3 of the FGDC Standard (Spatial Data Organization) -->
|
39 |
+
<gmd:spatialRepresentationInfo>
|
40 |
+
<gmd:MD_VectorSpatialRepresentation>
|
41 |
+
<gmd:geometricObjects>
|
42 |
+
<gmd:MD_GeometricObjects>
|
43 |
+
<gmd:geometricObjectType>
|
44 |
+
<gmd:MD_GeometricObjectTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_GeometricObjectTypeCode"
|
45 |
+
codeListValue="complex"
|
46 |
+
codeSpace="001">
|
47 |
+
complex </gmd:MD_GeometricObjectTypeCode>
|
48 |
+
</gmd:geometricObjectType>
|
49 |
+
<gmd:geometricObjectCount>
|
50 |
+
<gco:Integer>3233</gco:Integer>
|
51 |
+
</gmd:geometricObjectCount>
|
52 |
+
</gmd:MD_GeometricObjects>
|
53 |
+
</gmd:geometricObjects>
|
54 |
+
</gmd:MD_VectorSpatialRepresentation>
|
55 |
+
</gmd:spatialRepresentationInfo>
|
56 |
+
<!--This is the indirect spatial reference of section 3 of the FGDC Standard-->
|
57 |
+
<gmd:referenceSystemInfo>
|
58 |
+
<gmd:MD_ReferenceSystem>
|
59 |
+
<gmd:referenceSystemIdentifier>
|
60 |
+
<gmd:RS_Identifier>
|
61 |
+
<gmd:code gco:nilReason="unknown"/>
|
62 |
+
<gmd:codeSpace>
|
63 |
+
<gco:CharacterString>INCITS (formerly FIPS) codes</gco:CharacterString>
|
64 |
+
</gmd:codeSpace>
|
65 |
+
</gmd:RS_Identifier>
|
66 |
+
</gmd:referenceSystemIdentifier>
|
67 |
+
</gmd:MD_ReferenceSystem>
|
68 |
+
</gmd:referenceSystemInfo>
|
69 |
+
<!--This part represents Section 1 of the FGDC Metadata Standard -->
|
70 |
+
<gmd:identificationInfo>
|
71 |
+
<gmd:MD_DataIdentification>
|
72 |
+
<gmd:citation>
|
73 |
+
<gmd:CI_Citation>
|
74 |
+
<gmd:title>
|
75 |
+
<gco:CharacterString>2016 Cartographic Boundary File, Current County and Equivalent for United States, 1:500,000</gco:CharacterString>
|
76 |
+
</gmd:title>
|
77 |
+
<gmd:date>
|
78 |
+
<gmd:CI_Date>
|
79 |
+
<!-- This is the publication date -->
|
80 |
+
<gmd:date>
|
81 |
+
<gco:Date>2017-03</gco:Date>
|
82 |
+
</gmd:date>
|
83 |
+
<gmd:dateType>
|
84 |
+
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode"
|
85 |
+
codeListValue="publication"
|
86 |
+
codeSpace="002"> publication </gmd:CI_DateTypeCode>
|
87 |
+
</gmd:dateType>
|
88 |
+
</gmd:CI_Date>
|
89 |
+
</gmd:date>
|
90 |
+
|
91 |
+
<gmd:citedResponsibleParty xlink:href="https://www.ngdc.noaa.gov/docucomp/ddd21bfb-2229-465b-95b2-bee36200b0e5"
|
92 |
+
xlink:title="originator - U.S. Department of Commerce, U.S. Census Bureau, Geography Division/Cartographic Products and Services Branch"/>
|
93 |
+
<gmd:presentationForm>
|
94 |
+
<gmd:CI_PresentationFormCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_PresentationFormCode"
|
95 |
+
codeListValue="mapDigital"/>
|
96 |
+
</gmd:presentationForm>
|
97 |
+
</gmd:CI_Citation>
|
98 |
+
</gmd:citation>
|
99 |
+
<gmd:abstract>
|
100 |
+
<gco:CharacterString>The 2016 cartographic boundary shapefiles are simplified representations of selected geographic areas from the U.S. Census Bureau's Master Address File / Topologically Integrated Geographic Encoding and Referencing (MAF/TIGER) Database (MTDB). These boundary files are specifically designed for small-scale thematic mapping. When possible, generalization is performed with the intent to maintain the hierarchical relationships among geographies and to maintain the alignment of geographies within a file set for a given year. Geographic areas may not align with the same areas from another year. Some geographies are available as nation-based files while others are available only as state-based files.
|
101 |
+
|
102 |
+
The primary legal divisions of most states are termed counties. In Louisiana, these divisions are known as parishes. In Alaska, which has no counties, the equivalent entities are the organized boroughs, city and boroughs, municipalities, and for the unorganized area, census areas. The latter are delineated cooperatively for statistical purposes by the State of Alaska and the Census Bureau. In four states (Maryland, Missouri, Nevada, and Virginia), there are one or more incorporated places that are independent of any county organization and thus constitute primary divisions of their states. These incorporated places are known as independent cities and are treated as equivalent entities for purposes of data presentation. The District of Columbia and Guam have no primary divisions, and each area is considered an equivalent entity for purposes of data presentation. The Census Bureau treats the following entities as equivalents of counties for purposes of data presentation: Municipios in Puerto Rico, Districts and Islands in American Samoa, Municipalities in the Commonwealth of the Northern Mariana Islands, and Islands in the U.S. Virgin Islands. The entire area of the United States, Puerto Rico, and the Island Areas is covered by counties or equivalent entities.
|
103 |
+
|
104 |
+
The generalized boundaries for counties and equivalent entities are based on those as of January 1, 2016, primarily as reported through the Census Bureau's Boundary and Annexation Survey (BAS).</gco:CharacterString>
|
105 |
+
</gmd:abstract>
|
106 |
+
<gmd:purpose>
|
107 |
+
<gco:CharacterString>These files were specifically created to support small-scale thematic mapping. To improve the appearance of shapes at small scales, areas are represented with fewer vertices than detailed TIGER/Line Shapefiles. Cartographic boundary files take up less disk space than their ungeneralized counterparts. Cartographic boundary files take less time to render on screen than TIGER/Line Shapefiles. You can join this file with table data downloaded from American FactFinder by using the AFFGEOID field in the cartographic boundary file. If detailed boundaries are required, please use the TIGER/Line Shapefiles instead of the generalized cartographic boundary files.</gco:CharacterString>
|
108 |
+
</gmd:purpose>
|
109 |
+
<gmd:status>
|
110 |
+
<gmd:MD_ProgressCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ProgressCode"
|
111 |
+
codeListValue="completed">
|
112 |
+
completed
|
113 |
+
</gmd:MD_ProgressCode>
|
114 |
+
</gmd:status>
|
115 |
+
<gmd:pointOfContact xlink:href="https://www.ngdc.noaa.gov/docucomp/09b8253a-e2dc-4a6b-a905-11f1e0e87b3b"
|
116 |
+
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch (point of Contact)"/>
|
117 |
+
<gmd:resourceMaintenance>
|
118 |
+
<gmd:MD_MaintenanceInformation>
|
119 |
+
<gmd:maintenanceAndUpdateFrequency>
|
120 |
+
<gmd:MD_MaintenanceFrequencyCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_MaintenanceFrequencyCode"
|
121 |
+
codeListValue="notPlanned"
|
122 |
+
codeSpace="011">
|
123 |
+
notPlanned
|
124 |
+
</gmd:MD_MaintenanceFrequencyCode>
|
125 |
+
</gmd:maintenanceAndUpdateFrequency>
|
126 |
+
</gmd:MD_MaintenanceInformation>
|
127 |
+
</gmd:resourceMaintenance>
|
128 |
+
<gmd:descriptiveKeywords>
|
129 |
+
<gmd:MD_Keywords>
|
130 |
+
<gmd:keyword>
|
131 |
+
<gco:CharacterString>Boundaries</gco:CharacterString>
|
132 |
+
</gmd:keyword>
|
133 |
+
<gmd:type>
|
134 |
+
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode"
|
135 |
+
codeListValue="theme"
|
136 |
+
codeSpace="005"> theme </gmd:MD_KeywordTypeCode>
|
137 |
+
</gmd:type>
|
138 |
+
<gmd:thesaurusName>
|
139 |
+
<gmd:CI_Citation>
|
140 |
+
<gmd:title>
|
141 |
+
<gco:CharacterString>ISO 19115 Topic Categories</gco:CharacterString>
|
142 |
+
</gmd:title>
|
143 |
+
<gmd:date gco:nilReason="unknown"/>
|
144 |
+
</gmd:CI_Citation>
|
145 |
+
</gmd:thesaurusName>
|
146 |
+
</gmd:MD_Keywords>
|
147 |
+
</gmd:descriptiveKeywords>
|
148 |
+
<gmd:descriptiveKeywords>
|
149 |
+
<gmd:MD_Keywords>
|
150 |
+
<gmd:keyword>
|
151 |
+
<gco:CharacterString>2016</gco:CharacterString>
|
152 |
+
</gmd:keyword>
|
153 |
+
<gmd:keyword>
|
154 |
+
<gco:CharacterString>SHP</gco:CharacterString>
|
155 |
+
</gmd:keyword>
|
156 |
+
<gmd:keyword>
|
157 |
+
<gco:CharacterString>Borough</gco:CharacterString>
|
158 |
+
</gmd:keyword>
|
159 |
+
<gmd:keyword>
|
160 |
+
<gco:CharacterString>Cartographic Boundary</gco:CharacterString>
|
161 |
+
</gmd:keyword>
|
162 |
+
<gmd:keyword>
|
163 |
+
<gco:CharacterString>Census Area</gco:CharacterString>
|
164 |
+
</gmd:keyword>
|
165 |
+
<gmd:keyword>
|
166 |
+
<gco:CharacterString>City</gco:CharacterString>
|
167 |
+
</gmd:keyword>
|
168 |
+
<gmd:keyword>
|
169 |
+
<gco:CharacterString>City and Borough</gco:CharacterString>
|
170 |
+
</gmd:keyword>
|
171 |
+
<gmd:keyword>
|
172 |
+
<gco:CharacterString>County</gco:CharacterString>
|
173 |
+
</gmd:keyword>
|
174 |
+
<gmd:keyword>
|
175 |
+
<gco:CharacterString>County equivalent</gco:CharacterString>
|
176 |
+
</gmd:keyword>
|
177 |
+
<gmd:keyword>
|
178 |
+
<gco:CharacterString>District</gco:CharacterString>
|
179 |
+
</gmd:keyword>
|
180 |
+
<gmd:keyword>
|
181 |
+
<gco:CharacterString>Generalized</gco:CharacterString>
|
182 |
+
</gmd:keyword>
|
183 |
+
<gmd:keyword>
|
184 |
+
<gco:CharacterString>Independent City</gco:CharacterString>
|
185 |
+
</gmd:keyword>
|
186 |
+
<gmd:keyword>
|
187 |
+
<gco:CharacterString>Island</gco:CharacterString>
|
188 |
+
</gmd:keyword>
|
189 |
+
<gmd:keyword>
|
190 |
+
<gco:CharacterString>Municipality</gco:CharacterString>
|
191 |
+
</gmd:keyword>
|
192 |
+
<gmd:keyword>
|
193 |
+
<gco:CharacterString>Municipio</gco:CharacterString>
|
194 |
+
</gmd:keyword>
|
195 |
+
<gmd:keyword>
|
196 |
+
<gco:CharacterString>Parish</gco:CharacterString>
|
197 |
+
</gmd:keyword>
|
198 |
+
<gmd:keyword>
|
199 |
+
<gco:CharacterString>State</gco:CharacterString>
|
200 |
+
</gmd:keyword>
|
201 |
+
<gmd:type>
|
202 |
+
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode"
|
203 |
+
codeListValue="theme"
|
204 |
+
codeSpace="005"> theme </gmd:MD_KeywordTypeCode>
|
205 |
+
</gmd:type>
|
206 |
+
<gmd:thesaurusName>
|
207 |
+
<gmd:CI_Citation>
|
208 |
+
<gmd:title>
|
209 |
+
<gco:CharacterString>None</gco:CharacterString>
|
210 |
+
</gmd:title>
|
211 |
+
<gmd:date gco:nilReason="unknown"/>
|
212 |
+
</gmd:CI_Citation>
|
213 |
+
</gmd:thesaurusName>
|
214 |
+
</gmd:MD_Keywords>
|
215 |
+
</gmd:descriptiveKeywords>
|
216 |
+
<gmd:descriptiveKeywords>
|
217 |
+
<gmd:MD_Keywords>
|
218 |
+
<gmd:keyword>
|
219 |
+
<gco:CharacterString>United States</gco:CharacterString>
|
220 |
+
</gmd:keyword>
|
221 |
+
<gmd:keyword>
|
222 |
+
<gco:CharacterString>US</gco:CharacterString>
|
223 |
+
</gmd:keyword>
|
224 |
+
<gmd:type>
|
225 |
+
<gmd:MD_KeywordTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_KeywordTypeCode"
|
226 |
+
codeListValue="place"
|
227 |
+
codeSpace="002"> place </gmd:MD_KeywordTypeCode>
|
228 |
+
</gmd:type>
|
229 |
+
<gmd:thesaurusName>
|
230 |
+
<gmd:CI_Citation>
|
231 |
+
<gmd:title>
|
232 |
+
<gco:CharacterString>ISO 3166 Codes for the representation of names of countries and their subdivisions
|
233 |
+
|
234 |
+
</gco:CharacterString>
|
235 |
+
</gmd:title>
|
236 |
+
<gmd:date gco:nilReason="unknown"/>
|
237 |
+
</gmd:CI_Citation>
|
238 |
+
</gmd:thesaurusName>
|
239 |
+
</gmd:MD_Keywords>
|
240 |
+
</gmd:descriptiveKeywords>
|
241 |
+
<gmd:resourceConstraints>
|
242 |
+
<gmd:MD_LegalConstraints>
|
243 |
+
<gmd:accessConstraints>
|
244 |
+
<gmd:MD_RestrictionCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_RestrictionCode"
|
245 |
+
codeListValue="otherRestrictions"
|
246 |
+
codeSpace="008 "> otherRestrictions </gmd:MD_RestrictionCode>
|
247 |
+
</gmd:accessConstraints>
|
248 |
+
<gmd:useConstraints>
|
249 |
+
<gmd:MD_RestrictionCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_RestrictionCode"
|
250 |
+
codeListValue="otherRestrictions"
|
251 |
+
codeSpace="008 "/>
|
252 |
+
</gmd:useConstraints>
|
253 |
+
<gmd:otherConstraints>
|
254 |
+
<gco:CharacterString> Access Constraints: None</gco:CharacterString>
|
255 |
+
</gmd:otherConstraints>
|
256 |
+
<gmd:otherConstraints>
|
257 |
+
<gco:CharacterString> Use Constraints:The intended display scale for this file is 1:500,000. This file should not be displayed at scales larger than 1:500,000.
|
258 |
+
|
259 |
+
These products are free to use in a product or publication, however acknowledgement must be given to the U.S. Census Bureau as the source. The boundary information is for visual display at appropriate small scales only. Cartographic boundary files should not be used for geographic analysis including area or perimeter calculation. Files should not be used for geocoding addresses. Files should not be used for determining precise geographic area relationships.
|
260 |
+
</gco:CharacterString>
|
261 |
+
</gmd:otherConstraints>
|
262 |
+
</gmd:MD_LegalConstraints>
|
263 |
+
</gmd:resourceConstraints>
|
264 |
+
<!-- This is from the Direct Spatial Reference from Chapter 3 -->
|
265 |
+
<gmd:spatialRepresentationType>
|
266 |
+
<gmd:MD_SpatialRepresentationTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_SpatialRepresentationTypeCode"
|
267 |
+
codeListValue="vector">vector</gmd:MD_SpatialRepresentationTypeCode>
|
268 |
+
</gmd:spatialRepresentationType>
|
269 |
+
<gmd:spatialResolution>
|
270 |
+
<gmd:MD_Resolution>
|
271 |
+
<gmd:equivalentScale>
|
272 |
+
<gmd:MD_RepresentativeFraction>
|
273 |
+
<gmd:denominator>
|
274 |
+
<gco:Integer>500000</gco:Integer>
|
275 |
+
</gmd:denominator>
|
276 |
+
</gmd:MD_RepresentativeFraction>
|
277 |
+
</gmd:equivalentScale>
|
278 |
+
</gmd:MD_Resolution>
|
279 |
+
</gmd:spatialResolution>
|
280 |
+
<gmd:language>
|
281 |
+
<gco:CharacterString>eng</gco:CharacterString>
|
282 |
+
</gmd:language>
|
283 |
+
<gmd:characterSet>
|
284 |
+
<gmd:MD_CharacterSetCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_CharacterSetCode"
|
285 |
+
codeListValue="UTF-8"
|
286 |
+
codeSpace="">UTF-8</gmd:MD_CharacterSetCode>
|
287 |
+
</gmd:characterSet>
|
288 |
+
<gmd:topicCategory>
|
289 |
+
<gmd:MD_TopicCategoryCode>boundaries</gmd:MD_TopicCategoryCode>
|
290 |
+
</gmd:topicCategory>
|
291 |
+
<gmd:environmentDescription>
|
292 |
+
<gco:CharacterString>The cartographic boundary files contain geographic data only and do not include display mapping software or statistical data. For information on how to use cartographic boundary file data with specific software package users shall contact the company that produced the software.</gco:CharacterString>
|
293 |
+
</gmd:environmentDescription>
|
294 |
+
<gmd:extent>
|
295 |
+
<gmd:EX_Extent id="boundingExtent">
|
296 |
+
<gmd:geographicElement>
|
297 |
+
<gmd:EX_GeographicBoundingBox id="boundingGeographicBoundingBox">
|
298 |
+
<gmd:westBoundLongitude>
|
299 |
+
<gco:Decimal>-179.148909</gco:Decimal>
|
300 |
+
</gmd:westBoundLongitude>
|
301 |
+
<gmd:eastBoundLongitude>
|
302 |
+
<gco:Decimal>179.77847</gco:Decimal>
|
303 |
+
</gmd:eastBoundLongitude>
|
304 |
+
<gmd:southBoundLatitude>
|
305 |
+
<gco:Decimal>-14.548699</gco:Decimal>
|
306 |
+
</gmd:southBoundLatitude>
|
307 |
+
<gmd:northBoundLatitude>
|
308 |
+
<gco:Decimal>71.365162</gco:Decimal>
|
309 |
+
</gmd:northBoundLatitude>
|
310 |
+
</gmd:EX_GeographicBoundingBox>
|
311 |
+
</gmd:geographicElement>
|
312 |
+
<gmd:temporalElement>
|
313 |
+
<gmd:EX_TemporalExtent id="boundingTemporalExtent">
|
314 |
+
<gmd:extent>
|
315 |
+
<gml:TimePeriod gml:id="boundingTemporalExtentA">
|
316 |
+
<gml:description>publication date</gml:description>
|
317 |
+
<gml:beginPosition>2017-03</gml:beginPosition>
|
318 |
+
<gml:endPosition>2017-03</gml:endPosition>
|
319 |
+
</gml:TimePeriod>
|
320 |
+
</gmd:extent>
|
321 |
+
</gmd:EX_TemporalExtent>
|
322 |
+
</gmd:temporalElement>
|
323 |
+
</gmd:EX_Extent>
|
324 |
+
</gmd:extent>
|
325 |
+
</gmd:MD_DataIdentification>
|
326 |
+
</gmd:identificationInfo>
|
327 |
+
<!--This section provides the link for the file containing the Entity and Attribute Information. -->
|
328 |
+
<gmd:contentInfo>
|
329 |
+
<gmd:MD_FeatureCatalogueDescription>
|
330 |
+
<gmd:includedWithDataset>
|
331 |
+
<gco:Boolean>true</gco:Boolean>
|
332 |
+
</gmd:includedWithDataset>
|
333 |
+
<gmd:featureCatalogueCitation>
|
334 |
+
<gmd:CI_Citation>
|
335 |
+
<gmd:title>
|
336 |
+
<gco:CharacterString>Feature Catalog for the 2016 Current County and Equivalent 1:500,000 Cartographic Boundary File</gco:CharacterString>
|
337 |
+
</gmd:title>
|
338 |
+
<gmd:date>
|
339 |
+
<gmd:CI_Date>
|
340 |
+
<gmd:date gco:nilReason="missing"/>
|
341 |
+
<gmd:dateType>
|
342 |
+
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode"
|
343 |
+
codeListValue="publication"
|
344 |
+
codeSpace="002"/>
|
345 |
+
</gmd:dateType>
|
346 |
+
</gmd:CI_Date>
|
347 |
+
</gmd:date>
|
348 |
+
<gmd:otherCitationDetails>
|
349 |
+
<gco:CharacterString>https://meta.geo.census.gov/data/existing/decennial/GEO/CPMB/boundary/2016cb/county_500k/2016_county_500k.ea.iso.xml</gco:CharacterString>
|
350 |
+
</gmd:otherCitationDetails>
|
351 |
+
</gmd:CI_Citation>
|
352 |
+
</gmd:featureCatalogueCitation>
|
353 |
+
</gmd:MD_FeatureCatalogueDescription>
|
354 |
+
</gmd:contentInfo>
|
355 |
+
<gmd:distributionInfo>
|
356 |
+
<gmd:MD_Distribution>
|
357 |
+
<gmd:distributionFormat>
|
358 |
+
<gmd:MD_Format>
|
359 |
+
<gmd:name>
|
360 |
+
<gco:CharacterString>SHP</gco:CharacterString>
|
361 |
+
</gmd:name>
|
362 |
+
<gmd:version gco:nilReason="unknown"/>
|
363 |
+
<gmd:fileDecompressionTechnique>
|
364 |
+
<gco:CharacterString>PK-ZIP, version 1.93A or higher</gco:CharacterString>
|
365 |
+
</gmd:fileDecompressionTechnique>
|
366 |
+
</gmd:MD_Format>
|
367 |
+
</gmd:distributionFormat>
|
368 |
+
<gmd:distributionFormat>
|
369 |
+
<gmd:MD_Format>
|
370 |
+
<gmd:name>
|
371 |
+
<gco:CharacterString>HTML</gco:CharacterString>
|
372 |
+
</gmd:name>
|
373 |
+
<gmd:version gco:nilReason="unknown"/>
|
374 |
+
</gmd:MD_Format>
|
375 |
+
</gmd:distributionFormat>
|
376 |
+
<gmd:distributor>
|
377 |
+
<gmd:MD_Distributor>
|
378 |
+
<gmd:distributorContact xlink:href="https://www.ngdc.noaa.gov/docucomp/f48e4893-a57f-4f2b-ad5d-0cca1b34ec62"
|
379 |
+
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geography Division, Geographic Products Branch (distributor)"/>
|
380 |
+
<gmd:distributionOrderProcess>
|
381 |
+
<gmd:MD_StandardOrderProcess>
|
382 |
+
<gmd:fees>
|
383 |
+
<gco:CharacterString>The online cartographic boundary files may be downloaded without charge.</gco:CharacterString>
|
384 |
+
</gmd:fees>
|
385 |
+
<gmd:orderingInstructions>
|
386 |
+
<gco:CharacterString>To obtain more information about ordering Cartographic Boundary Files visit https://www.census.gov/geo/www/tiger.</gco:CharacterString>
|
387 |
+
</gmd:orderingInstructions>
|
388 |
+
</gmd:MD_StandardOrderProcess>
|
389 |
+
</gmd:distributionOrderProcess>
|
390 |
+
</gmd:MD_Distributor>
|
391 |
+
</gmd:distributor>
|
392 |
+
<gmd:transferOptions>
|
393 |
+
<gmd:MD_DigitalTransferOptions>
|
394 |
+
<gmd:onLine>
|
395 |
+
<gmd:CI_OnlineResource>
|
396 |
+
<gmd:linkage>
|
397 |
+
<gmd:URL>https://www2.census.gov/geo/tiger/GENZ2016/shp/cb_2016_us_county_500k.zip</gmd:URL>
|
398 |
+
</gmd:linkage>
|
399 |
+
<gmd:name>
|
400 |
+
<gco:CharacterString>Shapefile Zip File</gco:CharacterString>
|
401 |
+
</gmd:name>
|
402 |
+
</gmd:CI_OnlineResource>
|
403 |
+
</gmd:onLine>
|
404 |
+
</gmd:MD_DigitalTransferOptions>
|
405 |
+
</gmd:transferOptions>
|
406 |
+
<gmd:transferOptions>
|
407 |
+
<gmd:MD_DigitalTransferOptions>
|
408 |
+
<gmd:onLine>
|
409 |
+
<gmd:CI_OnlineResource>
|
410 |
+
<gmd:linkage>
|
411 |
+
<gmd:URL>https://www.census.gov/geo/maps-data/data/tiger-cart-boundary.html</gmd:URL>
|
412 |
+
</gmd:linkage>
|
413 |
+
<gmd:name>
|
414 |
+
<gco:CharacterString>Cartographic Boundary Shapefiles</gco:CharacterString>
|
415 |
+
</gmd:name>
|
416 |
+
<gmd:description>
|
417 |
+
<gco:CharacterString>Simplified representations of selected geographic areas from the Census Bureau's MAF/TIGER geographic database</gco:CharacterString>
|
418 |
+
</gmd:description>
|
419 |
+
</gmd:CI_OnlineResource>
|
420 |
+
</gmd:onLine>
|
421 |
+
</gmd:MD_DigitalTransferOptions>
|
422 |
+
</gmd:transferOptions>
|
423 |
+
</gmd:MD_Distribution>
|
424 |
+
</gmd:distributionInfo>
|
425 |
+
<gmd:dataQualityInfo>
|
426 |
+
<gmd:DQ_DataQuality>
|
427 |
+
<gmd:scope>
|
428 |
+
<gmd:DQ_Scope>
|
429 |
+
<gmd:level>
|
430 |
+
<gmd:MD_ScopeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode"
|
431 |
+
codeListValue="dataset"
|
432 |
+
codeSpace="005"> dataset </gmd:MD_ScopeCode>
|
433 |
+
</gmd:level>
|
434 |
+
</gmd:DQ_Scope>
|
435 |
+
</gmd:scope>
|
436 |
+
<gmd:report>
|
437 |
+
<gmd:DQ_CompletenessCommission>
|
438 |
+
<gmd:evaluationMethodDescription>
|
439 |
+
<gco:CharacterString>The cartographic boundary files are generalized representations of extracts taken from the MAF/TIGER Database. Generalized boundary files are clipped to a simplified version of the U.S. outline. As a result, some off-shore areas may be excluded from the generalized files. Some small geographic areas, holes, or discontiguous parts of areas may not be included in generalized files if they are not visible at the target scale.</gco:CharacterString>
|
440 |
+
</gmd:evaluationMethodDescription>
|
441 |
+
<gmd:result gco:nilReason="unknown"/>
|
442 |
+
</gmd:DQ_CompletenessCommission>
|
443 |
+
</gmd:report>
|
444 |
+
<gmd:report>
|
445 |
+
<gmd:DQ_CompletenessOmission>
|
446 |
+
<gmd:evaluationMethodDescription>
|
447 |
+
<gco:CharacterString>The cartographic boundary files are generalized representations of extracts taken from the MAF/TIGER Database. Generalized boundary files are clipped to a simplified version of the U.S. outline. As a result, some off-shore areas may be excluded from the generalized files. Some small geographic areas, holes, or discontiguous parts of areas may not be included in generalized files if they are not visible at the target scale.</gco:CharacterString>
|
448 |
+
</gmd:evaluationMethodDescription>
|
449 |
+
<gmd:result gco:nilReason="unknown"/>
|
450 |
+
</gmd:DQ_CompletenessOmission>
|
451 |
+
</gmd:report>
|
452 |
+
<gmd:report>
|
453 |
+
<gmd:DQ_ConceptualConsistency>
|
454 |
+
<gmd:measureDescription>
|
455 |
+
<gco:CharacterString>The Census Bureau performed automated tests to ensure logical consistency of the source database. Segments making up the outer and inner boundaries of a polygon tie end-to-end to completely enclose the area. All polygons were tested for closure. The Census Bureau uses its internally developed geographic update system to enhance and modify spatial and attribute data in the Census MAF/TIGER database. Standard geographic codes, such as INCITS (formerly FIPS) codes for states, counties, municipalities, county subdivisions, places, American Indian/Alaska Native/Native Hawaiian areas, and congressional districts are used when encoding spatial entities. The Census Bureau performed spatial data tests for logical consistency of the codes during the compilation of the original Census MAF/TIGER database files. Feature attribute information has been examined but has not been fully tested for consistency.
|
456 |
+
|
457 |
+
For the cartographic boundary files, the Point and Vector Object Count for the G-polygon SDTS Point and Vector Object Type reflects the number of records in the file's data table. For multi-polygon features, only one attribute record exists for each multi-polygon rather than one attribute record per individual G-polygon component of the multi-polygon feature. Cartographic Boundary File multi-polygons are an exception to the G-polygon object type classification. Therefore, when multi-polygons exist in a file, the object count will be less than the actual number of G-polygons.</gco:CharacterString>
|
458 |
+
</gmd:measureDescription>
|
459 |
+
<gmd:result gco:nilReason="unknown"/>
|
460 |
+
</gmd:DQ_ConceptualConsistency>
|
461 |
+
</gmd:report>
|
462 |
+
<gmd:lineage>
|
463 |
+
<gmd:LI_Lineage>
|
464 |
+
<gmd:processStep>
|
465 |
+
<gmd:LI_ProcessStep>
|
466 |
+
<gmd:description>
|
467 |
+
<gco:CharacterString>Spatial data were extracted from the MAF/TIGER database and processed through a U.S. Census Bureau batch generalization system.</gco:CharacterString>
|
468 |
+
</gmd:description>
|
469 |
+
<gmd:dateTime>
|
470 |
+
<gco:DateTime>2017-03-01T00:00:00</gco:DateTime>
|
471 |
+
</gmd:dateTime>
|
472 |
+
<gmd:source>
|
473 |
+
<gmd:LI_Source>
|
474 |
+
<gmd:description>
|
475 |
+
<gco:CharacterString>Geo-spatial Relational Database</gco:CharacterString>
|
476 |
+
</gmd:description>
|
477 |
+
<gmd:sourceCitation>
|
478 |
+
<gmd:CI_Citation>
|
479 |
+
<gmd:title>
|
480 |
+
<gco:CharacterString>Census MAF/TIGER database</gco:CharacterString>
|
481 |
+
</gmd:title>
|
482 |
+
<gmd:alternateTitle>
|
483 |
+
<gco:CharacterString>MAF/TIGER</gco:CharacterString>
|
484 |
+
</gmd:alternateTitle>
|
485 |
+
<gmd:date>
|
486 |
+
<gmd:CI_Date>
|
487 |
+
<gmd:date>
|
488 |
+
<gco:Date>2016-05</gco:Date>
|
489 |
+
</gmd:date>
|
490 |
+
<gmd:dateType>
|
491 |
+
<gmd:CI_DateTypeCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_DateTypeCode"
|
492 |
+
codeListValue="creation">
|
493 |
+
creation
|
494 |
+
</gmd:CI_DateTypeCode>
|
495 |
+
</gmd:dateType>
|
496 |
+
</gmd:CI_Date>
|
497 |
+
</gmd:date>
|
498 |
+
<gmd:citedResponsibleParty>
|
499 |
+
<gmd:CI_ResponsibleParty>
|
500 |
+
<gmd:organisationName>
|
501 |
+
<gco:CharacterString>U.S. Department of Commerce, U.S. Census Bureau, Geography Division, Geographic Customer Services Branch</gco:CharacterString>
|
502 |
+
</gmd:organisationName>
|
503 |
+
<gmd:role>
|
504 |
+
<gmd:CI_RoleCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode"
|
505 |
+
codeListValue="originator">originator
|
506 |
+
</gmd:CI_RoleCode>
|
507 |
+
</gmd:role>
|
508 |
+
</gmd:CI_ResponsibleParty>
|
509 |
+
</gmd:citedResponsibleParty>
|
510 |
+
<gmd:otherCitationDetails>
|
511 |
+
<gco:CharacterString> Source Contribution: All spatial and feature data</gco:CharacterString>
|
512 |
+
</gmd:otherCitationDetails>
|
513 |
+
</gmd:CI_Citation>
|
514 |
+
</gmd:sourceCitation>
|
515 |
+
</gmd:LI_Source>
|
516 |
+
</gmd:source>
|
517 |
+
</gmd:LI_ProcessStep>
|
518 |
+
</gmd:processStep>
|
519 |
+
</gmd:LI_Lineage>
|
520 |
+
</gmd:lineage>
|
521 |
+
</gmd:DQ_DataQuality>
|
522 |
+
</gmd:dataQualityInfo>
|
523 |
+
<gmd:metadataMaintenance>
|
524 |
+
<gmd:MD_MaintenanceInformation>
|
525 |
+
<gmd:maintenanceAndUpdateFrequency>
|
526 |
+
<gmd:MD_MaintenanceFrequencyCode codeList="http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_MaintenanceFrequencyCode"
|
527 |
+
codeListValue="notPlanned"
|
528 |
+
codeSpace="011">
|
529 |
+
notPlanned
|
530 |
+
</gmd:MD_MaintenanceFrequencyCode>
|
531 |
+
</gmd:maintenanceAndUpdateFrequency>
|
532 |
+
<gmd:maintenanceNote>
|
533 |
+
<gco:CharacterString>This was transformed from the Census Metadata Import Format</gco:CharacterString>
|
534 |
+
</gmd:maintenanceNote>
|
535 |
+
<gmd:contact xlink:href="https://www.ngdc.noaa.gov/docucomp/1df27e57-4768-42de-909b-52f530601fba"
|
536 |
+
xlink:title="U.S Department of Commerce, U.S Census Bureau, Geographic Customer Services Branch (point of Contact)"/>
|
537 |
+
</gmd:MD_MaintenanceInformation>
|
538 |
+
</gmd:metadataMaintenance>
|
539 |
+
</gmi:MI_Metadata>
|