set more off cap log close cap clear all cls version 14 clear set more off set type double, permanently pause on global MS "/ForMS" global code "$MS/Programs/DataConstruction" global outputdir "$MS/OutputTex" global data "$MS/Data" capture program drop Table6 program define Table6 capture log close set more off foreach v of numlist 0 100 { eststo clear use "$data/NETS_Data_Regression.dta", clear ****KEEP ONLY FIRMS WITH more than two employees before the shock keep if emp_sh`v'>2 & emp_sh`v'!=. ******SIZE TERCILES*** xtile pct_`v'=sales_sh`v', nq(3) ***use data only for years after 2010 keep if shock_year_exc`v'!=. & year>=2010 & shock_year_exc`v' >=2010 *******ALL******** eststo clear eststo:xi: reghdfe ln_emp treatment_exc`v' , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ****SMALL***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==1 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n ) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ****MEDIUM***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==2 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" *****LARGE***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==3 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n ) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ** Output esttab using "$outputdir/Table6_`v'.tex", title( Effect of FCs on Employment by Retail Stores) b(%9.3f) se(%9.3f) ar2(%9.3f) /// mtitles("All" "Small" "Medium" "Large") /// stats(firmfe indyearfe regionyearfe r2_a N, fmt(a3 2 a3) labels( "Establishment FE" "Ind-Year FE" "Region-Year FE" "Adj.-R$^2$" "Obs.")) /// star(* 0.10 ** 0.05 *** 0.01) obslast label replace substitute(\_ _) addnotes(Standard errors are clustered at the county level) }
Standard input is empty
set more off cap log close cap clear all cls version 14 clear set more off set type double, permanently pause on global MS "/ForMS" global code "$MS/Programs/DataConstruction" global log "$MS/Logs" global outputdir "$MS/OutputTex" global data "$MS/Data" capture program drop Table6 program define Table6 capture log close log using "$log/Table6", replace set more off foreach v of numlist 0 100 { eststo clear use "$data/NETS_Data_Regression.dta", clear ****KEEP ONLY FIRMS WITH more than two employees before the shock keep if emp_sh`v'>2 & emp_sh`v'!=. ******SIZE TERCILES*** xtile pct_`v'=sales_sh`v', nq(3) ***use data only for years after 2010 keep if shock_year_exc`v'!=. & year>=2010 & shock_year_exc`v' >=2010 *******ALL******** eststo clear eststo:xi: reghdfe ln_emp treatment_exc`v' , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ****SMALL***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==1 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n ) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ****MEDIUM***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==2 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" *****LARGE***** eststo:xi: reghdfe ln_emp treatment_exc`v' if pct_`v'==3 , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n ) estadd local firmfe "Yes" estadd local indyearfe "Yes" estadd local regionyearfe "Yes" ** Output esttab using "$outputdir/Table6_`v'.tex", title( Effect of FCs on Employment by Retail Stores) b(%9.3f) se(%9.3f) ar2(%9.3f) /// mtitles("All" "Small" "Medium" "Large") /// stats(firmfe indyearfe regionyearfe r2_a N, fmt(a3 2 a3) labels( "Establishment FE" "Ind-Year FE" "Region-Year FE" "Adj.-R$^2$" "Obs.")) /// star(* 0.10 ** 0.05 *** 0.01) obslast label replace substitute(\_ _) addnotes(Standard errors are clustered at the county level) } end