* Reproduces Table OA19
clear all
cls
use "cogs_deflated.dta", clear
log using BWE_LT.txt, text replace 

* lead time
winsor2 dpo, cuts(5 95)
rename dpo_w lt
label var lt "LT"

gen dd0=dist1==0
gen dd1=dist1==1
gen dd2=dist1==2
gen dd3=dist1==3
gen dd4=dist1==4
gen dd5=dist1==5
gen dd6=dist1==6
gen dd7=dist1==7
gen dd8=dist1==8

label var dd0 "Layer=0"
label var dd1 "Layer=1"
label var dd2 "Layer=2"
label var dd3 "Layer=3"
label var dd4 "Layer=4"
label var dd5 "Layer=5"
label var dd6 "Layer=6"
label var dd7 "Layer=7"
label var dd8 "Layer=8"



local IFE = "i.sic2"


reg bwed lt dd0-dd7 lsaleq `IFE' i.year 	if dist1<8,  noconstant vce(cluster gvkey_code)
outreg2 using respLT2.tex, replace dec(4) lab tex(frag) drop(i.year `IFE') addtext(Industry FE, Yes, Year FE, Yes)
reg bwed dist1 lt lsaleq `IFE' i.year 	if dist1<8,  vce(cluster gvkey_code)
outreg2 using respLT2.tex, append dec(4) lab tex(frag) drop(i.year `IFE') sortvar(dist1 dd0-dd7 lt lsaleq) addtext(Industry FE, Yes, Year FE, Yes)
reg sd_cogsqd lt dd0-dd7 lsaleq `IFE' i.year 	if dist1<8,  noconstant vce(cluster gvkey_code)
outreg2 using respLT2.tex, append dec(4) lab tex(frag) drop(i.year `IFE') addtext(Industry FE, Yes, Year FE, Yes)
reg sd_cogsqd dist1 lt lsaleq `IFE' i.year 	if dist1<8,  vce(cluster gvkey_code)
outreg2 using respLT2.tex, append dec(4) lab tex(frag) drop(i.year `IFE') sortvar(dist1 dd0-dd7 lt lsaleq) addtext(Industry FE, Yes, Year FE, Yes)
