use 论文主回归数据.dta,clear

***散点拟合图***论文未删减版图2
twoway (scatter lnso2 import_ratio) (lfit lnso2 import_ratio)
twoway (scatter lnso2p import_ratio) (lfit lnso2p import_ratio)

****lnso2 二氧化硫产出强度/lnso2p 二氧化硫排放强度*** 

***数据描述性统计***
sum lnso2 lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out
logout, save(tab_stat2) excel replace fix(3):tabstat lnso2 lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out,s(N mean sd min max median) f(%4.3f) c(s)

***基准回归***
xi:reg lnso2 import_ratio,vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:reg lnso2p import_ratio,vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "表基准.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

***异质性检验***
xi:areg lnso2 importratio_pollution importratio_clear age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importratio_pollution importratio_clear)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 importratio_highcom importratio_lowcom age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importratio_highcom importratio_lowcom)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 importrario_state importrario_priv importrario_foreign age size klratio finance export_dum HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importrario_state importrario_priv importrario_foreign)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p importratio_pollution importratio_clear age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importratio_pollution importratio_clear)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p importratio_highcom importratio_lowcom age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importratio_highcom importratio_lowcom)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p importrario_state importrario_priv importrario_foreign age size klratio finance export_dum HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "异质性检验.xls",keep(importrario_state importrario_priv importrario_foreign)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 


***稳健性检验***

xi:areg lnso2 import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 i.city_year,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 if liangkong!=1,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio2 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验.xls",keep(import_ratio2 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 tariff_cic3 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验.xls",keep(tariff_cic3 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 tariff_cic2 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验.xls",keep(tariff_cic2 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2_va import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 if survive>5,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

***稳健性检验***
xi:areg lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 i.city_year,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验2.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 if liangkong!=1,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验2.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio2 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验2.xls",keep(import_ratio2 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p tariff_cic3 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验2.xls",keep(tariff_cic3 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p tariff_cic2 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.industry,ab(id) vce(cluster industry_year)
outreg2  using "敏感性检验2.xls",keep(tariff_cic2 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p_va import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验2.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3 if survive>5,ab(id) vce(cluster cic3_year)
outreg2  using "敏感性检验2.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 


***滞后项作解释变量***
xi:areg lnso2 lag_import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "内生性.xls",keep(lag_import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p lag_import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "内生性.xls",keep(lag_import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 


***机制检验***
xi:areg lnoutput1 import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out)replace dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio lnoutput1 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio lnoutput1 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio lnoutput1 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio lnoutput1 age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

***技术进步机制***TL生产函数
xi:areg tfp_acf_tl import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio age size klratio finance subsidy export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio tfp_acf_tl age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio tfp_acf_tl age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio tfp_acf_tl age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio tfp_acf_tl age size klratio finance export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

***技术进步机制***CD生产函数（稳健性检验，正文未汇报）
xi:areg tfp_acf_cd import_ratio age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio age size klratio finance subsidy export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2 import_ratio tfp_acf_cd age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio tfp_acf_cd age size klratio finance subsidy export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 

xi:areg lnso2p import_ratio tfp_acf_cd age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,ab(id) vce(cluster cic3_year)
outreg2  using "机制1.xls",keep(import_ratio tfp_acf_cd age size klratio finance subsidy export_dum state hmt foreign HHI lnmean_out)append dec(4) bdec(4) adjr2 addtext(Firm FE,Yes,Year FE,Yes,Industry FE,Yes) 


***进入与退出视角***
use 企业退出进入视角.dta,clear
xi:probit exit import_ratio importratio_lnso2 lnso2 age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,vce(cluster cic3_year)
outreg2  using "进入与退出.xls",keep(import_ratio importratio_lnso2)replace dec(4) bdec(4) r2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:probit exit import_ratio importratio_lnso2p lnso2p age size klratio finance export_dum state hmt foreign HHI lnmean_out i.year i.cic3,vce(cluster cic3_year)
outreg2  using "进入与退出.xls",keep(import_ratio importratio_lnso2p)append dec(4) bdec(4) r2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:probit entry import_ratio importratio_lnso2 lnso2 age size klratio state hmt foreign HHI lnmean_out i.year i.cic3,vce(cluster cic3_year)
outreg2  using "进入与退出.xls",keep(import_ratio importratio_lnso2)append dec(4) bdec(4) r2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:probit entry import_ratio importratio_lnso2p lnso2p age size klratio  state hmt foreign HHI lnmean_out i.year i.cic3,vce(cluster cic3_year)
outreg2  using "进入与退出.xls",keep(import_ratio importratio_lnso2p)append dec(4) bdec(4) r2 addtext(Industry FE,Yes,Year FE,Yes) 


***行业收敛回归***
use 收敛回归.dta,clear
xi:areg lntheil_so2 import_ratio i.year,ab(cic3)
outreg2  using "行业收敛.xls",keep(import_ratio)replace dec(4) bdec(4) adjr2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:areg lntheil_so2 import_ratio stateratio foreignratio export_in HHI i.year,ab(cic3)
outreg2  using "行业收敛.xls",keep(import_ratio stateratio foreignratio export_in HHI)append dec(4) bdec(4) adjr2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:areg lntheil_so2p import_ratio i.year,ab(cic3)
outreg2  using "行业收敛.xls",keep(import_ratio)append dec(4) bdec(4) adjr2 addtext(Industry FE,Yes,Year FE,Yes) 

xi:areg lntheil_so2p import_ratio stateratio foreignratio export_in HHI i.year,ab(cic3)
outreg2  using "行业收敛.xls",keep(import_ratio stateratio foreignratio export_in HHI)append dec(4) bdec(4) adjr2 addtext(Industry FE,Yes,Year FE,Yes) 
