Download 110/replication_package/replication/Do-file/Appendix.do from chuxuan/REPRO-Bench: direct link, hf CLI and curl.
- Browser
- Download file 75.7 kB
-
https://huggingface.co/datasets/chuxuan/REPRO-Bench/resolve/main/110/replication_package/replication/Do-file/Appendix.do
- Command line
-
hf download hf://datasets/chuxuan/REPRO-Bench/110/replication_package/replication/Do-file/Appendix.do
-
curl -L -o Appendix.do https://huggingface.co/datasets/chuxuan/REPRO-Bench/resolve/main/110/replication_package/replication/Do-file/Appendix.do
75.7 kB
| * Set Directory | |
| clear | |
| set more off | |
| set scheme s1mono | |
| cd "$path" | |
| global data_files "$path/Data" | |
| global out_files "$path/output" | |
| **============================================================================== | |
| * Table A1 | |
| use "$data_files/Raw/allcity_info", clear | |
| label variable pm25 "AOD" | |
| label variable number "\# Monitors" | |
| label variable area "Size of Built-up Area (km2)" | |
| label variable pop "Urban Population (10,000)" | |
| eststo clear | |
| estpost tabstat pm25 number area pop, by(mainsample) statistics(mean sd) columns(statistics) listwise nototal | |
| esttab using "$out_files/TableA1.tex", replace tex main(mean) aux(sd) nogaps nodepvar compress fragment nostar noobs unstack nonote nomtitle label | |
| **============================================================================== | |
| * Table C1 | |
| use "$data_files/firm_enf.dta", clear | |
| keep if min_dist<50 & starty<=2010 | |
| drop if revenue == . | |
| drop if key == . | |
| label variable any_air "Any Air Pollution Enforcement" | |
| label variable any_air_shutdown "\quad Suspension" | |
| label variable any_air_fine "\quad Fine" | |
| label variable any_air_renovate "\quad Upgrading" | |
| label variable any_air_warning "\quad Warning" | |
| label variable air "\# Air Pollution Enforcement" | |
| label variable any_water "Any Water Pollu. Enforc." | |
| label variable any_waste "Any Solid Waste Pollu. Enforc." | |
| label variable any_proc "Any Procedure Pollu. Enforc." | |
| label variable min_dist_10 "Monitor within 10 km" | |
| label variable min_dist "Distance to Monitor (km)" | |
| label variable starty "Year Started" | |
| label variable employment "Employment" | |
| label variable revenue "Revenue" | |
| label variable up "Upwind Firms" | |
| eststo clear | |
| estpost summarize any_air* air any_water any_waste any_proc up | |
| esttab using "$out_files/TableC1a1.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) tex | |
| display "Periods: " | |
| display "Frequency: " | |
| keep if year==2010 & quarter==1 | |
| gen state = (ownership==1 | ownership==2) | |
| gen private = (ownership==3) | |
| gen foreign = (ownership==9) | |
| gen rest = (ownership==4|ownership==5) | |
| label variable state "Owner: SOEs" | |
| label variable private "Owner: Private" | |
| label variable foreign "Owner: Foreign" | |
| label variable rest "Owner: Other" | |
| eststo clear | |
| estpost summarize min_dist_10 min_dist starty state private foreign rest employment revenue | |
| esttab using "$out_files/TableC1a2.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) tex | |
| display "Periods: " | |
| display "Frequency: " | |
| use "$data_files/city_pm.dta", clear | |
| drop if pm25 == . | |
| label variable number "\# Monitors" | |
| label variable area "Size of Built-up Area (km2)" | |
| label variable pop "Urban Population (10,000)" | |
| label variable age_year "Age of the Mayor" | |
| label variable pre "Precipitation (mm)" | |
| label variable tem_mean "Mean Temperature" | |
| label variable pm25 "Aerosol Optical Depth" | |
| eststo clear | |
| estpost summarize number area pop age_year pre tem_mean pm25 | |
| esttab using "$out_files/TableC1b1.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) tex | |
| display "Periods: " | |
| display "Frequency: " | |
| use "$data_files/city_pm.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| merge 1:1 city_cn year month using "$data_files/Raw/baidu.dta" | |
| keep if _merge == 3 | |
| drop _merge | |
| label variable sear_freq_w1 "Search Index: air pollution" | |
| label variable sear_freq_w2 "Search Index: haze/smoke" | |
| label variable sear_freq_w3 "Search Index: PM25" | |
| label variable sear_freq_w4 "Search Index: air mask" | |
| label variable sear_freq_w5 "Search Index: air purifier" | |
| eststo clear | |
| estpost summarize sear* | |
| esttab using "$out_files/TableC1b3.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) tex | |
| display "Periods: " | |
| display "Frequency: " | |
| use "$data_files/city_enf.dta", clear | |
| gen any_air_total = any_air+any_air_rest | |
| label variable any_air_total "\# Firms Any Air Pollu. Enfor. (incl non-ASIF)" | |
| label variable any_air "\# Firms Any Air Pollu. Enfor." | |
| eststo clear | |
| estpost summarize any_air any_air_total | |
| esttab using "$out_files/TableC1b2.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) tex | |
| display "Periods: " | |
| display "Frequency: " | |
| use "$data_files/monitor_api.dta", clear | |
| label variable pm25api "Particulate Matter 2.5 (PM$\_2.5$)" | |
| label variable pm10api "Particulate Matter 10 (PM$\_10$))" | |
| label variable AQI "Air Quality Index (AQI) " | |
| eststo clear | |
| estpost summarize pm25api pm10api AQI | |
| esttab using "$out_files/TableC1c.tex", replace cells("mean(fmt(a2)) sd(fmt(a2)) count") noobs nolines nogaps nodepvar compress fragment nonumbers label mlabels(none) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C4 | |
| use "$data_files/monitor_api.dta", clear | |
| gen log_pm25api = log(pm25api) | |
| gen log_pm10api = log(pm10api) | |
| gen log_aqi = log(AQI) | |
| replace log_aqi = . if log_pm25api == . | |
| rename pm25 AOD | |
| label variable AOD "AOD" | |
| eststo clear | |
| reghdfe log_pm25api AOD pre tem_mean, a(monitor_id year#month) cl(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| reghdfe log_pm10api AOD pre tem_mean, a(monitor_id year#month) cl(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| reghdfe log_aqi AOD pre tem_mean, a(monitor_id year#month) cl(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| esttab A B C using "$out_files/TableC4.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() keep(AOD) drop() stats(ymean N, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C5 | |
| use "$data_files/firm_enf.dta", clear | |
| drop if revenue == . | |
| drop if key == . | |
| keep if min_dist<50 & starty<=2010 & time==1 | |
| gen twodigit = int(industry/100) | |
| lab def twodigit_lb 6 "Mining and Washing of Coal & 6" /// | |
| 7 "Extraction of Petroleum and Natural Gas & 7" /// | |
| 8 "Mining and Processing of Ferrous Metal Ores & 8" /// | |
| 9 "Mining and Processing of Non-Ferrous Metal Ores & 9" /// | |
| 10 "Mining and Processing of Nonmetallic Mineral & 10" /// | |
| 11 "Mining Support & 11" /// | |
| 12 "Other Mining & 12" /// | |
| 13 "Agricultural and Sideline Food Processing & 13" /// | |
| 14 "Fermentation & 14" /// | |
| 15 "Beverage Manufacturing & 15" /// | |
| 16 "Tobacco Manufacturing & 16" /// | |
| 17 "Textile Mills & 17" /// | |
| 18 "Wearing Apparel and Clothing Accessories Manufacturing & 18" /// | |
| 19 "Leather, Fur and Related Products Manufacturing & 19" /// | |
| 20 "Wood and Bamboo Products Manufacturing & 20" /// | |
| 21 "Furniture Manufacturing & 21" /// | |
| 22 "Products Manufacturing & 22" /// | |
| 23 "Printing and Reproduction of Recorded Media & 23" /// | |
| 24 "Education and Entertainment Articles Manufacturing & 24" /// | |
| 25 "Petrochemicals Manufacturing & 25" /// | |
| 26 "Chemical Products Manufacturing& 26" /// | |
| 27 "Medicine Manufacturing & 27" /// | |
| 28 "Chemical Fibers Manufacturing & 28" /// | |
| 29 "Rubber Products Manufacturing & 29" /// | |
| 30 "Plastic Products Manufacturing & 30" /// | |
| 31 "Non-Metallic Mineral Products Manufacturing & 31" /// | |
| 32 "Iron and Steel Smelting & 32" /// | |
| 33 "Non-Ferrous Metal Smelting & 33" /// | |
| 34 "Fabricated Metal Products Manufacturing & 34" /// | |
| 35 "General Purpose Machinery Manufacturing & 35" /// | |
| 36 "Special Purpose Machinery Manufacturing & 36" /// | |
| 37 "Transport Equipment Manufacturing & 37" /// | |
| 38 "Electrical machinery and equipment Manufacturing & 38" /// | |
| 39 "Electrical Equipment Manufacturing & 39" /// | |
| 40 "Computers and Electronic Products Manufacturing & 40" /// | |
| 41 "General Instruments and Other Equipment Manufacturing & 41" /// | |
| 42 "Craft-works Manufacturing & 42" /// | |
| 43 "Renewable Materials Recovery & 43" /// | |
| 44 "Electricity and Heat Supply & 44" /// | |
| 45 "Gas Production and Supply & 45" /// | |
| 46 "Water Production and Supply & 46", add | |
| label values twodigit twodigit_lb | |
| eststo clear | |
| estpost tabulate twodigit | |
| esttab using "$out_files/TableC5.tex", replace tex cells("b(label(freq)) pct(fmt(2))") varlabels(`e(labels)', blist(Total)) nolines nogaps compress fragment label | |
| **============================================================================== | |
| * Table C6 | |
| use "$data_files/Raw/daily_monitor_api.dta", clear | |
| * Construct daily indicators | |
| gen above_100=0 & AQI!=. | |
| replace above_100=1 if AQI>=100 & AQI!=. | |
| gen above_200=0 & AQImax!=. | |
| replace above_200=1 if AQImax>=200 & AQImax!=. | |
| * Collapse data to monthly level | |
| collapse (mean) above_200 pm25api pm10api AQI, by(year month city_id) | |
| * Merge with weather data | |
| merge 1:1 city_id year month using "$data_files/weather_monthly.dta" | |
| keep if _merge == 3 | |
| drop _merge | |
| gen quarter = int((month-1)/3)+1 | |
| collapse (mean) above_200 pm25api pm10api AQI pre tem_mean, by(year quarter city_id) | |
| * Construct monthly variables | |
| egen time=group(year quarter) | |
| replace pre=. if pre==-9999 | |
| bysort city_id: egen med_pre=median(pre) | |
| gen high_pre=0 if pre!=. | |
| replace high_pre=1 if pre>med_pre & pre!=. | |
| label var high_pre "\$Rain_{>\tilde{x}}$" | |
| gen log_pre=log(pre) | |
| gen log_api25=log(pm25api) | |
| gen log_aqi=log(AQI) | |
| gen log_api10=log(pm10api) | |
| gen tem_meand = int(tem_mean) | |
| * Monthly pollution regressions | |
| reghdfe log_api25 high_pre, absorb(time city_id tem_meand) cluster(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe log_api10 high_pre, absorb(time city_id tem_meand) cluster(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe log_aqi high_pre, absorb(time city_id tem_meand) cluster(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe above_200 high_pre if AQI!=., absorb(time city_id tem_meand) cluster(city_id) | |
| eststo D | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| esttab A B C D using "$out_files/TableC6.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() drop(_cons) stats(ymean EN, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C7 | |
| use "$data_files/firm_enf.dta", clear | |
| drop if revenue == . | |
| drop if key == . | |
| label var min_dist_10 "Mon\$\_{<10km}\$" | |
| label var any_air "Any Enforcement (0/1)" | |
| label var post "Post" | |
| label var key "High Pollution" | |
| * Table | |
| eststo clear | |
| reghdfe any_air c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| reghdfe any_water c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| reghdfe any_waste c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| reghdfe any_proc c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) | |
| eststo D | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| esttab A B C D using "$out_files/TableC7a.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() keep(c.min_dist_10*) stats(ymean EN FirmFE ITFE PTFE, labels("Mean Outcome" "Observations" "Firm FE" "Industry-Time FE" "Province-Time FE")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| merge m:1 city_id using "$data_files/Raw/city_info.dta", keepusing(disttocoast) | |
| keep if _merge == 3 | |
| drop _merge | |
| eststo clear | |
| reghdfe any_air c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| estadd local DTFE = "No" | |
| estadd local FCTFE = "No" | |
| estadd local CTFE = "No" | |
| reghdfe any_air c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time c.disttocoast#time) cluster(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| estadd local DTFE = "Yes" | |
| estadd local FCTFE = "No" | |
| estadd local CTFE = "No" | |
| reghdfe any_air c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time c.disttocoast#time c.employment#time) cluster(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "Yes" | |
| estadd local DTFE = "Yes" | |
| estadd local FCTFE = "Yes" | |
| estadd local CTFE = "No" | |
| reghdfe any_air c.min_dist_10#c.post1 if min_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time city_id#time) cluster(city_id) | |
| eststo D | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| estadd local FirmFE = "Yes" | |
| estadd local ITFE = "Yes" | |
| estadd local PTFE = "No" | |
| estadd local DTFE = "No" | |
| estadd local FCTFE = "Yes" | |
| estadd local CTFE = "Yes" | |
| esttab A B C D using "$out_files/TableC7b.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() keep(c.min_dist_10*) stats(ymean EN DTFE FCTFE CTFE FirmFE ITFE PTFE, labels("Mean Outcome" "Observations" "Distance to coast-Time FE" "Firm characteristics-Time FE" "City-Time FE" "Firm FE" "Industry-Time FE" "Province-Time FE" )) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C8 | |
| use "$data_files/Raw/city_info.dta", clear | |
| merge 1:1 city_id using "$data_files/share.dta" | |
| drop if _merge == 2 | |
| drop _merge | |
| label variable number "\# Monitors" | |
| label variable number_iv "Min \# Monitors" | |
| regress share_rev_10 number, r | |
| eststo A | |
| estadd ysumm, mean | |
| regress share_emp_10 number, r | |
| eststo B | |
| estadd ysumm, mean | |
| regress share_rev_5 number, r | |
| eststo C | |
| estadd ysumm, mean | |
| regress share_emp_5 number, r | |
| eststo D | |
| estadd ysumm, mean | |
| esttab A B C D using "$out_files/TableC8a.tex", replace b(a2) noconstant se(a2) label nolines nogaps compress fragment nonumbers mlabels(none) collabels() drop(_cons) stats(ymean N, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| ivregress 2sls share_rev_10 (number = number_iv), r | |
| eststo A | |
| estadd ysumm, mean | |
| ivregress 2sls share_emp_10 (number = number_iv), r | |
| eststo B | |
| estadd ysumm, mean | |
| ivregress 2sls share_rev_5 (number = number_iv), r | |
| eststo C | |
| estadd ysumm, mean | |
| ivregress 2sls share_emp_5 (number = number_iv), r | |
| eststo D | |
| estadd ysumm, mean | |
| esttab A B C D using "$out_files/TableC8b.tex", replace b(a2) noconstant se(a2) label nolines nogaps compress fragment nonumbers mlabels(none) collabels() drop(_cons) stats(ymean N, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C9 | |
| * Robustness: additional controls | |
| use "$data_files/city_pm.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe pm25 c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| reghdfe pm25 RD_Estimate i.time#c.area i.time#c.pop, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo C | |
| ivreghdfe pm25 i.time#c.area i.time#c.pop i.time#c.background (RD_Estimate=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo D | |
| reghdfe pm25 RD_Estimate i.time#c.area i.time#c.pop i.time#c.background i.time#c.GDP, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo E | |
| ivreghdfe pm25 i.time#c.area i.time#c.pop i.time#c.background i.time#c.GDP (RD_Estimate=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo F | |
| esttab A B C D E F using "$out_files/TableC9a.tex", tex keep(RD_Estimate) transform(@/1, pattern(0 0 0 0)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN, labels( "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| use "$data_files/city_enf.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "Yes" | |
| estadd local CSTFE = "No" | |
| estadd local CCTFE = "No" | |
| estadd local Weather = "Yes" | |
| eststo A | |
| ivreghdfe log_any_air c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "Yes" | |
| estadd local CSTFE = "No" | |
| estadd local CCTFE = "No" | |
| estadd local Weather = "Yes" | |
| eststo B | |
| reghdfe log_any_air RD_Estimate i.time#c.area i.time#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "No" | |
| estadd local CSTFE = "Yes" | |
| estadd local CCTFE = "No" | |
| estadd local Weather = "Yes" | |
| eststo C | |
| ivreghdfe log_any_air i.time#c.area i.time#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "No" | |
| estadd local CSTFE = "Yes" | |
| estadd local CCTFE = "No" | |
| estadd local Weather = "Yes" | |
| eststo D | |
| reghdfe log_any_air RD_Estimate i.time#c.area i.time#c.pop i.time#c.background i.time#c.GDP, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "No" | |
| estadd local CSTFE = "Yes" | |
| estadd local CCTFE = "Yes" | |
| estadd local Weather = "Yes" | |
| eststo E | |
| ivreghdfe log_any_air i.time#c.area i.time#c.pop i.time#c.background i.time#c.GDP (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd local CFE = "Yes" | |
| estadd local TTFE = "Yes" | |
| estadd local CSPost = "No" | |
| estadd local CSTFE = "Yes" | |
| estadd local CCTFE = "Yes" | |
| estadd local Weather = "Yes" | |
| eststo F | |
| esttab A B C D E F using "$out_files/TableC9b.tex", tex keep(RD_Estimate) transform(@/1, pattern(0 0 0 0)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN CFE TTFE CSPost CSTFE CCTFE Weather, labels("Observations" "City FE" "Target-Time FE" "City size $\times$ Post" "City size-Time FE" "City char.-Time FE" "Weather")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| * Table C10 | |
| * Robustness: Sample Restriction | |
| use "$data_files/city_pm.dta", clear | |
| gen prov_id = int(city_id/100) | |
| drop if prov_id == 54 | prov_id == 65 | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe pm25 c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_pm_rd.dta", clear | |
| gen prov_id = int(city_id/100) | |
| drop if prov_id == 54 | prov_id == 65 | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = pm25 if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe pm25 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC10a.tex", tex keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN, labels( "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| use "$data_files/city_enf.dta", clear | |
| gen prov_id = int(city_id/100) | |
| drop if prov_id == 54 | prov_id == 65 | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen prov_id = int(city_id/100) | |
| drop if prov_id == 54 | prov_id == 65 | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = log_any_air if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| estadd local kern = "Uniform" | |
| eststo C | |
| reghdfe log_any_air RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| estadd local kern = "Uniform" | |
| eststo D | |
| esttab A B C D using "$out_files/TableC10b.tex", tex keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN kern band, labels("Observations" "Kernel" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| * Table C11 | |
| * asif vs all | |
| use "$data_files/city_enf.dta", clear | |
| gen log_any_air_total = log(any_air+any_air_rest+1) | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| reghdfe log_any_air_total RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air_total c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen log_any_air_total = log(any_air+any_air_rest+1) | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = log_any_air_total if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air_total dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air_total RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC11a.tex", tex keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN, labels("Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| use "$data_files/city_enf.dta", clear | |
| gen log_any_air_rest = log(any_air_rest+1) | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| reghdfe log_any_air_rest RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air_rest c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen log_any_air_rest = log(any_air_rest+1) | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = log_any_air_rest if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air_rest dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air_rest RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC11b.tex", tex keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN, labels("Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| * Table C12 | |
| * kernel and covs | |
| use "$data_files/city_pm_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = pm25 if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| eststo clear | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo A | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) covs(cutoff mean_bench year month) kernel(tri) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo B | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) covs(cutoff mean_bench year month) kernel(epa) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) covs() kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC12a1.tex", tex keep(RD_Estimate) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN band, labels("Observations" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| eststo clear | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) covs(cutoff) kernel(uni) vce(cluster city_id) | |
| eststo A | |
| rdrobust number dist1 if year>=2015, p(1) h(12.3) covs(cutoff) kernel(tri) vce(cluster city_id) | |
| eststo B | |
| rdrobust number dist1 if year>=2015, p(1) h(12.5) covs(cutoff) kernel(epa) vce(cluster city_id) | |
| eststo C | |
| rdrobust number dist1 if year>=2015, p(1) h(13.8) covs() kernel(uni) vce(cluster city_id) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC12a2.tex", tex replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers noobs mlabels(none) keep(RD_Estimate) coeflabels(RD_Estimate "First stage") starlevels(* 0.10 ** 0.05 *** 0.01) | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen dist2 = pop - 25 if cutoff == 1 | |
| replace dist2 = pop - 50 if cutoff == 2 | |
| gen bench = log_any_air if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| eststo clear | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo A | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) covs(cutoff mean_bench year quarter) kernel(tri) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo B | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) covs(cutoff mean_bench year quarter) kernel(epa) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) covs() kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC12b1.tex", tex keep(RD_Estimate) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN band, labels("Observations" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| eststo clear | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) covs(cutoff) kernel(uni) vce(cluster city_id) | |
| eststo A | |
| estadd local kern = "Uniform" | |
| estadd local cov = "Yes" | |
| rdrobust number dist1 if year>=2015, p(1) h(13.1) covs(cutoff) kernel(tri) vce(cluster city_id) | |
| eststo B | |
| estadd local kern = "Epanechnikov" | |
| estadd local cov = "Yes" | |
| rdrobust number dist1 if year>=2015, p(1) h(12.5) covs(cutoff) kernel(epa) vce(cluster city_id) | |
| eststo C | |
| estadd local kern = "Triangle" | |
| estadd local cov = "Yes" | |
| rdrobust number dist1 if year>=2015, p(1) h(11.4) covs() kernel(uni) vce(cluster city_id) | |
| eststo D | |
| estadd local kern = "Uniform" | |
| estadd local cov = "No" | |
| esttab A B C D using "$out_files/TableC12b2.tex", tex replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers noobs mlabels(none) keep(RD_Estimate) coeflabels(RD_Estimate "First stage") stats(kern cov, labels("Kernel" "Covariates")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| * Table C13 | |
| * Cutoff 1 | |
| use "$data_files/city_pm.dta", clear | |
| gen dist1 = area - 20 | |
| gen bench = pm25 if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| eststo clear | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo A | |
| reghdfe pm25 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 if abs(dist1) < 11.3, a(year#month) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo B | |
| use "$data_files/city_enf.dta", clear | |
| gen dist1 = area - 20 | |
| gen bench = log_any_air if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC13a1.tex", tex keep(RD_Estimate) transform(@/0.79 1/0.79, pattern(0 1 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN band, labels("Observations" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| eststo clear | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo A | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo B | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo C | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) covs() kernel(uni) vce(cluster city_id) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC13a2.tex", tex replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers noobs mlabels(none) keep(RD_Estimate) coeflabels(RD_Estimate "First stage") starlevels(* 0.10 ** 0.05 *** 0.01) | |
| * Cutoff 2 | |
| use "$data_files/city_pm.dta", clear | |
| gen dist1 = area - 50 | |
| gen bench = pm25 if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| eststo clear | |
| rdrobust pm25 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(mean_bench year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo A | |
| reghdfe pm25 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo B | |
| use "$data_files/city_enf.dta", clear | |
| gen dist1 = area - 50 | |
| gen bench = log_any_air if year < 2012 | |
| bys city_id: egen mean_bench = mean(bench) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(mean_bench year quarter) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N_full) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC13b1.tex", tex keep(RD_Estimate) transform(@/1.76 1/1.76, pattern(0 1 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN band, labels("Observations" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| eststo clear | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo A | |
| estadd local kern = "Uniform" | |
| estadd scalar band = 11.3 | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo B | |
| estadd local kern = "Uniform" | |
| estadd scalar band = 11.3 | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) kernel(uni) vce(cluster city_id) | |
| eststo C | |
| estadd local kern = "Uniform" | |
| estadd scalar band = 11.3 | |
| rdrobust number dist1 if year>=2015, p(1) h(11.3) covs() kernel(uni) vce(cluster city_id) | |
| eststo D | |
| estadd local kern = "Uniform" | |
| estadd local band = 11.3 | |
| esttab A B C D using "$out_files/TableC13b2.tex", tex replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers noobs mlabels(none) keep(RD_Estimate) coeflabels(RD_Estimate "First stage") stats(kern band, labels("Kernel" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| * Table C14 | |
| * Spillover in aod | |
| use "$data_files/city_pm_rd.dta", clear | |
| rename pm pm_monitor | |
| drop if pm_monitor == . | |
| drop if pm_direct == . | |
| drop if pm_indirect == . | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench_monitor = pm_monitor if year < 2012 | |
| bys city_id cutoff: egen mean_bench_monitor = mean(bench_monitor) | |
| gen RD_Estimate = . | |
| gen above = dist1 > 0 | |
| replace RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe pm_monitor RD_Estimate c.post1#c.area c.post1#c.pop if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| summ pm_monitor | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| ivreghdfe pm_monitor c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv) if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| summ pm_monitor | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| rdrobust pm_monitor dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_monitor year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| summ pm_monitor if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| eststo C | |
| replace RD_Estimate = c.post1#c.above | |
| reghdfe pm_monitor RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N) | |
| summ pm_monitor if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14a.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm, labels("Observations" "Mean Outcome")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| use "$data_files/city_pm_rd.dta", clear | |
| rename pm pm_monitor | |
| drop if pm_monitor == . | |
| drop if pm_direct == . | |
| drop if pm_indirect == . | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench_dir = pm_direct if year < 2012 | |
| bys city_id cutoff: egen mean_bench_dir = mean(bench_dir) | |
| gen bench_in = pm_indirect if year < 2012 | |
| bys city_id cutoff: egen mean_bench_in = mean(bench_in) | |
| gen RD_Estimate = . | |
| gen above = dist1 > 0 | |
| replace RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe pm_direct RD_Estimate c.post1#c.area c.post1#c.pop if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| summ pm_direct | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| ivreghdfe pm_direct c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv) if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| summ pm_direct | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| rdrobust pm_direct dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_dir year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| summ pm_direct if abs(dist1) < 11.3 | |
| estadd scalar ysumm = r(mean) | |
| eststo C | |
| replace RD_Estimate = c.post1#c.above | |
| reghdfe pm_direct RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| estadd scalar EN = e(N) | |
| summ pm_direct if abs(dist1) < 11.3 | |
| estadd scalar ysumm = r(mean) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14b.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm, labels("Observations" "Mean Outcome")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| replace RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe pm_indirect RD_Estimate c.post1#c.area c.post1#c.pop if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| summ pm_indirect | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| ivreghdfe pm_indirect c.post1#c.area c.post1#c.pop pre tem_mean (RD_Estimate=c.post1#c.number_iv) if cutoff == 1, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| summ pm_indirect | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| rdrobust pm_indirect dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_in year month) kernel(uni) vce(cluster city_id) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| summ pm_indirect if abs(dist1) < 11.3 | |
| estadd scalar ysumm = r(mean) | |
| eststo C | |
| replace RD_Estimate = c.post1#c.above | |
| reghdfe pm_indirect RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| summ pm_indirect if abs(dist1) < 11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N) | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14c.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm, labels("Observations" "Mean Outcome")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| * Spillover in enf | |
| use "$data_files/city_enf.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe log_any_air_10 RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_10 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air_10 c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_10 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench_10 = log_any_air_10 if year < 2012 | |
| bys city_id cutoff: egen mean_bench_10 = mean(bench_10) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air_10 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_10 year quarter) kernel(uni) vce(cluster city_id) | |
| summ log_any_air_10 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air_10 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| summ log_any_air_10 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14d.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm, labels("Observations" "Mean Outcome")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| use "$data_files/city_enf.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe log_any_air_20 RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_20 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air_20 c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_20 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench_20 = log_any_air_20 if year < 2012 | |
| bys city_id cutoff: egen mean_bench_20 = mean(bench_20) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air_20 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_20 year quarter) kernel(uni) vce(cluster city_id) | |
| summ log_any_air_20 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd scalar band = e(h_l) | |
| eststo C | |
| reghdfe log_any_air_20 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| summ log_any_air_20 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N) | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14e.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm, labels("Observations" "Mean Outcome")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| use "$data_files/city_enf.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen RD_Estimate = c.post1#c.number | |
| eststo clear | |
| reghdfe log_any_air_50 RD_Estimate c.post1#c.area c.post1#c.pop, a(city_id pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_50 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo A | |
| ivreghdfe log_any_air_50 c.post1#c.area c.post1#c.pop (RD_Estimate=c.post1#c.number_iv), a(city_id pred tem_meand age_year incentive2#time) cluster(city_id) | |
| summ log_any_air_50 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_full) | |
| eststo B | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench_50 = log_any_air_50 if year < 2012 | |
| bys city_id cutoff: egen mean_bench_50 = mean(bench_50) | |
| gen above = dist1 > 0 | |
| gen RD_Estimate = c.post1#c.above | |
| rdrobust log_any_air_50 dist1 if year>=2015, fuzzy(number) p(1) h(11.3) covs(cutoff mean_bench_50 year quarter) kernel(uni) vce(cluster city_id) | |
| summ log_any_air_50 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N_h_l) + e(N_h_r) | |
| estadd local kern = "Uniform" | |
| estadd scalar band = 11.3 | |
| eststo C | |
| reghdfe log_any_air_50 RD_Estimate post1 above dist1 c.post1#c.dist1 c.above#c.dist1 c.post1#c.above#c.dist1 cutoff if abs(dist1) < 11.3, a(time) cl(city_id) | |
| summ log_any_air_50 if abs(dist1)<11.3 | |
| estadd scalar ysumm = r(mean) | |
| estadd scalar EN = e(N) | |
| estadd local kern = "Uniform" | |
| estadd scalar band = 11.3 | |
| eststo D | |
| esttab A B C D using "$out_files/TableC14f.tex", keep(RD_Estimate) transform(@/1.21 1/1.21, pattern(0 0 0 1)) replace b(a2) se(a2) label noconstant nolines nogaps compress fragment nonumbers mlabels(none) coeflabels(RD_Estimate "\# Monitors") stats(EN ysumm kern band, labels("Observations" "Mean Outcome" "Kernel" "Bandwidth")) starlevels(* 0.10 ** 0.05 *** 0.01) tex | |
| **============================================================================== | |
| * Table C15 | |
| * Promotion | |
| use "$data_files/city_pm.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen above57 = age<=57 | |
| gen RD_Estimate = c.post1#c.number | |
| label variable above57 "Below 58" | |
| eststo clear | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 51 & age <= 62, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 53 & age <= 62, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe pm25 RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 55 & age <= 60, a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo D | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| esttab A B C D using "$out_files/TableC15a.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() keep(RD_Estimate c.RD_Estimate#c.above57) coeflabels(RD_Estimate "\# Monitors" c.RD_Estimate#c.above57 "\# Monitors $\times$ Below 58") stats(ymean EN, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| use "$data_files/city_enf.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| gen above57 = age <= 57 | |
| gen RD_Estimate = c.post1#c.number | |
| label variable above57 "Below 58" | |
| eststo clear | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 51 & age <= 62, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 53 & age <= 62, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo C | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| reghdfe log_any_air RD_Estimate c.post1#c.area c.post1#c.pop c.RD_Estimate#c.above57 if age >= 55 & age <= 60, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo D | |
| estadd ysumm, mean | |
| estadd scalar EN = e(N_full) | |
| esttab A B C D using "$out_files/TableC15b.tex", replace b(a2) noconstant se(a2) nolines nogaps compress fragment nonumbers label mlabels(none) collabels() keep(RD_Estimate c.RD_Estimate#c.above57) coeflabels(RD_Estimate "\# Monitors" c.RD_Estimate#c.above57 "\# Monitors $\times$ Below 58") stats(ymean EN, labels("Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) substitute(\_ _) tex | |
| **============================================================================== | |
| * Table C16 | |
| * Balance | |
| use "$data_files/city_pm.dta", clear | |
| keep if year < 2015 | |
| replace light = log(light) | |
| gen log_any_air = log(any_air+1) | |
| collapse (mean) pm25 light log_any_air number area pop age city_id, by(city_cn) | |
| gen above57 = age > 57 | |
| label variable number "\# Monitors" | |
| label variable area "Size of buildup area" | |
| label variable pop "Urban population" | |
| label variable pm25 "AOD before 2015" | |
| label variable light "Night light before 2015" | |
| label variable log_any_air "log(\# Firms) before 2015" | |
| regress above57 number area pop pm25 light log_any_air | |
| test number area pop pm25 light log_any_air | |
| regress above57 number area pop pm25 light log_any_air if age >= 51 & age <= 62 | |
| test number area pop pm25 light log_any_air | |
| regress above57 number area pop pm25 light log_any_air if age >= 53 & age <= 62 | |
| test number area pop pm25 light log_any_air | |
| regress above57 number area pop pm25 light log_any_air if age >= 55 & age <= 60 | |
| test number area pop pm25 light log_any_air | |
| eststo clear | |
| eststo tot: estpost summarize number area pop pm25 light log_any_air | |
| eststo treat1: estpost summarize number area pop pm25 light log_any_air if above57==1 | |
| eststo control1: estpost summarize number area pop pm25 light log_any_air if above57==0 | |
| eststo diff1: estpost ttest number area pop pm25 light log_any_air, by(above57) | |
| eststo diff1: estadd scalar pvalue = 0.19 | |
| eststo diff2: estpost ttest number area pop pm25 light log_any_air if age >= 51 & age <= 62, by(above57) | |
| eststo diff2: estadd scalar pvalue = 0.15 | |
| eststo diff3: estpost ttest number area pop pm25 light log_any_air if age >= 53 & age <= 62, by(above57) | |
| eststo diff3: estadd scalar pvalue = 0.29 | |
| eststo diff4: estpost ttest number area pop pm25 light log_any_air if age >= 55 & age <= 60, by(above57) | |
| eststo diff4: estadd scalar pvalue = 0.37 | |
| esttab tot treat1 control1 diff1 diff2 diff3 diff4 using "$out_files/TableC16.tex", tex label noconstant nolines nogaps compress fragment nonumbers mlabels(,none) collabels(,none) cells(mean(pattern(1 1 1 0 0 0 0) fmt(a2)) & b(star pattern(0 0 0 1 1 1 1) fmt(a2)) sd(pattern(1 1 1 0 0 0 0) fmt(a2) par) & se(pattern(0 0 0 1 1 1 1) fmt(a2) par)) stats(N pvalue, labels("Observations" "Joint Test (p-value)")) starlevels(* 0.10 ** 0.05 *** 0.01) replace | |
| **============================================================================== | |
| * Table C17 | |
| use "$data_files/city_pm.dta", clear | |
| label variable post1 "Post" | |
| label variable number "\# Mon" | |
| label variable number_iv "Min \# Mon" | |
| merge 1:1 city_cn year month using "$data_files/Raw/baidu.dta" | |
| keep if _merge == 3 | |
| drop _merge | |
| replace sear_freq_w1 = sear_freq_w1/pop | |
| replace sear_freq_w2 = sear_freq_w2/pop | |
| replace sear_freq_w3 = sear_freq_w3/pop | |
| replace sear_freq_w4 = sear_freq_w4/pop | |
| replace sear_freq_w5 = sear_freq_w5/pop | |
| foreach x of varlist sear_freq_w* { | |
| egen m_`x' = mean(`x') | |
| egen sd_`x' = sd(`x') | |
| gen std_`x' = (`x'- m_`x')/sd_`x' | |
| } | |
| forvalues i=1/5 { | |
| replace sear_freq_w`i'=0 if sear_freq_w`i'==. | |
| gen log_w`i'=log(sear_freq_w`i'+1) | |
| gen any_w`i'=0 | |
| replace any_w`i'=1 if sear_freq_w`i'>0 & sear_freq_w`i'!=. | |
| } | |
| eststo clear | |
| ivreghdfe log_w1 i.time#c.area i.time#c.pop (c.post1#c.number=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo A | |
| summ log_w1 | |
| estadd scalar ymean = r(mean) | |
| ivreghdfe log_w2 i.time#c.area i.time#c.pop (c.post1#c.number=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo B | |
| summ log_w2 | |
| estadd scalar ymean = r(mean) | |
| ivreghdfe log_w3 i.time#c.area i.time#c.pop (c.post1#c.number=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo C | |
| summ log_w3 | |
| estadd scalar ymean = r(mean) | |
| ivreghdfe log_w4 i.time#c.area i.time#c.pop (c.post1#c.number=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo D | |
| summ log_w4 | |
| estadd scalar ymean = r(mean) | |
| ivreghdfe log_w5 i.time#c.area i.time#c.pop (c.post1#c.number=c.post1#c.number_iv), a(city_id year#month pred tem_meand age_year incentive2#time) cluster(city_id) | |
| eststo E | |
| summ log_w5 | |
| estadd scalar ymean = r(mean) | |
| estfe A B C D E, labels(city_id "City FE" time "Time FE") | |
| return list | |
| esttab A B C D E using "$out_files/TableC17.tex", replace b(a2) se(a2) keep(c.post1#c.number) coeflabels(c.post1#c.number "\# Monitors") label noconstant nolines nogaps compress fragment nonumbers mlabels(none) collabels() stats(ymean N, labels( "Mean Outcome" "Observations")) starlevels(* 0.10 ** 0.05 *** 0.01) | |
| **============================================================================== | |
| ** Figures | |
| **============================================================================== | |
| * Figure D3 | |
| use "$data_files/firm_enf.dta", clear | |
| fvset base 4 min_d_d4 | |
| reghdfe any_air i.post##i.min_d_d4 if min_dist<50 & starty<=2010, absorb(id time industry#time prov_id#time) cluster(city_id) poolsize(1) compact | |
| coefplot, baselevels omitted vert yline(0, lc(cranberry)) keep(1.post1#*) coeflabels(1.post1#0.min_d_d4 = "0-5km" 1.post1#1.min_d_d4 = "5-10km" 1.post1#2.min_d_d4 = "10-15km" 1.post1#3.min_d_d4 = "15-20km" 1.post1#4.min_d_d4 = "20-50km") drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle() le(95) | |
| graph export "$out_files/any_air_gradient_50_ci.pdf", replace | |
| **============================================================================== | |
| * Figure D5 | |
| use "$data_files/firm_enf.dta", clear | |
| merge m:1 city_id using "$data_files/Raw/city_info.dta", keepusing(env_lat env_lon centroid_lat centroid_lon) | |
| keep if _merge == 3 | |
| drop _merge | |
| geodist env_lat env_lon lat lon, gen(env_dist) | |
| gen min_env_d4 = int(env_dist/5) | |
| replace min_env_d4 = 4 if min_env_d4 > 4 | |
| * set base level | |
| fvset base 20 time | |
| fvset base 4 min_env_d4 | |
| geodist centroid_lat centroid_lon lat lon, gen(cen_dist) | |
| gen min_cen_d4 = int(cen_dist/5) | |
| replace min_cen_d4 = 4 if min_cen_d4 > 4 | |
| * set base level | |
| fvset base 20 time | |
| fvset base 4 min_cen_d4 | |
| reghdfe any_air i.time##i.min_env_d4 i.post##i.min_d_d4 i.post##i.min_cen_d4 if env_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) poolsize(1) compact | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#0.min_env_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_5_) replace | |
| twoway (rarea enf_5_ul1 enf_5_ll1 enf_5_at, color(gs6%20)) (scatter enf_5_b enf_5_at, msymbol(p) mc(black%60)) (line enf_5_b enf_5_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_env_event_5.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#1.min_env_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_10_) replace | |
| twoway (rarea enf_10_ul1 enf_10_ll1 enf_10_at, color(gs6%20)) (scatter enf_10_b enf_10_at, msymbol(p) mc(black%60)) (line enf_10_b enf_10_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_env_event_10.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#2.min_env_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_15_) replace | |
| twoway (rarea enf_15_ul1 enf_15_ll1 enf_15_at, color(gs6%20)) (scatter enf_15_b enf_10_at, msymbol(p) mc(black%60)) (line enf_15_b enf_15_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_env_event_15.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#3.min_env_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_20_) replace | |
| twoway (rarea enf_20_ul1 enf_20_ll1 enf_20_at, color(gs6%20)) (scatter enf_20_b enf_20_at, msymbol(p) mc(black%60)) (line enf_20_b enf_20_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_env_event_20.pdf", replace | |
| reghdfe any_air i.time##i.min_cen_d4 i.post##i.min_d_d4 i.post##i.min_env_d4 if cen_dist<50 & starty<=2010, absorb(time id industry#time prov_id#time) cluster(city_id) poolsize(1) compact | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#0.min_cen_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_5_) replace | |
| twoway (rarea enf_5_ul1 enf_5_ll1 enf_5_at, color(gs6%20)) (scatter enf_5_b enf_5_at, msymbol(p) mc(black%60)) (line enf_5_b enf_5_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_cen_event_5.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#1.min_cen_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_10_) replace | |
| twoway (rarea enf_10_ul1 enf_10_ll1 enf_10_at, color(gs6%20)) (scatter enf_10_b enf_10_at, msymbol(p) mc(black%60)) (line enf_10_b enf_10_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_cen_event_10.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#2.min_cen_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_15_) replace | |
| twoway (rarea enf_15_ul1 enf_15_ll1 enf_15_at, color(gs6%20)) (scatter enf_15_b enf_10_at, msymbol(p) mc(black%60)) (line enf_15_b enf_15_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_cen_event_15.pdf", replace | |
| qui coefplot, baselevels omitted vert yline(0, lc(black)) xline(20.5, lc(cranberry) lp(dash)) keep(*.time#3.min_cen_d4) drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) xtitle(Year) le(95) mc(black) ciopts(recast(rcap) lwidth(0.3) lpattern(dash)) gen(enf_20_) replace | |
| twoway (rarea enf_20_ul1 enf_20_ll1 enf_20_at, color(gs6%20)) (scatter enf_20_b enf_20_at, msymbol(p) mc(black%60)) (line enf_20_b enf_20_at, lp(dash) lc(blackblack%60)), yline(0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.01 0.01)) ylab(-0.01(0.005)0.01) | |
| graph export "$out_files/any_air_cen_event_20.pdf", replace | |
| **============================================================================== | |
| * Figure D5 | |
| use "$data_files/city_enf.dta", clear | |
| set scheme s1mono | |
| fvset base 2014 year | |
| fvset base 20 time | |
| reghdfe log_any_air i.time##c.number i.post1##c.area i.post1##c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) poolsize(1) compact | |
| coefplot, baselevels omitted vert yline(-0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) keep(*me#c.number) coeflabels() drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) le(95) mc(black) gen(pm1_) replace | |
| regress number number_iv | |
| predict num_hat | |
| reghdfe log_any_air i.time##c.num_hat i.post1##c.area i.post1##c.pop, a(city_id year#quarter pred tem_meand age_year incentive2#time) cluster(city_id) poolsize(1) compact | |
| coefplot, baselevels omitted vert yline(-0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) keep(*me#c.num_hat) coeflabels() drop() graphregion(color(white) fcolor(white)) plotregion(color(white)) ytitle(Parameter Estimate) le(95) mc(black) gen(pm2_) replace | |
| twoway (rarea pm1_ul1 pm1_ll1 pm1_at, color(gs6%20)) (line pm1_b pm1_at, lwidth(medthick) lp(dash) lc(blackblack%70)) (rarea pm2_ul1 pm2_ll1 pm2_at, color(gs6%20)) (line pm2_b pm2_at, lp(dash) lc(blackblack%40)), yline(-0, lc(black)) xline(20.5, lp(dash) lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) ytitle("") xtitle("") xtick(1(1)32) xlabel(1 "2010" 5 "2011" 9 "2012" 13 "2013" 17 "2014" 21 "2015" 25 "2016" 29 "2017") ysc(r(-0.2 0.6)) ylabel(-0.2(0.2)0.6) legend(order(2 "DiD" 4 "DiD+IV") pos(2) ring(0) rows(2)) | |
| graph export "$out_files/eventenf.pdf", replace | |
| **============================================================================== | |
| * Figure D11 | |
| * balance | |
| use "$data_files/city_pm.dta", clear | |
| keep if year < 2015 | |
| replace light = log(light) | |
| gen log_any_air = log(any_air+1) | |
| collapse (mean) pm25 light log_any_air number area pop age city_id GDP, by(city_cn) | |
| gen above57 = age > 57 | |
| label variable number "\# Monitors" | |
| label variable area "Size of buildup area" | |
| label variable pop "Urban population" | |
| label variable pm25 "AOD before 2015" | |
| label variable light "Night light before 2015" | |
| label variable log_any_air "log(\# Firms) before 2015" | |
| fvset base 58 age | |
| regress number i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/number_age.pdf", replace | |
| regress area i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/area_age.pdf", replace | |
| regress pop i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/pop_age.pdf", replace | |
| regress pm25 i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/pm_age.pdf", replace | |
| regress light i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/light_age.pdf", replace | |
| regress log_any_air i.age if age>=50 & age<=60 | |
| coefplot, baselevels omitted vert drop(_cons) keep(*.age) yline(0, lc(cranberry)) graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ytitle("") xtitle("Age of Mayor")coeflabels(50.age = "50" 51.age = "51" 52.age = "52" 53.age = "53" 54.age = "54" 55.age = "55" 56.age = "56" 57.age = "57" 58.age = "58" 59.age = "59" 60.age = "60") le(95) | |
| graph export "$out_files/enf_age.pdf", replace | |
| **============================================================================== | |
| * Figure D7 | |
| * Bandwidths | |
| use "$data_files/city_pm_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| frame create fs fs_b fs_var | |
| quietly{ | |
| forvalues x = 4(2)20 { | |
| qui rdrobust number dist1, p(1) h(`x') kernel(uni) covs(cutoff) vce(cluster city_id) | |
| frame post fs (e(tau_cl)) (e(se_tau_cl)) | |
| } | |
| } | |
| frame fs: gen fs_ul = fs_b + 1.96*fs_var | |
| frame fs: gen fs_ll = fs_b - 1.96*fs_var | |
| frame fs: gen fs_at = 2 + 2*_n | |
| frame fs: twoway (connected fs_b fs_at, sort msymbol(S) color(black)) (line fs_ul fs_at, sort lpattern(dash) lcolor(gs9)) /* | |
| */ (line fs_ll fs_at, sort lpattern(dash) lcolor(gs9)), ytitle(Number of monitors) yline(0, lc(cranberry)) /* | |
| */ xtitle(Bandwidth) xline(11.3, lcolor(blue) lpattern(dash) lwidth(thin)) /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ysc(r(0 2)) ylabel(0(0.5)2) xlabel(4(2)20) | |
| graph export "$out_files/band_fs.pdf", replace | |
| gen bench = pm25 if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| frame create rd rd_b rd_var | |
| quietly{ | |
| forvalues x = 4(2)20 { | |
| qui rdrobust pm25 dist1 if year >= 2015, fuzzy(number) covs(cutoff mean_bench year) p(1) h(`x') vce(cluster city_id) kernel(uni) | |
| frame post rd (e(tau_cl)) (e(se_tau_cl)) | |
| } | |
| } | |
| frame rd: gen rd_ul = rd_b + 1.96*rd_var | |
| frame rd: gen rd_ll = rd_b - 1.96*rd_var | |
| frame rd: gen rd_at = 2 + 2*_n | |
| frame rd: twoway (connected rd_b rd_at, sort msymbol(S) color(black)) (line rd_ul rd_at, sort lpattern(dash) lcolor(gs9)) /* | |
| */ (line rd_ll rd_at, sort lpattern(dash) lcolor(gs9)), ytitle(Number of monitors) yline(0, lc(cranberry)) /* | |
| */ xtitle(Bandwidth) xline(11.3, lcolor(blue) lpattern(dash) lwidth(thin)) /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ysc(r(-0.075 0.05)) ylabel(-0.075(0.025)0.05) xlabel(4(2)20) | |
| graph export "$out_files/band_rd.pdf", replace | |
| use "$data_files/city_enf_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| gen bench = log_any_air if year < 2012 | |
| bys city_id cutoff: egen mean_bench = mean(bench) | |
| frame drop rd | |
| frame create rd rd_b rd_var | |
| quietly{ | |
| forvalues x = 4(2)20 { | |
| qui rdrobust log_any_air dist1 if year >= 2015, fuzzy(number) covs(cutoff mean_bench year) p(1) h(`x') vce(cluster city_id) kernel(uni) | |
| frame post rd (e(tau_cl)) (e(se_tau_cl)) | |
| } | |
| } | |
| frame rd: gen rd_ul = rd_b + 1.96*rd_var | |
| frame rd: gen rd_ll = rd_b - 1.96*rd_var | |
| frame rd: gen rd_at = 2 + 2*_n | |
| frame rd: twoway (connected rd_b rd_at, sort msymbol(S) color(black)) (line rd_ul rd_at, sort lpattern(dash) lcolor(gs9)) /* | |
| */ (line rd_ll rd_at, sort lpattern(dash) lcolor(gs9)), ytitle(Number of monitors) yline(0, lc(cranberry)) /* | |
| */ xtitle(Bandwidth) xline(11.3, lcolor(blue) lpattern(dash) lwidth(thin)) /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) legend(off) ysc(r(-0.2 0.6)) ylabel(-0.2(0.2)0.6) xlabel(4(2)20) | |
| graph export "$out_files/band_rd_enf.pdf", replace | |
| **============================================================================== | |
| * Figure D7 | |
| use "$data_files/city_pm_rd.dta", clear | |
| gen dist1 = area - 20 if cutoff == 1 | |
| replace dist1 = area - 50 if cutoff == 2 | |
| hist dist1 if cutoff == 1 & year == 2015 & month == 1, /* | |
| */ start(-24) width(12) xline(0, lc(cranberry)) ysc(r(0 0.025)) /* | |
| */ ylabel(0(0.005)0.025) xtitle("Size of the Build-up Area") /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) /* | |
| */ plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) /* | |
| */ legend(nobox region(fcolor(white) margin(zero) lcolor(white))) | |
| graph export "$out_files/Cutoff1Score1.pdf", replace | |
| hist dist1 if cutoff == 2 & year == 2015 & month == 1, /* | |
| */ start(-60) width(12) xline(0, lc(cranberry)) ysc(r(0 0.025)) /* | |
| */ ylabel(0(0.005)0.025) xtitle("Size of the Build-up Area") /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) /* | |
| */ plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) /* | |
| */ legend(nobox region(fcolor(white) margin(zero) lcolor(white))) | |
| graph export "$out_files/Cutoff2Score1.pdf", replace | |
| rddensity dist1 if year==2015 & month==1 & dist1<40 & dist1>-40, all plot plot_range(-20 20) nohist graph_opt(legend(off) xtitle("Size of the Buildup Area") ytitle("Density") graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white))) | |
| graph export "$out_files/DensityTest1.pdf", as(pdf) replace | |
| **============================================================================== | |
| * Figure D9 | |
| * hist | |
| use "$data_files/Raw/firm_info.dta", clear | |
| hist min_dist if min_dist < 50, xtitle("Distance to the closest monitor (km)") /* | |
| */ graphregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white) ilpattern(blank)) /* | |
| */ plotregion(fcolor(white) lcolor(none) ifcolor(white) ilcolor(white)) /* | |
| */ legend(nobox region(fcolor(white) margin(zero) lcolor(white))) | |
| graph export "$out_files/hist_min_dist.pdf", as(pdf) replace | |