fork download
  1. set more off
  2. cap log close
  3. cap clear all
  4. cls
  5.  
  6. version 14
  7.  
  8. clear
  9. set more off
  10. set type double, permanently
  11.  
  12. pause on
  13.  
  14. global MS "/ForMS"
  15. global code "$MS/Programs/DataConstruction"
  16. global log "$MS/Logs"
  17. global outputdir "$MS/OutputTex"
  18. global data "$MS/Data"
  19.  
  20.  
  21.  
  22. capture program drop Table6
  23. program define Table6
  24. capture log close
  25. log using "$log/Table6", replace
  26.  
  27. set more off
  28. foreach v of numlist 0 100 {
  29. eststo clear
  30. use "$data/NETS_Data_Regression.dta", clear
  31.  
  32. ****KEEP ONLY FIRMS WITH more than two employees before the shock
  33.  
  34. keep if emp_sh`v'>2 & emp_sh`v'!=.
  35.  
  36. ******SIZE TERCILES***
  37. xtile pct_`v'=sales_sh`v', nq(3)
  38.  
  39.  
  40. ***use data only for years after 2010
  41.  
  42. keep if shock_year_exc`v'!=. & year>=2010 & shock_year_exc`v' >=2010
  43.  
  44.  
  45.  
  46.  
  47. *******ALL********
  48.  
  49. eststo clear
  50.  
  51. eststo:xi: reghdfe ln_emp treatment_exc`v' , absorb(dnum division_id#year naics#year ) vce (clus id_exc`v'_n)
  52. estadd local firmfe "Yes"
  53. estadd local indyearfe "Yes"
  54. estadd local regionyearfe "Yes"
  55.  
  56.  
  57.  
  58. ****SMALL*****
  59. 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 )
  60. estadd local firmfe "Yes"
  61. estadd local indyearfe "Yes"
  62. estadd local regionyearfe "Yes"
  63.  
  64.  
  65. ****MEDIUM*****
  66.  
  67. 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)
  68. estadd local firmfe "Yes"
  69. estadd local indyearfe "Yes"
  70. estadd local regionyearfe "Yes"
  71.  
  72.  
  73.  
  74. *****LARGE*****
  75. 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 )
  76. estadd local firmfe "Yes"
  77. estadd local indyearfe "Yes"
  78. estadd local regionyearfe "Yes"
  79.  
  80.  
  81.  
  82. ** Output
  83. esttab using "$outputdir/Table6_`v'.tex", title( Effect of FCs on Employment by Retail Stores) b(%9.3f) se(%9.3f) ar2(%9.3f) ///
  84. mtitles("All" "Small" "Medium" "Large") ///
  85. stats(firmfe indyearfe regionyearfe r2_a N, fmt(a3 2 a3) labels( "Establishment FE" "Ind-Year FE" "Region-Year FE" "Adj.-R$^2$" "Obs.")) ///
  86. star(* 0.10 ** 0.05 *** 0.01) obslast label replace substitute(\_ _) addnotes(Standard errors are clustered at the county level)
  87.  
  88. }
Success #stdin #stdout 0.03s 25568KB
stdin
Standard input is empty
stdout
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