logout, save(test1) word replace: tabstat  Y_LABORss X qzcfzl qyage qROA lnsizes city_gdprate city_labor city_school city_hospital, stat(count mean sd min max) col(stat) format(%10.3f)

global control "qzcfzl qyage qROA lnsizes city_gdprate city_labor city_school city_hospital  "

***************************************基准回归
********************企业控制变量
reghdfe Y_LABORss X,absorb( id year) cluster(id)
outreg2 using 逐步回归.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle( )
reghdfe Y_LABORss X  qzcfzl qyage qROA lnsizes,absorb( id year) cluster(id)
outreg2 using 逐步回归.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle( )
reghdfe Y_LABORss X city_gdprate city_labor city_school city_hospital,absorb( id year) cluster(id)
outreg2 using 逐步回归.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle( )
reghdfe Y_LABORss X qzcfzl qyage qROA lnsizes city_gdprate city_labor city_school city_hospital ,absorb( id year ) cluster(id)
outreg2 using 逐步回归.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle( )





***************************************稳健性检验
*替换核心变量
reghdfe Y_LABORss Xreplace $control,absorb( id year ) cluster(id)
outreg2 using 稳健性检验.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(Xreplace) ctitle(tihuanhexin )
*替换被解释变量
reghdfe tihuanY X $control,absorb( id year ) cluster(id)
outreg2 using 稳健性检验.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle(tihuanbeijieshibian) 
*排除面积极端值
reghdfe Y_LABORss X $control if mianjipaixu==1,absorb( id year) cluster(id)
outreg2 using 稳健性检验.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle(paichujd )
*滞后一期
xtset id year
sort id year
reghdfe Y_LABORss L.X $control,absorb( id year) cluster(id)
outreg2 using 稳健性检验.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(L.X) ctitle( zhihouyiqi)
*增加固定效应
reghdfe Y_LABORss X $control,absorb( id year city) cluster(id)
outreg2 using 稳健性检验.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle(gudingxiaoying )
*排除跨市流动人口的替代性解释
reghdfe Y_LABORss X liudongpopxishu $control,absorb( id year) cluster(id)
outreg2 using 稳健性检验.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X liudongpopxishu) ctitle(paichukuaquyuyinsu )


***************************************异质性检验
*企业要素密集度
reghdfe Y_LABORss X $control if 异质性—企业要素密集度==1,absorb( id year) cluster(id)
outreg2 using 异质性1.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(ziben)
reghdfe Y_LABORss X $control if 异质性—企业要素密集度==0,absorb( id year) cluster(id)
outreg2 using 异质性1.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(laodong)

bdiff,group(异质性—企业要素密集度) model(reghdfe Y_LABORss X $control,absorb( id year) cluster(id)) bs reps(100) detail
*市场分割
reghdfe Y_LABORss X $control if 异质性—市场分割==0,absorb( id year) cluster(id)
outreg2 using 异质性2.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(lowfenge)
reghdfe Y_LABORss X $control if 异质性—市场分割==1,absorb( id year) cluster(id)
outreg2 using 异质性2.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(highfenge)

bdiff,group(异质性—市场分割) model(reghdfe Y_LABORss X $control,absorb( id year) cluster(id)) bs reps(100) detail
*企业所在城市是否开通地铁
reghdfe Y_LABORss X $control if 异质性—是否开通地铁==0,absorb( id year) cluster(id)
outreg2 using city异质性3.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(nosubway)
reghdfe Y_LABORss X $control if 异质性—是否开通地铁==1,absorb( id year) cluster(id)
outreg2 using city异质性3.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(yessubway)

bdiff,group(异质性—是否开通地铁) model(reghdfe Y_LABORss X $control ,absorb( id year) cluster(id)) bs reps(100) detail

*区分Y维度
reghdfe Y_LABORss X $control if 异质性—劳动力配置不足或者过度==1,absorb( id year) cluster(id)
outreg2 using city异质性5.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(buzu)
reghdfe Y_LABORss X $control if 异质性—劳动力配置不足或者过度==0,absorb( id year) cluster(id)
outreg2 using city异质性5.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep() ctitle(guodu)

bdiff, group( 异质性—劳动力配置不足或者过度) model(reghdfe Y_LABORss X $control ,absorb( id year) cluster(id)) bs reps(100) detail
***************************************内生性-工具变量
eststo:ivreghdfe Y_LABORss  $control ( X= toolsrjdlmj ), a(id year) first savefirst savefp(f)
est restore fX
outreg2 using 工具变量.doc,cttop(first) replace
est restore est1
outreg2 using 工具变量.doc,cttop(second)



***************************************机制分析
reghdfe jz_cxfgxs X $control ,absorb( id year city) cluster(id)
outreg2 using 机制分析.doc,replace tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle( )
reghdfe jz_HHi X $control ,absorb( id year  Indnme_3) cluster(id)
outreg2 using 机制分析.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle( )
reghdfe jz_lddjnls X $control ,absorb( id year Indnme_3) cluster(id)
outreg2 using 机制分析.doc,append tstat bdec(3) tdec(3) addstat(Ajusted R2,`e(r2_a)') keep(X) ctitle( )




