{smcl}
{txt}{sf}{ul off}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}E:\2024-00768_数据\2024-00768+日志文件/log_main.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}23 Apr 2025, 16:30:37
{txt}
{com}.         log on 
{txt}(log already on)

{com}.         
.         
. 
. ********************************************************************************
. /*                                                                      变量含义                                                              */
. ********************************************************************************
. /*
>         
> 
>         （1）县级数据中的变量，用于文章的主体分析。在实际分析中可能也会使用其差分、基期值，生成过程详见具体代码：
>         Grain：县粮食产量（10万吨）。
>         lnGDP_pc：按2000年价格指数平减的县实际人均GDP（元/人）的对数值。
>         lnTempr：对数年均气温（摄氏度）。
>         lnRainfall：对数年总降水量（毫米）。
>         Share_PriGDP: 第一产业（农业）GDP占总GDP的百分比。
>         Share_SecGDP：第二产业（工业）GDP占总GDP的百分比。
>         lnGDP_agr_pc: 按2000年价格指数平减的县实际第一产业人均GDP（元/人）的对数值。
>         lnGDP_ind_pc: 按2000年价格指数平减的县实际第二产业人均GDP（元/人）的对数值。
>         lnGDP_serv_pc: 按2000年价格指数平减的县实际第三产业人均GDP（元/人）的对数值。
>         lnGDP_nagr_pc: 按2000年价格指数平减的县实际非农产业（也即第二和第三产业加总）人均GDP（元/人）的对数值。
>         lncstrct_land：县建设用地面积（平方公里）的对数值。
>         lncstrct_land_new：县新增的建设用地面积（平方公里）的对数值。
>         lnfarmland_dcrs：被转化为其他用途的耕地面积（平方公里）的对数值。
>         lnslope_cstrct_land：县建设用地的平均坡度的对数值。
>         lnnum_new_firms：县新注册企业的数量的对数值。
>         share_ov1k_new_firms: 新注册企业中注册资本超过1000万元的比例。
>         lnavgemp_old_firms：县域2003年以前注册的工业企业的平均就业人数。
>         tfp_firms：工业企业的平均全要素生产率取对数。
>         lntrsf_gen：县级政府所收到的一般性财政转移支付收入的对数值。
>         lntrsf_spec：县级政府所收到的专项财政转移支付收入的对数值。
>         lnpub_expd：县级政府的一般预算公共支出的对数值。
>         lnpub_expd_agr：县级政府的农业相关公共支出的对数值。
>         is_zcq：县是否属于粮食主产省的虚拟变量，是=1，否=0。
>         is_phq：县是否属于粮食产销平衡省的虚拟变量，是=1，否=0
>         is_zxq：县是否属于粮食主销省的虚拟变量，是=1，否=0。
>         cqtype：县所属产销区的类型：1=主产区，2=平衡区，3=主销区。
>         region_east: 是否属于东部地区，是=1，否=0。
>         region_mid: 是否属于中部地区，是=1，否=0。
>         region_west: 是否属于西部地区，是=1，否=0。
>         region_noreast: 是否属于东北地区，是=1，否=0。
>         lnemply: 就业总人口数的对数值。
>         emply_shr_pri: 第一产业就业占总就业的百分比。
>         emply_shr_sec: 第二产业就业占总就业的百分比。
>         emply_shr_ter: 第三产业就业占总就业的百分比。
>         GDP_pc: 县按2000年价格平减后的实际人均GDP（元/人）。
>         pop: 县年末总人口（万人）。
>         GDP: 县按2000年价格平减后的实际GDP（万元）。
>         farmland_area：县域耕地总面积（平方公里）。
>         Farmland_share：县域耕地面积占总面积的百分比。
>         Sown_area：县农作物播种面积（万公顷）。
>         shr_potprod_rice：县的潜在水稻总产出占全国水稻潜在总产出的比例。
>         shr_potprod_wheat：县的潜在水稻总产出占全国小麦潜在总产出的比例。
>         shr_potprod_maize：县的潜在水稻总产出占全国玉米潜在总产出的比例。
>         shr_potprod_soybean：县的潜在水稻总产出占全国大豆潜在总产出的比例。
>         shr_potprod_millet：县的潜在水稻总产出占全国谷子潜在总产出的比例。
>         shr_potprod_sorghum：县的潜在水稻总产出占全国高粱潜在总产出的比例。
>         dsim_Grain：按自然禀赋分配的潜在增产量（工具变量）。
>         dsim_Grain_dwm：在构建时去除了小麦和谷子的按自然禀赋分配的潜在增产量（工具变量）。
>         dsim_Grain_nosy：在构建时去除了大豆的按自然禀赋分配的潜在增产量（工具变量）。
>         tarif_shock：2001年县层面按产业结构加总的平均进口关税。
>         sim_Grain：按自然禀赋分配的潜在总产量。
>         potyield_rice：县种植水稻的平均潜在可达单产。
>         lnLight：县平均夜间灯光强度的对数值。
>         lnPDen：县的人口密度对数值。
>         confucious_temple：县孔庙的数量。
>         soe_empshare：期初县域国有企业的就业占比。
>         lnlandinc：县财政与土地出让相关的收入（国有土地使用权出让金收入）的对数值。
>         lnlandexp：县财政与土地出让相关的支出（国有土地使用权出让金支出）的对数值。
> 
>         （2）省级数据中的变量（用于区域增产的描述性统计图1、表I1、核算总体增产成本表4）：
>         grain: 省粮食产量，单位为万吨。
>         gdppc: 省实际人均GDP
>         mpop_per_county: 本省县级行政区的平均人口
>         pop: 省总人口
>         
>         
> */
. 
.         
. 
.         
. ********************************************************************************
. ********************** 图1.粮食生产与主产区贡献 ********************************
. ********************************************************************************
. 
.         use $working_data\province_data.dta, clear
{txt}
{com}.         
.         
.         * 变量处理
.         //粮食产量单位从万吨换算为亿吨
.         replace grain = grain/10000
{txt}(1,016 real changes made)

{com}.         //计算全国总产出、主产区产出和占比
.         bysort year: egen ttl_grain = total(grain)
{txt}
{com}.         bysort year: egen zcq_grain = total(grain*is_zcq)
{txt}
{com}.         gen grain_shr_zcq = (zcq_grain/ttl_grain)*100
{txt}
{com}.         
.  
.         twoway (connected ttl_grain year if year>=1998&year<=2023, fcolor(none) lcolor(black) lwidth(medium) msymbol(triangle) msize(small) mcolor(black) lpattern(dash) lwidth(thin)) || (connected zcq_grain year if year>=1998&year<=2023, fcolor(none) lcolor(black) lwidth(medium) msymbol(circle) msize(small) mcolor(black) lpattern(solid) lwidth(thin)) || (connected grain_shr_zcq year if year>=1998&year<=2023, yaxis(2) fcolor(none) lcolor(black) lwidth(medium) msymbol(+) msize(small) mcolor(black) lpattern(dash_dot) lwidth(medium)) ||, xtitle("年份",size(medlarge) alignment(top) margin(small)) xlabel(1998 2003 2016 2023,labsize(small)) xline(2003,lcolor(black) lstyle(refline) lpattern(dash)) xline(2016,lcolor(black) lpattern(dash)) ytitle("粮食产量(亿吨)",axis(1) size(medlarge) alignment(top) margin(medsmall)) ytitle("粮食产量贡献(%)",axis(2) size(medlarge) alignment(top) margin(medsmall)) ylabel(,labsize(small) axis(1)) ylabel(70(2)80,labsize(small) axis(2)) scheme(s1mono) legend(label(1 "全国粮食产量") label(2 "主产区粮食产量") label(3 "主产区粮食产量贡献") size(medsmall) ring(0) rows(3) position(11)) 
{res}{txt}
{com}.         graph export "$logfiles/figure_1.png",replace width(2400) height(1800)
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_1.png{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_1.png{rm}
saved as
PNG
format
{p_end}

{com}.         
.         
. 
.         
.         
. 
. ********************************************************************************
. ********************* 图2.县域粮食产量与人均GDP的关系  *************************
. ********************************************************************************
. 
.         use $working_data\county_panel.dta ,clear
{txt}
{com}.         
. 
.         * 人均单位转换：元->万元
.         replace GDP_pc = GDP_pc/10000
{txt}(47,294 real changes made)

{com}.         
.         * 删去极端值
.         winsor2 Grain GDP_pc, suffix(_tr) trim cuts(1 99) by(year)
{txt}
{com}. 
.         
.         
.         //2000
.         reg GDP_pc_tr Grain_tr if year==2000, vce(robust)

{txt}Linear regression                               Number of obs     = {res}     1,771
                                                {txt}F(1, 1769)        =  {res}     5.70
                                                {txt}Prob > F          = {res}    0.0170
                                                {txt}R-squared         = {res}    0.0027
                                                {txt}Root MSE          =    {res} .35176

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}   GDP_pc_tr{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}Grain_tr {c |}{col 14}{res}{space 2} .0110243{col 26}{space 2} .0046156{col 37}{space 1}    2.39{col 46}{space 3}0.017{col 54}{space 4} .0019718{col 67}{space 3} .0200769
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .4895739{col 26}{space 2} .0131244{col 37}{space 1}   37.30{col 46}{space 3}0.000{col 54}{space 4}  .463833{col 67}{space 3} .5153149
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}.         local beta : display %6.3f _b[Grain_tr]
{res}{txt}
{com}.         local se : display %6.3f _se[Grain_tr]  
{res}{txt}
{com}.         local p_val : display %6.3f 2*ttail(e(df_r), abs(_b[Grain_tr]/_se[Grain_tr]))
{res}{txt}
{com}.         twoway scatter GDP_pc_tr Grain_tr if year==2000, msize(vsmall) mcolor(gs10) || lfit GDP_pc_tr Grain_tr if year==2000,lcolor(black) ||, scheme(s1mono) xtitle("粮食产量(十万吨)") ytitle("人均GDP(万元)",margin(medsmall)) legend(off) note("coef = `beta', SE = `se', p = `p_val'",ring(0) position(4) box bcolor(bg) lcolor(black)) name(gdpgrain_00,replace) subtitle("2000年")
{res}{txt}
{com}.         
.         
.         
.         //2003
.         reg GDP_pc_tr Grain_tr if year==2003, vce(robust)

{txt}Linear regression                               Number of obs     = {res}     2,023
                                                {txt}F(1, 2021)        =  {res}     0.22
                                                {txt}Prob > F          = {res}    0.6415
                                                {txt}R-squared         = {res}    0.0001
                                                {txt}Root MSE          =    {res} .49067

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}   GDP_pc_tr{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}Grain_tr {c |}{col 14}{res}{space 2}-.0030409{col 26}{space 2} .0065308{col 37}{space 1}   -0.47{col 46}{space 3}0.642{col 54}{space 4}-.0158486{col 67}{space 3} .0097669
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .6758249{col 26}{space 2} .0175057{col 37}{space 1}   38.61{col 46}{space 3}0.000{col 54}{space 4} .6414938{col 67}{space 3} .7101561
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}.         local beta : display %06.3f _b[Grain_tr]
{res}{txt}
{com}.         local se : display %6.3f _se[Grain_tr]  
{res}{txt}
{com}.         local p_val : display %6.3f 2*ttail(e(df_r), abs(_b[Grain_tr]/_se[Grain_tr]))
{res}{txt}
{com}.         twoway scatter GDP_pc_tr Grain_tr if year==2003, msize(vsmall) mcolor(gs10) || lfit GDP_pc_tr Grain_tr if year==2003,lcolor(black) ||, scheme(s1mono) xtitle("粮食产量(十万吨)") ytitle("人均GDP(万元)",margin(medsmall)) legend(off) note("coef = `beta', SE = `se', p = `p_val'",ring(0) position(4) box bcolor(bg) lcolor(black)) name(gdpgrain_03,replace) subtitle("2003年")
{res}{txt}
{com}.         
.         
.         
.         //2016
.         reg GDP_pc_tr Grain_tr if year==2016, vce(robust)

{txt}Linear regression                               Number of obs     = {res}     1,953
                                                {txt}F(1, 1951)        =  {res}    45.12
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.0167
                                                {txt}Root MSE          =    {res} 1.9997

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}   GDP_pc_tr{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}Grain_tr {c |}{col 14}{res}{space 2}-.1003575{col 26}{space 2} .0149408{col 37}{space 1}   -6.72{col 46}{space 3}0.000{col 54}{space 4}-.1296591{col 67}{space 3} -.071056
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 3.067745{col 26}{space 2} .0709939{col 37}{space 1}   43.21{col 46}{space 3}0.000{col 54}{space 4} 2.928514{col 67}{space 3} 3.206977
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}.         local beta : display %06.3f _b[Grain_tr]
{res}{txt}
{com}.         local se : display %6.3f _se[Grain_tr]  
{res}{txt}
{com}.         local p_val : display %6.3f 2*ttail(e(df_r), abs(_b[Grain_tr]/_se[Grain_tr]))
{res}{txt}
{com}.         twoway scatter GDP_pc_tr Grain_tr if year==2016, msize(vsmall) mcolor(gs10) || lfit GDP_pc_tr Grain_tr if year==2016,lcolor(black) ||, scheme(s1mono) xtitle("粮食产量(十万吨)") ytitle("人均GDP(万元)",margin(medsmall)) legend(off) note("coef = `beta', SE = `se', p = `p_val'",ring(0) position(4) box bcolor(bg) lcolor(black)) name(gdpgrain_16,replace) subtitle("2016年")
{res}{txt}
{com}. 
.         
.         
.         //2020
.         reg GDP_pc_tr Grain_tr if year==2020, vce(robust)

{txt}Linear regression                               Number of obs     = {res}       796
                                                {txt}F(1, 794)         =  {res}   118.91
                                                {txt}Prob > F          = {res}    0.0000
                                                {txt}R-squared         = {res}    0.0879
                                                {txt}Root MSE          =    {res} 2.1507

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}   GDP_pc_tr{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 4}Grain_tr {c |}{col 14}{res}{space 2}-.2828721{col 26}{space 2} .0259403{col 37}{space 1}  -10.90{col 46}{space 3}0.000{col 54}{space 4}-.3337918{col 67}{space 3}-.2319524
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}  4.41398{col 26}{space 2} .1227242{col 37}{space 1}   35.97{col 46}{space 3}0.000{col 54}{space 4} 4.173078{col 67}{space 3} 4.654882
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}{txt}
{com}.         local beta : display %06.3f _b[Grain_tr]
{res}{txt}
{com}.         local se : display %6.3f _se[Grain_tr]  
{res}{txt}
{com}.         local p_val : display %6.3f 2*ttail(e(df_r), abs(_b[Grain_tr]/_se[Grain_tr]))
{res}{txt}
{com}.         twoway scatter GDP_pc_tr Grain_tr if year==2020, msize(vsmall) mcolor(gs10) || lfit GDP_pc_tr Grain_tr if year==2020,lcolor(black) ||, scheme(s1mono) xtitle("粮食产量(十万吨)") ytitle("人均GDP(万元)",margin(medsmall)) legend(off) note("coef = `beta', SE = `se', p = `p_val'",ring(0) position(4) box bcolor(bg) lcolor(black)) name(gdpgrain_20,replace) subtitle("2020年")
{res}{txt}
{com}.         
. 
.         * 合并输出
.         graph combine gdpgrain_00 gdpgrain_03 gdpgrain_16 gdpgrain_20, scheme(s1mono) xsize(30) ysize(25)
{res}{txt}
{com}.         graph export "$logfiles/figure_2.png", replace height(2500) width(3000)
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_2.png{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_2.png{rm}
saved as
PNG
format
{p_end}

{com}. 
. 
.         
.         
. ********************************************************************************
. ****************** 表1 .粮食增产与县域经济发展：基准回归 ************************
. ********************************************************************************
.         
.         
.         use $working_data\county_panel.dta ,clear
{txt}
{com}.         
.         capture mkdir "$logfiles/table_1"  //创建单独文件夹输出
{txt}
{com}. 
.                                                 ***--- 变量处理 ---***
.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         foreach v of varlist Grain lnGDP_pc lnTempr lnRainfall Share_PriGDP Share_SecGDP{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)
(1,246 missing values generated)
(993 missing values generated)
(10,269 missing values generated)
(9,970 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(16,346 missing values generated)

{com}.         
.         
.         
.                                                 ***--- 工具变量估计 ---***
.                         //注:本部分将输出两个结果文件，"table1_2sls"为表1的2SLS回归结果,"table1_fststage"为表1的第一阶段回归结果
. 
.         est clear
{txt}
{com}.         *(1). 无控制变量
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   276{txt}{col 55}Number of obs = {res}    1789
{txt}{col 55}F(  1,   275) = {res}    4.61
{txt}{col 55}Prob > F      = {res}  0.0327
{txt}Total (centered) SS     = {res} 129.3586903{txt}{col 55}Centered R2   = {res} -0.0080
{txt}Total (uncentered) SS   = {res} 129.3586903{txt}{col 55}Uncentered R2 = {res} -0.0080
{txt}Residual SS             = {res} 130.3927624{txt}{col 55}Root MSE      = {res}   .2701

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0321261{col 26}{space 2}  .014962{col 37}{space 1}   -2.15{col 46}{space 3}0.033{col 54}{space 4}-.0615807{col 67}{space 3}-.0026715
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  32.513
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 597.170
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  62.733
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,789
{txt}Absorbing 1 HDFE group{col 51}F({res}   1{txt},{res}    275{txt}){col 67}= {res}     62.73
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7666
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7239
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2505
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       276{txt}{col 51}Root MSE{col 67}= {res}    1.0176

{txt}{ralign 78:(Std. err. adjusted for {res:276} clusters in {res:city_id})}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}     d_Grain{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}dsim_Grain {c |}{col 14}{res}{space 2} 1.281095{col 26}{space 2} .1617453{col 37}{space 1}    7.92{col 46}{space 3}0.000{col 54}{space 4} .9626786{col 67}{space 3} 1.599511
{txt}{space 7}_cons {c |}{col 14}{res}{space 2}-.0070305{col 26}{space 2} .1330398{col 37}{space 1}   -0.05{col 46}{space 3}0.958{col 54}{space 4}-.2689363{col 67}{space 3} .2548754
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         *(2).增加控制基期人均GDP
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   276{txt}{col 55}Number of obs = {res}    1789
{txt}{col 55}F(  2,   275) = {res}   81.69
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 129.3586903{txt}{col 55}Centered R2   = {res}  0.1589
{txt}Total (uncentered) SS   = {res} 129.3586903{txt}{col 55}Uncentered R2 = {res}  0.1589
{txt}Residual SS             = {res} 108.8029909{txt}{col 55}Root MSE      = {res}   .2468

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0591131{col 26}{space 2}  .012991{col 37}{space 1}   -4.55{col 46}{space 3}0.000{col 54}{space 4}-.0846876{col 67}{space 3}-.0335386
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3047582{col 26}{space 2} .0243734{col 37}{space 1}  -12.50{col 46}{space 3}0.000{col 54}{space 4}-.3527404{col 67}{space 3} -.256776
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  31.800
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 566.057
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  62.566
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain lnGDP_pc_03 if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,789
{txt}Absorbing 1 HDFE group{col 51}F({res}   2{txt},{res}    275{txt}){col 67}= {res}     31.51
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7702
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7281
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2623
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       276{txt}{col 51}Root MSE{col 67}= {res}    1.0099

{txt}{ralign 78:(Std. err. adjusted for {res:276} clusters in {res:city_id})}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}     d_Grain{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}dsim_Grain {c |}{col 14}{res}{space 2} 1.246968{col 26}{space 2} .1576471{col 37}{space 1}    7.91{col 46}{space 3}0.000{col 54}{space 4} .9366191{col 67}{space 3} 1.557316
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3008294{col 26}{space 2} .1024553{col 37}{space 1}   -2.94{col 46}{space 3}0.004{col 54}{space 4}-.5025257{col 67}{space 3} -.099133
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 2.609543{col 26}{space 2} .8530037{col 37}{space 1}    3.06{col 46}{space 3}0.002{col 54}{space 4} .9302963{col 67}{space 3}  4.28879
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         *(3).增加控制期初年均温
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 lnTempr_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   275{txt}{col 55}Number of obs = {res}    1781
{txt}{col 55}F(  3,   274) = {res}   53.44
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 127.8554115{txt}{col 55}Centered R2   = {res}  0.1648
{txt}Total (uncentered) SS   = {res} 127.8554115{txt}{col 55}Uncentered R2 = {res}  0.1648
{txt}Residual SS             = {res} 106.7813104{txt}{col 55}Root MSE      = {res}   .2451

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0627195{col 26}{space 2}  .013215{col 37}{space 1}   -4.75{col 46}{space 3}0.000{col 54}{space 4}-.0887353{col 67}{space 3}-.0367037
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3042188{col 26}{space 2} .0246319{col 37}{space 1}  -12.35{col 46}{space 3}0.000{col 54}{space 4}-.3527105{col 67}{space 3} -.255727
{txt}{space 2}lnTempr_03 {c |}{col 14}{res}{space 2} .1194844{col 26}{space 2}  .084401{col 37}{space 1}    1.42{col 46}{space 3}0.158{col 54}{space 4}-.0466724{col 67}{space 3} .2856411
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  32.665
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 555.945
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  67.069
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03 lnTempr_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      275{col 27}{space 1}      275{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain lnGDP_pc_03 lnTempr_03 if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,781
{txt}Absorbing 1 HDFE group{col 51}F({res}   3{txt},{res}    274{txt}){col 67}= {res}     28.90
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7799
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7393
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2687
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       275{txt}{col 51}Root MSE{col 67}= {res}    0.9889

{txt}{ralign 78:(Std. err. adjusted for {res:275} clusters in {res:city_id})}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}     d_Grain{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 2}dsim_Grain {c |}{col 14}{res}{space 2} 1.214526{col 26}{space 2} .1483014{col 37}{space 1}    8.19{col 46}{space 3}0.000{col 54}{space 4} .9225713{col 67}{space 3} 1.506481
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.2830731{col 26}{space 2} .0889924{col 37}{space 1}   -3.18{col 46}{space 3}0.002{col 54}{space 4}-.4582688{col 67}{space 3}-.1078774
{txt}{space 2}lnTempr_03 {c |}{col 14}{res}{space 2} .6875463{col 26}{space 2} .7185229{col 37}{space 1}    0.96{col 46}{space 3}0.339{col 54}{space 4}-.7269807{col 67}{space 3} 2.102073
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} .7634519{col 26}{space 2} 1.386193{col 37}{space 1}    0.55{col 46}{space 3}0.582{col 54}{space 4}-1.965491{col 67}{space 3} 3.492395
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      275{col 27}{space 1}      275{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         *(4).增加控制期初年降水
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 lnTempr_03 lnRainfall_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   275{txt}{col 55}Number of obs = {res}    1781
{txt}{col 55}F(  4,   274) = {res}   41.25
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 127.8554115{txt}{col 55}Centered R2   = {res}  0.1676
{txt}Total (uncentered) SS   = {res} 127.8554115{txt}{col 55}Uncentered R2 = {res}  0.1676
{txt}Residual SS             = {res} 106.4313975{txt}{col 55}Root MSE      = {res}   .2448

{txt}{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}   d_lnGDP_pc{col 15}{c |} Coefficient{col 27}  std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 6}d_Grain {c |}{col 15}{res}{space 2} -.063533{col 27}{space 2} .0130349{col 38}{space 1}   -4.87{col 47}{space 3}0.000{col 55}{space 4}-.0891943{col 68}{space 3}-.0378717
{txt}{space 2}lnGDP_pc_03 {c |}{col 15}{res}{space 2}-.3087901{col 27}{space 2} .0247724{col 38}{space 1}  -12.47{col 47}{space 3}0.000{col 55}{space 4}-.3575586{col 68}{space 3}-.2600216
{txt}{space 3}lnTempr_03 {c |}{col 15}{res}{space 2} .1179894{col 27}{space 2} .0871679{col 38}{space 1}    1.35{col 47}{space 3}0.177{col 55}{space 4}-.0536145{col 68}{space 3} .2895933
{txt}lnRainfall_03 {c |}{col 15}{res}{space 2}-.1438427{col 27}{space 2} .0727532{col 38}{space 1}   -1.98{col 47}{space 3}0.049{col 55}{space 4}-.2870691{col 68}{space 3}-.0006164
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  32.619
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 565.916
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  67.265
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03 lnTempr_03 lnRainfall_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      275{col 27}{space 1}      275{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain lnGDP_pc_03 lnTempr_03 lnRainfall_03 if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,781
{txt}Absorbing 1 HDFE group{col 51}F({res}   4{txt},{res}    274{txt}){col 67}= {res}     22.00
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7821
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7417
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2758
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       275{txt}{col 51}Root MSE{col 67}= {res}    0.9844

{txt}{ralign 79:(Std. err. adjusted for {res:275} clusters in {res:city_id})}
{hline 14}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 15}{c |}{col 27}    Robust
{col 1}      d_Grain{col 15}{c |} Coefficient{col 27}  std. err.{col 39}      t{col 47}   P>|t|{col 55}     [95% con{col 68}f. interval]
{hline 14}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 3}dsim_Grain {c |}{col 15}{res}{space 2} 1.220098{col 27}{space 2} .1487653{col 38}{space 1}    8.20{col 47}{space 3}0.000{col 55}{space 4} .9272303{col 68}{space 3} 1.512967
{txt}{space 2}lnGDP_pc_03 {c |}{col 15}{res}{space 2}-.2585894{col 27}{space 2} .0753112{col 38}{space 1}   -3.43{col 47}{space 3}0.001{col 55}{space 4}-.4068515{col 68}{space 3}-.1103273
{txt}{space 3}lnTempr_03 {c |}{col 15}{res}{space 2} .6991325{col 27}{space 2} .7201974{col 38}{space 1}    0.97{col 47}{space 3}0.333{col 55}{space 4} -.718691{col 68}{space 3} 2.116956
{txt}lnRainfall_03 {c |}{col 15}{res}{space 2} .8112724{col 27}{space 2} .5810159{col 38}{space 1}    1.40{col 47}{space 3}0.164{col 55}{space 4}-.3325502{col 68}{space 3} 1.955095
{txt}{space 8}_cons {c |}{col 15}{res}{space 2}-4.908246{col 27}{space 2} 5.303948{col 38}{space 1}   -0.93{col 47}{space 3}0.356{col 55}{space 4}-15.34991{col 68}{space 3} 5.533421
{txt}{hline 14}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      275{col 27}{space 1}      275{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         *(5).增加控制期初农业GDP占比
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 12 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   274{txt}{col 55}Number of obs = {res}    1778
{txt}{col 55}F(  5,   273) = {res}   34.06
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 127.6719465{txt}{col 55}Centered R2   = {res}  0.1786
{txt}Total (uncentered) SS   = {res} 127.6719465{txt}{col 55}Uncentered R2 = {res}  0.1786
{txt}Residual SS             = {res} 104.8756827{txt}{col 55}Root MSE      = {res}   .2433

{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}     d_lnGDP_pc{col 17}{c |} Coefficient{col 29}  std. err.{col 41}      t{col 49}   P>|t|{col 57}     [95% con{col 70}f. interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}d_Grain {c |}{col 17}{res}{space 2}-.0565459{col 29}{space 2} .0122503{col 40}{space 1}   -4.62{col 49}{space 3}0.000{col 57}{space 4}-.0806629{col 70}{space 3}-.0324288
{txt}{space 4}lnGDP_pc_03 {c |}{col 17}{res}{space 2}-.3474002{col 29}{space 2} .0325233{col 40}{space 1}  -10.68{col 49}{space 3}0.000{col 57}{space 4}-.4114285{col 70}{space 3}-.2833719
{txt}{space 5}lnTempr_03 {c |}{col 17}{res}{space 2} .1089201{col 29}{space 2} .0829876{col 40}{space 1}    1.31{col 49}{space 3}0.190{col 57}{space 4}-.0544569{col 70}{space 3} .2722971
{txt}{space 2}lnRainfall_03 {c |}{col 17}{res}{space 2}-.1596811{col 29}{space 2} .0712033{col 40}{space 1}   -2.24{col 49}{space 3}0.026{col 57}{space 4}-.2998584{col 70}{space 3}-.0195039
{txt}Share_PriGDP_03 {c |}{col 17}{res}{space 2}-.2522338{col 29}{space 2} .1008721{col 40}{space 1}   -2.50{col 49}{space 3}0.013{col 57}{space 4}-.4508198{col 70}{space 3}-.0536478
{txt}{hline 16}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  33.006
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 539.474
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  61.856
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03 if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,778
{txt}Absorbing 1 HDFE group{col 51}F({res}   5{txt},{res}    273{txt}){col 67}= {res}     20.48
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7823
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7420
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2751
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       274{txt}{col 51}Root MSE{col 67}= {res}    0.9845

{txt}{ralign 81:(Std. err. adjusted for {res:274} clusters in {res:city_id})}
{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}        d_Grain{col 17}{c |} Coefficient{col 29}  std. err.{col 41}      t{col 49}   P>|t|{col 57}     [95% con{col 70}f. interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}dsim_Grain {c |}{col 17}{res}{space 2}  1.21164{col 29}{space 2} .1540573{col 40}{space 1}    7.86{col 49}{space 3}0.000{col 57}{space 4}  .908349{col 70}{space 3} 1.514932
{txt}{space 4}lnGDP_pc_03 {c |}{col 17}{res}{space 2}-.2304135{col 29}{space 2} .0972822{col 40}{space 1}   -2.37{col 49}{space 3}0.019{col 57}{space 4}-.4219321{col 70}{space 3}-.0388949
{txt}{space 5}lnTempr_03 {c |}{col 17}{res}{space 2} .7020383{col 29}{space 2} .7188776{col 40}{space 1}    0.98{col 49}{space 3}0.330{col 57}{space 4}  -.71321{col 70}{space 3} 2.117287
{txt}{space 2}lnRainfall_03 {c |}{col 17}{res}{space 2} .8132598{col 29}{space 2} .5811924{col 40}{space 1}    1.40{col 49}{space 3}0.163{col 57}{space 4}-.3309289{col 70}{space 3} 1.957448
{txt}Share_PriGDP_03 {c |}{col 17}{res}{space 2}  .175184{col 29}{space 2} .3857866{col 40}{space 1}    0.45{col 49}{space 3}0.650{col 57}{space 4}-.5843108{col 70}{space 3} .9346788
{txt}{space 10}_cons {c |}{col 17}{res}{space 2}-5.215419{col 29}{space 2} 5.278446{col 40}{space 1}   -0.99{col 49}{space 3}0.324{col 57}{space 4}-15.60705{col 70}{space 3} 5.176213
{txt}{hline 16}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         *(6).增加控制期初农业GDP占比
.         ** 2SLS
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03 Share_SecGDP_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 12 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   274{txt}{col 55}Number of obs = {res}    1776
{txt}{col 55}F(  6,   273) = {res}   29.00
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 126.5999765{txt}{col 55}Centered R2   = {res}  0.1828
{txt}Total (uncentered) SS   = {res} 126.5999765{txt}{col 55}Uncentered R2 = {res}  0.1828
{txt}Residual SS             = {res} 103.4517737{txt}{col 55}Root MSE      = {res}   .2418

{txt}{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}     d_lnGDP_pc{col 17}{c |} Coefficient{col 29}  std. err.{col 41}      t{col 49}   P>|t|{col 57}     [95% con{col 70}f. interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 8}d_Grain {c |}{col 17}{res}{space 2}-.0560587{col 29}{space 2} .0120962{col 40}{space 1}   -4.63{col 49}{space 3}0.000{col 57}{space 4}-.0798724{col 70}{space 3}-.0322451
{txt}{space 4}lnGDP_pc_03 {c |}{col 17}{res}{space 2} -.358793{col 29}{space 2} .0344636{col 40}{space 1}  -10.41{col 49}{space 3}0.000{col 57}{space 4}-.4266413{col 70}{space 3}-.2909448
{txt}{space 5}lnTempr_03 {c |}{col 17}{res}{space 2} .1045843{col 29}{space 2} .0816086{col 40}{space 1}    1.28{col 49}{space 3}0.201{col 57}{space 4}-.0560778{col 70}{space 3} .2652464
{txt}{space 2}lnRainfall_03 {c |}{col 17}{res}{space 2}-.1668414{col 29}{space 2} .0705029{col 40}{space 1}   -2.37{col 49}{space 3}0.019{col 57}{space 4}-.3056399{col 70}{space 3}-.0280429
{txt}Share_PriGDP_03 {c |}{col 17}{res}{space 2}-.1908831{col 29}{space 2} .1213694{col 40}{space 1}   -1.57{col 49}{space 3}0.117{col 57}{space 4} -.429822{col 70}{space 3} .0480558
{txt}Share_SecGDP_03 {c |}{col 17}{res}{space 2} .1201696{col 29}{space 2}  .124151{col 40}{space 1}    0.97{col 49}{space 3}0.334{col 57}{space 4}-.1242454{col 70}{space 3} .3645846
{txt}{hline 16}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  32.929
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 535.857
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  61.440
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03
{col 23}Share_SecGDP_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_2sls", title("2SLS Baseline") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) addtext(City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_2sls.txt""':seeout}

{com}.         ** First-stage
.         reghdfe d_Grain dsim_Grain lnGDP_pc_03 lnTempr_03 lnRainfall_03 Share_PriGDP_03 Share_SecGDP_03 if e(sample)==1, absorb(city_id) vce(cluster city_id)
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,776
{txt}Absorbing 1 HDFE group{col 51}F({res}   6{txt},{res}    273{txt}){col 67}= {res}     17.12
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.0000
{txt}{col 51}R-squared{col 67}= {res}    0.7824
{txt}{col 51}Adj R-squared{col 67}= {res}    0.7418
{txt}{col 51}Within R-sq.{col 67}= {res}    0.2755
{txt}{col 1}Number of clusters ({res}city_id{txt}) {col 30}= {res}       274{txt}{col 51}Root MSE{col 67}= {res}    0.9852

{txt}{ralign 81:(Std. err. adjusted for {res:274} clusters in {res:city_id})}
{hline 16}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 17}{c |}{col 29}    Robust
{col 1}        d_Grain{col 17}{c |} Coefficient{col 29}  std. err.{col 41}      t{col 49}   P>|t|{col 57}     [95% con{col 70}f. interval]
{hline 16}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}dsim_Grain {c |}{col 17}{res}{space 2} 1.209653{col 29}{space 2} .1543244{col 40}{space 1}    7.84{col 49}{space 3}0.000{col 57}{space 4} .9058354{col 70}{space 3}  1.51347
{txt}{space 4}lnGDP_pc_03 {c |}{col 17}{res}{space 2}-.2524185{col 29}{space 2} .1130538{col 40}{space 1}   -2.23{col 49}{space 3}0.026{col 57}{space 4}-.4749866{col 70}{space 3}-.0298505
{txt}{space 5}lnTempr_03 {c |}{col 17}{res}{space 2} .6955256{col 29}{space 2} .7102048{col 40}{space 1}    0.98{col 49}{space 3}0.328{col 57}{space 4}-.7026485{col 70}{space 3}   2.0937
{txt}{space 2}lnRainfall_03 {c |}{col 17}{res}{space 2} .8042519{col 29}{space 2} .5720681{col 40}{space 1}    1.41{col 49}{space 3}0.161{col 57}{space 4}-.3219738{col 70}{space 3} 1.930478
{txt}Share_PriGDP_03 {c |}{col 17}{res}{space 2} .3729828{col 29}{space 2} .4767166{col 40}{space 1}    0.78{col 49}{space 3}0.435{col 57}{space 4}-.5655251{col 70}{space 3} 1.311491
{txt}Share_SecGDP_03 {c |}{col 17}{res}{space 2} .3105752{col 29}{space 2} .4430776{col 40}{space 1}    0.70{col 49}{space 3}0.484{col 57}{space 4}-.5617079{col 70}{space 3} 1.182858
{txt}{space 10}_cons {c |}{col 17}{res}{space 2}-5.121482{col 29}{space 2} 5.188336{col 40}{space 1}   -0.99{col 49}{space 3}0.324{col 57}{space 4}-15.33572{col 70}{space 3}  5.09275
{txt}{hline 16}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         outreg2 using "$logfiles/table_1/table1_fststage", title("First Stage") append nocons dec(3) keep(dsim_Grain) excel     
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_1/table1_fststage.txt""':seeout}

{com}.         
.         
.         
. ********************************************************************************
. ******************** 表2 .粮食增产与县域经济发展：分部门影响  *******************
. ********************************************************************************
.         
.         use $working_data\county_panel.dta ,clear
{txt}
{com}. 
.                                                 ***--- 变量处理 ---***
.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         
.         foreach v of varlist Grain lnGDP_pc lnGDP_agr_pc lnGDP_nagr_pc lnGDP_ind_pc lnGDP_serv_pc{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)
(11,120 missing values generated)
(11,741 missing values generated)
(11,005 missing values generated)
(11,741 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain lnGDP_agr_pc lnGDP_nagr_pc lnGDP_ind_pc lnGDP_serv_pc{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(15,258 missing values generated)
(16,732 missing values generated)
(15,188 missing values generated)
(16,682 missing values generated)

{com}.         
.         
.         gl control lnGDP_pc_03
{txt}
{com}.         
.         est clear
{txt}
{com}.         foreach y of varlist d_lnGDP_agr_pc d_lnGDP_nagr_pc d_lnGDP_ind_pc d_lnGDP_serv_pc{c -(}
{txt}  2{com}.                 
.                 ivreghdfe `y' $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{txt}  3{com}.                 outreg2 using "$logfiles/table_2", title("Effects by Sectors") append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}  4{com}.                 
.         {c )-}
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   273{txt}{col 55}Number of obs = {res}    1776
{txt}{col 55}F(  2,   272) = {res}   31.20
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 118.9129941{txt}{col 55}Centered R2   = {res}  0.1121
{txt}Total (uncentered) SS   = {res} 118.9129941{txt}{col 55}Uncentered R2 = {res}  0.1121
{txt}Residual SS             = {res} 105.5840447{txt}{col 55}Root MSE      = {res}    .244

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnGDP_ag~c{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .0001042{col 26}{space 2} .0183705{col 37}{space 1}    0.01{col 46}{space 3}0.995{col 54}{space 4}-.0360623{col 67}{space 3} .0362708
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.2193357{col 26}{space 2} .0283612{col 37}{space 1}   -7.73{col 46}{space 3}0.000{col 54}{space 4} -.275171{col 67}{space 3}-.1635004
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  30.797
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 554.068
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  60.466
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      273{col 27}{space 1}      273{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_2.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_2.txt""':seeout}
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   273{txt}{col 55}Number of obs = {res}    1774
{txt}{col 55}F(  2,   272) = {res}  106.72
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 184.3298911{txt}{col 55}Centered R2   = {res}  0.2243
{txt}Total (uncentered) SS   = {res} 184.3298911{txt}{col 55}Uncentered R2 = {res}  0.2243
{txt}Residual SS             = {res} 142.9768749{txt}{col 55}Root MSE      = {res}   .2841

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnGDP_na~c{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0466843{col 26}{space 2} .0139115{col 37}{space 1}   -3.36{col 46}{space 3}0.001{col 54}{space 4}-.0740721{col 67}{space 3}-.0192965
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.4039522{col 26}{space 2} .0276749{col 37}{space 1}  -14.60{col 46}{space 3}0.000{col 54}{space 4}-.4584365{col 67}{space 3} -.349468
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  30.792
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 553.523
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  60.455
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      273{col 27}{space 1}      273{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_2.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_2.txt""':seeout}
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   273{txt}{col 55}Number of obs = {res}    1774
{txt}{col 55}F(  2,   272) = {res}  120.21
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 370.1713514{txt}{col 55}Centered R2   = {res}  0.1700
{txt}Total (uncentered) SS   = {res} 370.1713514{txt}{col 55}Uncentered R2 = {res}  0.1700
{txt}Residual SS             = {res} 307.2291761{txt}{col 55}Root MSE      = {res}   .4165

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnGDP_in~c{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0515703{col 26}{space 2} .0191184{col 37}{space 1}   -2.70{col 46}{space 3}0.007{col 54}{space 4}-.0892092{col 67}{space 3}-.0139315
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.4931919{col 26}{space 2} .0319056{col 37}{space 1}  -15.46{col 46}{space 3}0.000{col 54}{space 4}-.5560053{col 67}{space 3}-.4303786
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  30.792
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 553.523
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  60.455
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      273{col 27}{space 1}      273{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_2.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_2.txt""':seeout}
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   273{txt}{col 55}Number of obs = {res}    1774
{txt}{col 55}F(  2,   272) = {res}   24.94
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 156.5229329{txt}{col 55}Centered R2   = {res}  0.0907
{txt}Total (uncentered) SS   = {res} 156.5229329{txt}{col 55}Uncentered R2 = {res}  0.0907
{txt}Residual SS             = {res} 142.3304724{txt}{col 55}Root MSE      = {res}   .2835

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnGDP_se~c{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0149148{col 26}{space 2} .0226592{col 37}{space 1}   -0.66{col 46}{space 3}0.511{col 54}{space 4}-.0595244{col 67}{space 3} .0296948
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.2332369{col 26}{space 2} .0351054{col 37}{space 1}   -6.64{col 46}{space 3}0.000{col 54}{space 4}-.3023498{col 67}{space 3} -.164124
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  30.792
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 553.523
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  60.455
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      273{col 27}{space 1}      273{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_2.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_2.txt""':seeout}

{com}.                 
. 
.                 
.                 
.         
. *******************************************************************************
. ****************** 图3 .粮食增产对经济发展的各年份累积影响 *********************
. *******************************************************************************
. 
. 
.         use $working_data\county_panel.dta ,clear
{txt}
{com}.         capture mkdir "$logfiles/figure_3"
{txt}
{com}. 
.                                                 ***--- 变量处理 ---***
.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(16,346 missing values generated)

{com}.         
.         
.         * 以1998-2016逐年作为差分末期分别估计
.         /*2003年的位置由于基期=末期，
>         差分的自变量和因变量都为0，回归无意义，会出现红叉，
>         后续会将其设为0，不影响结果。*/
.         keep if year>=1998&year<=2016
{txt}(10,180 observations deleted)

{com}.         gl control lnGDP_pc_03
{txt}
{com}.         statsby _b[d_Grain] _se[d_Grain],by(year) saving("$logfiles/figure_3/est_fig3",replace): ivreghdfe d_lnGDP_pc $control (d_Grain = dsim_Grain), absorb(city_id) cluster(city_id)
{res}{txt}(running {bf:ivreghdfe} on estimation sample)
{res}{p2colset 7 16 20 2}{...}

{txt}{p2col :Command:}{res:ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain), absorb(city_id) cluster(city_id)}{p_end}
{p2colset 7 16 20 2}{...}
{p2col :_stat_1:}{res:_b[d_Grain]}{p_end}
{p2colset 7 16 20 2}{...}
{p2col :_stat_2:}{res:_se[d_Grain]}{p_end}
           By: {res}year
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_3/est_fig3.dta{rm}
not found)
{p_end}

Statsby groups
{hline 4}{c +}{hline 3} 1 {hline 3}{c +}{hline 3} 2 {hline 3}{c +}{hline 3} 3 {hline 3}{c +}{hline 3} 4 {hline 3}{c +}{hline 3} 5 
.....{err}x{txt}.............

{com}. 
.         
.         
.         * 结果输出图片
.         preserve
{txt}
{com}.         use "$logfiles/figure_3/est_fig3.dta",clear
{txt}(statsby: ivreghdfe)

{com}.         rename _stat_1 est_coef
{res}{txt}
{com}.         rename _stat_2 est_se
{res}{txt}
{com}.         * 2003年基期=末期，设为0作基准
.         replace est_coef = 0 if year==2003
{txt}(1 real change made)

{com}.         replace est_se = 0 if year==2003
{txt}(1 real change made)

{com}.         //95% CI
.         gen lower_95ci = est_coef - 1.96*est_se
{txt}
{com}.         gen upper_95ci = est_coef + 1.96*est_se
{txt}
{com}.         
.         twoway connected est_coef year,msize(small) || rline lower_95ci upper_95ci year, lpattern(dash) ||, scheme(s1mono) legend(off) yline(0,lpattern(refline)) xline(2003) xlabel(1998(1)2016,labsize(vsmall)) ylabel(-0.2(0.1)0.2)  ytitle("估计系数", margin(small) size(medium)) xtitle("年份",size(medium))
{p 0 4 2}
{txt}(note:  named style
refline not found in class
linepattern,  default attributes used)
{p_end}
{res}{txt}
{com}.         graph export "$logfiles/figure_3/figure_3.png",replace width(2400) height(1800)
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_3/figure_3.png{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/figure_3/figure_3.png{rm}
saved as
PNG
format
{p_end}

{com}.         
.         restore
{txt}
{com}.                 
.         
.         
. ******************************************************************************* 
. ****************** 表3 .粮食增产与县域经济发展：机制分析 ***********************
. *******************************************************************************
. 
. 
.         use $working_data\county_panel.dta ,clear
{txt}
{com}.         capture mkdir "$logfiles/table_3"
{txt}
{com}. 
.                                         ***--- 变量处理 ---***
.                                                 
.         gl y_mechanism lncstrct_land lncstrct_land_new lnfarmland_dcrs lnslope_cstrct_land lnnum_new_firms share_ov1k_new_firms lnavgemp_old_firms tfp_firms lntrsf_gen lntrsf_spec lnpub_expd lnpub_expd_agr
{txt}
{com}.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         foreach v of varlist Grain lnGDP_pc   $y_mechanism{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)
(5,094 missing values generated)
(4,203 missing values generated)
(1,258 missing values generated)
(3,087 missing values generated)
(5,648 missing values generated)
(6,468 missing values generated)
(11,371 missing values generated)
(11,365 missing values generated)
(20,918 missing values generated)
(11,751 missing values generated)
(11,291 missing values generated)
(12,000 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain $y_mechanism{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(5,099 missing values generated)
(22,677 missing values generated)
(20,717 missing values generated)
(26,761 missing values generated)
(10,938 missing values generated)
(12,019 missing values generated)
(32,539 missing values generated)
(30,492 missing values generated)
(51,189 missing values generated)
(41,384 missing values generated)
(41,147 missing values generated)
(52,900 missing values generated)

{com}. 
. 
.         
.                                                 ***--- 回归结果 ---***
.                                                 
.         //注: 本部分将输出三个结果文件，分别对应表3的Panel A, B, C.
.         gl control lnGDP_pc_03
{txt}
{com}.         
.         * Panel A. 土地配置
.         * (1). 建设用地面积
.         
.         ivreghdfe d_lncstrct_land $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 12 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   306{txt}{col 55}Number of obs = {res}    1943
{txt}{col 55}F(  2,   305) = {res}   16.20
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 99.12730057{txt}{col 55}Centered R2   = {res} -0.0063
{txt}Total (uncentered) SS   = {res} 99.12730057{txt}{col 55}Uncentered R2 = {res} -0.0063
{txt}Residual SS             = {res} 99.75182877{txt}{col 55}Root MSE      = {res}   .2268

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lncstrct~d{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0500629{col 26}{space 2}  .010391{col 37}{space 1}   -4.82{col 46}{space 3}0.000{col 54}{space 4}  -.07051{col 67}{space 3}-.0296158
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .0166278{col 26}{space 2} .0195966{col 37}{space 1}    0.85{col 46}{space 3}0.397{col 54}{space 4}-.0219338{col 67}{space 3} .0551895
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  34.873
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 628.647
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  67.508
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      306{col 27}{space 1}      306{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_A", title("Mechanism_A: Land Allocation") ctitle(Construction Land Area) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.txt""':seeout}

{com}. 
.         
.         * (2).新增建设用地面积
.         
.         ivreghdfe d_lncstrct_land_new $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 15 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   297{txt}{col 55}Number of obs = {res}    1893
{txt}{col 55}F(  2,   296) = {res}    7.25
{txt}{col 55}Prob > F      = {res}  0.0008
{txt}Total (centered) SS     = {res} 999.2460921{txt}{col 55}Centered R2   = {res} -0.0020
{txt}Total (uncentered) SS   = {res} 999.2460921{txt}{col 55}Uncentered R2 = {res} -0.0020
{txt}Residual SS             = {res} 1001.242866{txt}{col 55}Root MSE      = {res}   .7278

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lncstrct~w{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0849957{col 26}{space 2} .0233463{col 37}{space 1}   -3.64{col 46}{space 3}0.000{col 54}{space 4}-.1309414{col 67}{space 3}  -.03905
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.0869046{col 26}{space 2}  .048399{col 37}{space 1}   -1.80{col 46}{space 3}0.074{col 54}{space 4}-.1821544{col 67}{space 3} .0083453
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  34.609
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 610.820
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  66.994
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      297{col 27}{space 1}      297{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_A", title("Mechanism_A: Land Allocation") ctitle(Increased Construction Land Area) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.txt""':seeout}

{com}. 
.         
.         * (3).被转化的耕地面积
.         
.         ivreghdfe d_lnfarmland_dcrs $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 12 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   310{txt}{col 55}Number of obs = {res}    2004
{txt}{col 55}F(  2,   309) = {res}    3.39
{txt}{col 55}Prob > F      = {res}  0.0349
{txt}Total (centered) SS     = {res} 473.3149807{txt}{col 55}Centered R2   = {res} -0.0056
{txt}Total (uncentered) SS   = {res} 473.3149807{txt}{col 55}Uncentered R2 = {res} -0.0056
{txt}Residual SS             = {res} 475.9678859{txt}{col 55}Root MSE      = {res}   .4877

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnfarmla~s{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} -.058162{col 26}{space 2} .0228502{col 37}{space 1}   -2.55{col 46}{space 3}0.011{col 54}{space 4}-.1031237{col 67}{space 3}-.0132003
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.0491587{col 26}{space 2} .0327062{col 37}{space 1}   -1.50{col 46}{space 3}0.134{col 54}{space 4}-.1135137{col 67}{space 3} .0151963
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  34.915
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 649.330
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  67.539
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      310{col 27}{space 1}      310{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_A", title("Mechanism_A: Land Allocation") ctitle(Decreased Farmland Area) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.txt""':seeout}

{com}. 
.         
.         * (4).建设用地平均坡度
.         
.         ivreghdfe d_lnslope_cstrct_land $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   305{txt}{col 55}Number of obs = {res}    1939
{txt}{col 55}F(  2,   304) = {res}   82.38
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 1684.134415{txt}{col 55}Centered R2   = {res}  0.1431
{txt}Total (uncentered) SS   = {res} 1684.134415{txt}{col 55}Uncentered R2 = {res}  0.1431
{txt}Residual SS             = {res} 1443.163681{txt}{col 55}Root MSE      = {res}   .8634

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnslope_~d{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .0900374{col 26}{space 2} .0473679{col 37}{space 1}    1.90{col 46}{space 3}0.058{col 54}{space 4} -.003173{col 67}{space 3} .1832478
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .9231557{col 26}{space 2} .0775293{col 37}{space 1}   11.91{col 46}{space 3}0.000{col 54}{space 4} .7705936{col 67}{space 3} 1.075718
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  34.874
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 627.383
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  67.507
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      305{col 27}{space 1}      305{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.                 
.         outreg2 using "$logfiles/table_3/table_3_A", title("Mechanism_A: Land Allocation") ctitle(Slope of Construction Land) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_A.txt""':seeout}

{com}.         
.         
.         
.         
.         * Panel B. 企业表现
.         * (1).新注册企业数量
.         
.         ivreghdfe d_lnnum_new_firms $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 14 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   300{txt}{col 55}Number of obs = {res}    1856
{txt}{col 55}F(  2,   299) = {res}    6.06
{txt}{col 55}Prob > F      = {res}  0.0026
{txt}Total (centered) SS     = {res} 627.2937662{txt}{col 55}Centered R2   = {res}  0.0101
{txt}Total (uncentered) SS   = {res} 627.2937662{txt}{col 55}Uncentered R2 = {res}  0.0101
{txt}Residual SS             = {res} 620.9438444{txt}{col 55}Root MSE      = {res}   .5789

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnnum_ne~s{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .0105741{col 26}{space 2} .0236215{col 37}{space 1}    0.45{col 46}{space 3}0.655{col 54}{space 4}-.0359114{col 67}{space 3} .0570596
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.1570941{col 26}{space 2} .0474015{col 37}{space 1}   -3.31{col 46}{space 3}0.001{col 54}{space 4} -.250377{col 67}{space 3}-.0638112
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  33.451
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 604.684
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  65.323
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      300{col 27}{space 1}      300{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_B", title("Mechanism_B: Firm Performance") ctitle(Number of New Registration) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.txt""':seeout}

{com}.         
.         
.         
.         * (2).新注册企业中大企业占比(注册资本>1000万元)
.         
.         ivreghdfe d_share_ov1k_new_firms $control (d_Grain = dsim_Grain) if year==2016, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   300{txt}{col 55}Number of obs = {res}    1833
{txt}{col 55}F(  2,   299) = {res}    7.59
{txt}{col 55}Prob > F      = {res}  0.0006
{txt}Total (centered) SS     = {res} 22.80771631{txt}{col 55}Centered R2   = {res} -0.0008
{txt}Total (uncentered) SS   = {res} 22.80771631{txt}{col 55}Uncentered R2 = {res} -0.0008
{txt}Residual SS             = {res} 22.82501868{txt}{col 55}Root MSE      = {res}   .1117

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_share_ov~s{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0148481{col 26}{space 2} .0056986{col 37}{space 1}   -2.61{col 46}{space 3}0.010{col 54}{space 4}-.0260625{col 67}{space 3}-.0036336
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.0293332{col 26}{space 2} .0083494{col 37}{space 1}   -3.51{col 46}{space 3}0.001{col 54}{space 4}-.0457643{col 67}{space 3}-.0129021
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  31.794
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 570.973
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  61.338
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      300{col 27}{space 1}      300{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_B", title("Mechanism_B: Firm Performance") ctitle(Share of Large Firms) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.txt""':seeout}

{com}.         
.         
.         * (3).在位企业平均就业人数
.         //受限于数据可得性，工企相关结果差分末期为2013
.         ivreghdfe d_lnavgemp_old_firms $control (d_Grain = dsim_Grain) if year==2013, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 20 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   270{txt}{col 55}Number of obs = {res}    1582
{txt}{col 55}F(  2,   269) = {res}    4.25
{txt}{col 55}Prob > F      = {res}  0.0152
{txt}Total (centered) SS     = {res} 297.3443335{txt}{col 55}Centered R2   = {res} -0.0083
{txt}Total (uncentered) SS   = {res} 297.3443335{txt}{col 55}Uncentered R2 = {res} -0.0083
{txt}Residual SS             = {res} 299.7991607{txt}{col 55}Root MSE      = {res}   .4357

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnavgemp~s{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} -.056573{col 26}{space 2} .0198141{col 37}{space 1}   -2.86{col 46}{space 3}0.005{col 54}{space 4}-.0955835{col 67}{space 3}-.0175626
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}  -.06482{col 26}{space 2} .0392086{col 37}{space 1}   -1.65{col 46}{space 3}0.099{col 54}{space 4}-.1420147{col 67}{space 3} .0123747
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  27.121
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 616.839
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  76.235
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      270{col 27}{space 1}      270{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_B", title("Mechanism_B: Firm Performance") ctitle(Employment of Incumbent Firms) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.txt""':seeout}

{com}.         
.         
.         
.         * (4).工业企业平均全要素生产率
.         //受限于数据可得性，工企相关结果差分末期为2013
.         ivreghdfe d_tfp_firms $control (d_Grain = dsim_Grain) if year==2013, absorb(city_id) cluster(city_id)  
{res}{txt}(dropped 22 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   271{txt}{col 55}Number of obs = {res}    1618
{txt}{col 55}F(  2,   270) = {res}    9.11
{txt}{col 55}Prob > F      = {res}  0.0001
{txt}Total (centered) SS     = {res} 1760.003036{txt}{col 55}Centered R2   = {res}  0.0149
{txt}Total (uncentered) SS   = {res} 1760.003036{txt}{col 55}Uncentered R2 = {res}  0.0149
{txt}Residual SS             = {res} 1733.824489{txt}{col 55}Root MSE      = {res}   1.036

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1} d_tfp_firms{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0684412{col 26}{space 2}  .040607{col 37}{space 1}   -1.69{col 46}{space 3}0.093{col 54}{space 4}-.1483877{col 67}{space 3} .0115053
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .2887225{col 26}{space 2} .0987864{col 37}{space 1}    2.92{col 46}{space 3}0.004{col 54}{space 4}  .094233{col 67}{space 3} .4832121
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  27.715
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 632.298
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  77.390
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      271{col 27}{space 1}      271{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_B", title("Mechanism_B: Firm Performance") ctitle(TFP) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_B.txt""':seeout}

{com}.         
.         
.         
.         
.         
.         * Panel C.财政资源与公共支出
.         //受限于数据可得性，农业支出差分末期为2006，其余财政相关结果差分末期为2007
.         
.         * (1).一般性转移支付收入
.         
.         ivreghdfe d_lntrsf_gen $control (d_Grain = dsim_Grain) if year==2007, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 24 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   246{txt}{col 55}Number of obs = {res}    1408
{txt}{col 55}F(  2,   245) = {res}    1.03
{txt}{col 55}Prob > F      = {res}  0.3572
{txt}Total (centered) SS     = {res}  640.027457{txt}{col 55}Centered R2   = {res}  0.0077
{txt}Total (uncentered) SS   = {res}  640.027457{txt}{col 55}Uncentered R2 = {res}  0.0077
{txt}Residual SS             = {res} 635.0683112{txt}{col 55}Root MSE      = {res}   .6723

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lntrsf_gen{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .0184016{col 26}{space 2} .0690235{col 37}{space 1}    0.27{col 46}{space 3}0.790{col 54}{space 4}-.1175534{col 67}{space 3} .1543567
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .1524383{col 26}{space 2} .1060214{col 37}{space 1}    1.44{col 46}{space 3}0.152{col 54}{space 4}-.0563913{col 67}{space 3}  .361268
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  21.169
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 293.524
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  33.873
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      246{col 27}{space 1}      246{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_C", title("Mechanism_C: Fiscal Capacity and Public Expenditures") ctitle(General Transfers) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.txt""':seeout}

{com}.         
.         
.         * (2).专项转移支付收入
.         
.         ivreghdfe d_lntrsf_spec $control (d_Grain = dsim_Grain) if year==2007, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 13 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   274{txt}{col 55}Number of obs = {res}    1641
{txt}{col 55}F(  2,   273) = {res}    7.99
{txt}{col 55}Prob > F      = {res}  0.0004
{txt}Total (centered) SS     = {res} 118.9618298{txt}{col 55}Centered R2   = {res} -0.0801
{txt}Total (uncentered) SS   = {res} 118.9618298{txt}{col 55}Uncentered R2 = {res} -0.0801
{txt}Residual SS             = {res} 128.4954851{txt}{col 55}Root MSE      = {res}   .2801

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lntrsf_s~c{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .1625064{col 26}{space 2} .0416735{col 37}{space 1}    3.90{col 46}{space 3}0.000{col 54}{space 4} .0804641{col 67}{space 3} .2445488
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .0375488{col 26}{space 2}  .026872{col 37}{space 1}    1.40{col 46}{space 3}0.163{col 54}{space 4}-.0153539{col 67}{space 3} .0904514
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  26.208
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 358.669
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  43.766
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_C", title("Mechanism_C: Fiscal Capacity and Public Expenditures") ctitle(Special Transfers) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.txt""':seeout}

{com}. 
.         
.         * (3). 公共预算支出
.         
.         ivreghdfe d_lnpub_expd $control (d_Grain = dsim_Grain) if year==2007, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 15 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   274{txt}{col 55}Number of obs = {res}    1642
{txt}{col 55}F(  2,   273) = {res}    0.91
{txt}{col 55}Prob > F      = {res}  0.4035
{txt}Total (centered) SS     = {res} 25.83304735{txt}{col 55}Centered R2   = {res}  0.0036
{txt}Total (uncentered) SS   = {res} 25.83304735{txt}{col 55}Uncentered R2 = {res}  0.0036
{txt}Residual SS             = {res} 25.74042967{txt}{col 55}Root MSE      = {res}   .1253

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnpub_expd{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .0193197{col 26}{space 2}  .014353{col 37}{space 1}    1.35{col 46}{space 3}0.179{col 54}{space 4}-.0089368{col 67}{space 3} .0475763
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2} .0046234{col 26}{space 2} .0136657{col 37}{space 1}    0.34{col 46}{space 3}0.735{col 54}{space 4}-.0222802{col 67}{space 3} .0315271
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  26.238
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 358.697
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  43.807
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      274{col 27}{space 1}      274{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_C", title("Mechanism_C: Fiscal Capacity and Public Expenditures") ctitle(Public Expenditures) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.txt""':seeout}

{com}.         
.         
.         * (4). 农业相关支出
.         
.         ivreghdfe d_lnpub_expd_agr $control (d_Grain = dsim_Grain) if year==2006, absorb(city_id) cluster(city_id)
{res}{txt}(dropped 15 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   281{txt}{col 55}Number of obs = {res}    1670
{txt}{col 55}F(  2,   280) = {res}    8.18
{txt}{col 55}Prob > F      = {res}  0.0004
{txt}Total (centered) SS     = {res} 156.9978067{txt}{col 55}Centered R2   = {res} -0.0167
{txt}Total (uncentered) SS   = {res} 156.9978067{txt}{col 55}Uncentered R2 = {res} -0.0167
{txt}Residual SS             = {res} 159.6217644{txt}{col 55}Root MSE      = {res}   .3094

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}d_lnpub_ex~r{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .1065732{col 26}{space 2} .0370426{col 37}{space 1}    2.88{col 46}{space 3}0.004{col 54}{space 4} .0336559{col 67}{space 3} .1794906
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.0411791{col 26}{space 2} .0237114{col 37}{space 1}   -1.74{col 46}{space 3}0.084{col 54}{space 4}-.0878542{col 67}{space 3} .0054961
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  27.086
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 405.610
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  47.426
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      281{col 27}{space 1}      281{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         
.         outreg2 using "$logfiles/table_3/table_3_C", title("Mechanism_C: Fiscal Capacity and Public Expenditures") ctitle(Public Agricultural Expenditures) append nocons nor2 dec(3) excel addstat(K-P Wald F, e(rkf)) adec(3) keep(d_Grain) addtext(Controls,Y,City FE,Y)
{txt}{browse `"E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.xml"'}
{browse `"E:\2024-00768_数据"' :dir}{com} : {txt}{stata `"seeout using "E:\2024-00768_数据\2024-00768+日志文件/table_3/table_3_C.txt""':seeout}

{com}.         
.         
.         
.         
. ********************************************************************************
. ************************ 表4 .粮食增产的经济机会成本估算 ************************
. ********************************************************************************
.         
.         
.         
.                                                 *1.用县样本估算
.         
.         use $working_data/county_panel.dta ,clear
{txt}
{com}.         capture mkdir $logfiles/table_4
{txt}
{com}.         
.         
.         
.         ** (1).获取基准估计系数，以及分产区的估计系数
.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(16,346 missing values generated)

{com}. 
.         * 基准估计 (保存系数保留小数点后三位，不会影响结论)
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   276{txt}{col 55}Number of obs = {res}    1789
{txt}{col 55}F(  2,   275) = {res}   81.69
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 129.3586903{txt}{col 55}Centered R2   = {res}  0.1589
{txt}Total (uncentered) SS   = {res} 129.3586903{txt}{col 55}Uncentered R2 = {res}  0.1589
{txt}Residual SS             = {res} 108.8029909{txt}{col 55}Root MSE      = {res}   .2468

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0591131{col 26}{space 2}  .012991{col 37}{space 1}   -4.55{col 46}{space 3}0.000{col 54}{space 4}-.0846876{col 67}{space 3}-.0335386
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3047582{col 26}{space 2} .0243734{col 37}{space 1}  -12.50{col 46}{space 3}0.000{col 54}{space 4}-.3527404{col 67}{space 3} -.256776
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  31.800
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 566.057
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  62.566
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         gen coef_base = round(_b[d_Grain],0.001)
{txt}
{com}.         gl ebase = round(_b[d_Grain],0.001)
{txt}
{com}.         
.         * 分产区
.         gen coef_cq = .
{txt}(61,237 missing values generated)

{com}.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_zcq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 4 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   163{txt}{col 55}Number of obs = {res}     998
{txt}{col 55}F(  2,   162) = {res}   41.51
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 66.77658142{txt}{col 55}Centered R2   = {res}  0.1117
{txt}Total (uncentered) SS   = {res} 66.77658142{txt}{col 55}Uncentered R2 = {res}  0.1117
{txt}Residual SS             = {res} 59.32095905{txt}{col 55}Root MSE      = {res}   .2442

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0622801{col 26}{space 2} .0127849{col 37}{space 1}   -4.87{col 46}{space 3}0.000{col 54}{space 4}-.0875266{col 67}{space 3}-.0370336
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3224114{col 26}{space 2} .0395332{col 37}{space 1}   -8.16{col 46}{space 3}0.000{col 54}{space 4}-.4004783{col 67}{space 3}-.2443446
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  26.923
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 361.974
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  55.911
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      163{col 27}{space 1}      163{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_zcq==1
{txt}(33,009 real changes made)

{com}.         gl ezcq = round(_b[d_Grain],0.001)
{txt}
{com}.         
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_zxq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 2 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}    18{txt}{col 55}Number of obs = {res}     115
{txt}{col 55}F(  2,    17) = {res}    6.04
{txt}{col 55}Prob > F      = {res}  0.0104
{txt}Total (centered) SS     = {res} 3.350646031{txt}{col 55}Centered R2   = {res}  0.1284
{txt}Total (uncentered) SS   = {res} 3.350646031{txt}{col 55}Uncentered R2 = {res}  0.1284
{txt}Residual SS             = {res} 2.920565299{txt}{col 55}Root MSE      = {res}   .1615

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .2940493{col 26}{space 2} .4311897{col 37}{space 1}    0.68{col 46}{space 3}0.504{col 54}{space 4}-.6156816{col 67}{space 3}  1.20378
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.1110314{col 26}{space 2} .1040557{col 37}{space 1}   -1.07{col 46}{space 3}0.301{col 54}{space 4}-.3305699{col 67}{space 3}  .108507
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}   1.132
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.2874
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71}   5.768
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}   1.198
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}       18{col 27}{space 1}       18{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_zxq==1
{txt}(7,033 real changes made)

{com}.         gl ezxq = round(_b[d_Grain],0.001)
{txt}
{com}. 
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_phq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 5 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}    95{txt}{col 55}Number of obs = {res}     676
{txt}{col 55}F(  2,    94) = {res}   43.91
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 59.23146288{txt}{col 55}Centered R2   = {res}  0.2188
{txt}Total (uncentered) SS   = {res} 59.23146288{txt}{col 55}Uncentered R2 = {res}  0.2188
{txt}Residual SS             = {res} 46.27268919{txt}{col 55}Root MSE      = {res}   .2622

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0298051{col 26}{space 2} .0669141{col 37}{space 1}   -0.45{col 46}{space 3}0.657{col 54}{space 4}-.1626645{col 67}{space 3} .1030544
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.2997192{col 26}{space 2} .0355648{col 37}{space 1}   -8.43{col 46}{space 3}0.000{col 54}{space 4}-.3703339{col 67}{space 3}-.2291044
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  18.611
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71}  65.477
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  21.499
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}       95{col 27}{space 1}       95{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_phq==1
{txt}(20,845 real changes made)

{com}.         gl ephq = round(_b[d_Grain],0.001)
{txt}
{com}.         
.         
.         ** (2).计算增产成本
.         
.         * 计算样本期间各县增产量，平均人口、人均GDP以及GDP
.         gen is_yr2016 = 1 if year==2016
{txt}(58,692 missing values generated)

{com}.         foreach v of varlist GDP_pc pop{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 bysort county_id (year): egen `v'_16 = mean(`v'*is_yr2016)
{txt}  4{com}.                 
.         {c )-}
{txt}(11,649 missing values generated)
(13,146 missing values generated)
(7,695 missing values generated)
(9,192 missing values generated)

{com}.         
.         
.         bysort county_id (year): egen Grain_16 = mean(Grain*is_yr2016)
{txt}(7,511 missing values generated)

{com}.         
.         
.         gen dgrain_0316 = Grain_16 - Grain_03
{txt}(9,006 missing values generated)

{com}.         gen mgdppc_0316 = (GDP_pc_03 + GDP_pc_16)/2
{txt}(17,123 missing values generated)

{com}.         gen mpop_0316 = (pop_03 + pop_16)/2
{txt}(13,399 missing values generated)

{com}.         gen mgdp_0316 = mgdppc_0316*mpop_0316
{txt}(17,123 missing values generated)

{com}.         
. 
.         drop if dgrain_0316==.|mgdppc_0316==.|mpop_0316==.
{txt}(18,227 observations deleted)

{com}.         keep if year==2016
{txt}(41,140 observations deleted)

{com}.         
.         
.         
.         * A.按照基准系数估计成本
.         * i.各县增产成本(GDP)=产量变化*估计系数*人均GDP*人口 (见正文p12)
.         gen gdp_cost = dgrain_0316*coef_base*mgdppc_0316*mpop_0316
{txt}
{com}.         //转换单位：万元-->亿元
.         replace gdp_cost = gdp_cost/10000 
{txt}(1,870 real changes made)

{com}.         * ii. 样本县增产成本加总
.         bysort year: egen ttl_gdp_cost = total(gdp_cost)
{txt}
{com}.                 
.         
.         * iii. 人均成本=产量变化*估计系数*人均GDP
.         gen gdppc_cost = dgrain_0316*coef_base*mgdppc_0316
{txt}
{com}.         
.         * iv. 按人口加权平均得到全国人均成本
.         * 计算样本总人口
.         egen na_mpop_0316 = total(mpop_0316)
{txt}
{com}.         
.         egen na_gdppc_cost = total(gdppc_cost*mpop_0316/na_mpop_0316)
{txt}
{com}. 
.         
.         * B.产销区按照不同系数估计成本
.         * i.各县增产成本(GDP)=产量变化*估计系数*人均GDP*人口 (见正文p12)
.         gen gdp_cost_cq = dgrain_0316*coef_cq*mgdppc_0316*mpop_0316
{txt}
{com}.         //转换单位：亿元
.         replace gdp_cost_cq = gdp_cost_cq/10000
{txt}(1,870 real changes made)

{com}.         * ii. 样本县增产成本加总
.         bysort year: egen ttl_gdp_cost_cq = total(gdp_cost_cq)
{txt}
{com}.         
.         
.         * iii. 人均成本=产量变化*估计系数*人均GDP
.         gen gdppc_cost_cq = dgrain_0316*coef_cq*mgdppc_0316
{txt}
{com}.         * iv. 按人口加权平均得到全国人均成本
.         * 计算样本总人口
.         bysort year: egen na_gdppc_cost_cq = total(gdppc_cost_cq*mpop_0316/na_mpop_0316)
{txt}
{com}.         
.         
.         
.         ** (3).输出县样本结果
.         
.         *A.按基准估计：总量
.         preserve
{txt}
{com}.         * 避免同一个变量在collapse生成不同统计量时冲突
.         gen gdp_cost_formedian = gdp_cost
{txt}
{com}.         
.         collapse (mean) mean_cost = gdp_cost (median) median_cost = gdp_cost_formedian (mean) total_cost = ttl_gdp_cost
{res}{txt}
{com}.         gen row = "A1"
{txt}
{com}.         save $logfiles/table_4/coun_cost_a1.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_a1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_a1.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}. 
.         
.         *A.按基准估计：人均
.         preserve
{txt}
{com}.         * 人口取整，便于作为权重
.     gen mpop_0316_int = round(mpop_0316)
{txt}
{com}.         collapse (mean) mean_cost = na_gdppc_cost (median) median_cost = gdppc_cost [fweight = mpop_0316_int]
{res}{txt}
{com}.         gen row = "A2"
{txt}
{com}.         save $logfiles/table_4/coun_cost_a2.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_a2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_a2.dta{rm}
saved
{p_end}

{com}.         
.         restore
{txt}
{com}.         
.         
.         
.         *B.产销区不同系数估计：总量
.         preserve
{txt}
{com}.         * 避免同一个变量在collapse生成不同统计量时冲突
.         gen gdp_cost_formedian_cq = gdp_cost_cq
{txt}
{com}.         collapse (mean) mean_cost = gdp_cost_cq (median) median_cost = gdp_cost_formedian_cq (mean) total_cost = ttl_gdp_cost_cq
{res}{txt}
{com}.         gen row = "B1"
{txt}
{com}.         save $logfiles/table_4/coun_cost_b1.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_b1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_b1.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.         
.         *B.产销区不同系数估计：人均
.         preserve
{txt}
{com}.         * 人口取整，便于作为权重
.     gen mpop_0316_int = round(mpop_0316)
{txt}
{com}.         collapse (mean) mean_cost = na_gdppc_cost_cq (median) median_cost = gdppc_cost_cq [fweight = mpop_0316_int]
{res}{txt}
{com}.         gen row = "B2"
{txt}
{com}.         save $logfiles/table_4/coun_cost_b2.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_b2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost_b2.dta{rm}
saved
{p_end}

{com}.         
.         restore
{txt}
{com}.         
.         
.         
.         *结果合并：
.         use $logfiles/table_4/coun_cost_a1.dta,clear
{txt}
{com}.         append using $logfiles/table_4/coun_cost_a2.dta
{txt}
{com}.         append using $logfiles/table_4/coun_cost_b1.dta
{txt}
{com}.         append using $logfiles/table_4/coun_cost_b2.dta
{txt}
{com}.         save $logfiles/table_4/coun_cost.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/coun_cost.dta{rm}
saved
{p_end}

{com}. 
.         
.         
.         
.         
.                                                         *2. 用省样本估算
.         
.         use $working_data/province_data.dta,clear
{txt}
{com}. 
. 
.         ** (1).获取基准估计系数，以及分产区的估计系数
.         
.         * 获取县样本的估计系数
.         gen coef_base = $ebase
{txt}
{com}.         gen coef_cq = $ezcq if is_zcq==1
{txt}(594 missing values generated)

{com}.         replace coef_cq = $ezxq if is_zxq==1
{txt}(231 real changes made)

{com}.         replace coef_cq = $ephq if is_phq==1
{txt}(363 real changes made)

{com}.         
. 
.         ** (2).计算增产成本
.         * 样本期间平均GDP、总人口和县均人口和粮食产量变化
.         gen is_yr2003 = 1 if year==2003
{txt}(992 missing values generated)

{com}.         gen is_yr2016 = 1 if year==2016
{txt}(992 missing values generated)

{com}.         
.         foreach v of varlist gdppc mpop_per_county grain pop{c -(}
{txt}  2{com}.                 
.                 bysort province_name: egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 bysort province_name: egen `v'_16 = mean(`v'*is_yr2016)
{txt}  4{com}.                 
.         {c )-}
{txt}
{com}.         
.         * 增产(单位转换：万吨->十万吨)
.         gen dgrain_0316 = (grain_16 - grain_03)/10
{txt}
{com}.         bysort province_name: gen mgdppc_0316 = (gdppc_03 + gdppc_16)/2
{txt}
{com}.         bysort province_name: gen mpop_per_county_0316 = (mpop_per_county_03 + mpop_per_county_16)/2
{txt}
{com}.         bysort province_name: gen mpop_0316 = (pop_03 + pop_16)/2
{txt}
{com}.         
.         drop if dgrain_0316==.|mgdppc_0316==.|mpop_0316==.
{txt}(0 observations deleted)

{com}.         keep if year==2016
{txt}(992 observations deleted)

{com}.         
.         
.         * A.按照基准系数估计成本
.         * i.各省增产成本(GDP)=产量变化*估计系数*人均GDP*县平均人口 (见正文p12)
.         gen gdp_cost = (-1)*dgrain_0316*0.059*mgdppc_0316*mpop_per_county_0316
{txt}
{com}.         //单位转换为亿元
.         replace gdp_cost = gdp_cost/10000
{txt}(31 real changes made)

{com}.         * ii.各省成本加总
.         egen ttl_gdp_cost = total(gdp_cost)
{txt}
{com}.                 
.         
.         * iii.各省人均成本=总成本/总人口数，再将单位转换为元/人
.         gen gdppc_cost_0316 = (gdp_cost/mpop_0316)*10000
{txt}
{com}.         * iv. 按人口加权平均得到全国人均成本
.         * 计算样本总人口
.         egen na_mpop_0316 = total(mpop_0316)
{txt}
{com}.         egen na_gdppc_cost = total(gdppc_cost_0316*mpop_0316/na_mpop_0316)
{txt}
{com}.         
.                 
.         
.         * B.按照产销区不同系数估计成本
.         * i.各省增产成本(GDP)=产量变化*估计系数*人均GDP*县平均人口 (见正文p12)
.         gen gdp_cost_cq = dgrain_0316*coef_cq*mgdppc_0316*mpop_per_county_0316
{txt}
{com}.         //单位转换为亿元
.         replace gdp_cost_cq = gdp_cost_cq/10000
{txt}(31 real changes made)

{com}.         * ii.各省成本加总
.         bysort year: egen ttl_gdp_cost_cq = total(gdp_cost_cq)
{txt}
{com}.         
.         
.         * iii.各省人均成本=总成本/总人口数，再将单位转换为元/人
.         gen gdppc_cost_cq = (gdp_cost_cq/mpop_0316)*10000
{txt}
{com}.         * iv. 按人口加权平均得到全国人均成本
.         * 计算样本总人口
.         egen na_gdppc_cost_cq = total(gdppc_cost_cq*mpop_0316/na_mpop_0316)
{txt}
{com}.         
.         * 将总人口数保存到全局暂元中以便后续计算人均转移支付
.         gl ttlpop = na_mpop_0316[1]
{txt}
{com}.         
.         
.         ** (3).输出省样本结果
.         *A.按基准估计：总量
.         preserve
{txt}
{com}.         collapse (mean) cost_by_prov = ttl_gdp_cost
{res}{txt}
{com}.         gen row = "A1"
{txt}
{com}.         save $logfiles/table_4/prov_cost_a1.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_a1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_a1.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.         
.         *A.按基准估计：人均
.         preserve
{txt}
{com}.         collapse (mean) cost_by_prov = na_gdppc_cost
{res}{txt}
{com}.         gen row = "A2"
{txt}
{com}.         save $logfiles/table_4/prov_cost_a2.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_a2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_a2.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.                 
.         *B.产销区不同系数估计：总量
.         preserve
{txt}
{com}.         collapse (mean) cost_by_prov = ttl_gdp_cost_cq
{res}{txt}
{com}.         gen row = "B1"
{txt}
{com}.         save $logfiles/table_4/prov_cost_b1.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_b1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_b1.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.         
.         *B.按基准估计：人均
.         preserve
{txt}
{com}.         collapse (mean) cost_by_prov = na_gdppc_cost_cq
{res}{txt}
{com}.         gen row = "B2"
{txt}
{com}.         save $logfiles/table_4/prov_cost_b2.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_b2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost_b2.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.                 
.                 
.         *结果合并：
.         use $logfiles/table_4/prov_cost_a1.dta,clear
{txt}
{com}.         append using $logfiles/table_4/prov_cost_a2.dta
{txt}
{com}.         append using $logfiles/table_4/prov_cost_b1.dta
{txt}
{com}.         append using $logfiles/table_4/prov_cost_b2.dta
{txt}
{com}.         save $logfiles/table_4/prov_cost.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_4/prov_cost.dta{rm}
saved
{p_end}

{com}.                 
.         
.         
.                                                         *3. 汇总结果
.         
.         use $logfiles/table_4/coun_cost.dta ,clear
{txt}
{com}.         merge 1:1 row using $logfiles/table_4/prov_cost.dta
{res}
{txt}{col 5}Result{col 33}Number of obs
{col 5}{hline 41}
{col 5}Not matched{col 30}{res}               0
{txt}{col 5}Matched{col 30}{res}               4{txt}  (_merge==3)
{col 5}{hline 41}

{com}.         drop _merge
{txt}
{com}.         
.         
.         * (1).已实现的转移支付
.         ** 总量= 13215.05亿元 (见附表A4)
.         gen transfer = 13215.05
{txt}
{com}.         ** 总人口数(之前已经保存到ttlpop暂元中)
.         gen pop = $ttlpop
{txt}
{com}.         ** 人均：除以，并调整单位为元/人
.         replace transfer = (transfer/pop)*10000 if row=="A2"|row=="B2"  
{txt}(2 real changes made)

{com}.         
.         
.         * (2).真实总成本
.         ** 总量 = 还未覆盖的成本(省样本) + 转移支付
.         gen realcost = cost_by_prov - transfer
{txt}
{com}.         ** 转移支付占总成本百分比(因为总成本用负值表示，转移支付用正值，这里求百分比时取绝对值)
.         gen transfer_shr = abs((transfer/realcost)*100)
{txt}
{com}.         
.         drop pop
{txt}
{com}.         
.         
.         ** 输出表格
.         gen rownames = "A.按基准估计：总量" if row=="A1"
{txt}(3 missing values generated)

{com}.         replace rownames = "A.按基准估计：人均" if row=="A2"
{txt}(1 real change made)

{com}.         replace rownames = "B.分产销区异质性：总量" if row=="B1"
{txt}variable {bf}{res}rownames{sf}{txt} was {bf}{res}str26{sf}{txt} now {bf}{res}str32{sf}
{txt}(1 real change made)

{com}.         replace rownames = "B.分产销区异质性：人均" if row=="B2"
{txt}(1 real change made)

{com}.         
.         //保留两位小数
.         foreach v of varlist *cost cost_* transfer*{c -(}
{txt}  2{com}.                 
.                 gen `v'_2dig = string(round(`v',0.01),"%20.2f") 
{txt}  3{com}.         {c )-}
{txt}
{com}.         
.         keep row rownames *_2dig 
{txt}
{com}.         renvarlab *_2dig,subst(_2dig )
{txt}
{com}.         
.         label variable mean_cost "平均值"
{txt}
{com}.         label variable median_cost "中位数"
{txt}
{com}.         label variable total_cost "总和"
{txt}
{com}.         label variable cost_by_prov "省样本估算"
{txt}
{com}.         label variable transfer "已实现的转移支付"
{txt}
{com}.         label variable transfer_shr "转移支付占比(%)"
{txt}
{com}.         label variable realcost "真实总成本"
{txt}
{com}.         
.         order row,first
{txt}
{com}.         order row rownames mean_cost median_cost total_cost cost_by_prov transfer transfer_shr realcost
{txt}
{com}.         
.         
.         export excel using "$logfiles/table_4/table_4.xls" , firstrow(varlabels) replace
{res}{txt}file {bf:E:\2024-00768_数据\2024-00768+日志文件/table_4/table_4.xls} saved

{com}.         
.         
.         
.         
. ********************************************************************************
. **************************** 表5.利益补偿机制的比较 ****************************
. ********************************************************************************
. 
. 
.         use $working_data/county_panel.dta ,clear
{txt}
{com}.         capture mkdir $logfiles/table_5
{txt}
{com}.         
.         
.         
.         ** (1).计算样本县增产成本，以便后续计算补偿标准
.         
.         * 生成变量的基期(2003)值
.         gen is_yr2003 = 1 if year==2003
{txt}(58,333 missing values generated)

{com}.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 
.         {c )-}
{txt}(8,523 missing values generated)
(11,649 missing values generated)

{com}.         
.         * 生成相对基期的差分
.         foreach v of varlist Grain lnGDP_pc{c -(}
{txt}  2{com}.                 
.                 gen d_`v' = `v' - `v'_03
{txt}  3{com}.                 
.         {c )-}
{txt}(13,008 missing values generated)
(16,346 missing values generated)

{com}. 
.         * 基准 (保留小数点后三位，不会影响结论)
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 11 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   276{txt}{col 55}Number of obs = {res}    1789
{txt}{col 55}F(  2,   275) = {res}   81.69
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 129.3586903{txt}{col 55}Centered R2   = {res}  0.1589
{txt}Total (uncentered) SS   = {res} 129.3586903{txt}{col 55}Uncentered R2 = {res}  0.1589
{txt}Residual SS             = {res} 108.8029909{txt}{col 55}Root MSE      = {res}   .2468

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0591131{col 26}{space 2}  .012991{col 37}{space 1}   -4.55{col 46}{space 3}0.000{col 54}{space 4}-.0846876{col 67}{space 3}-.0335386
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3047582{col 26}{space 2} .0243734{col 37}{space 1}  -12.50{col 46}{space 3}0.000{col 54}{space 4}-.3527404{col 67}{space 3} -.256776
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  31.800
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 566.057
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  62.566
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      276{col 27}{space 1}      276{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         gen coef_base = round(_b[d_Grain],0.001)
{txt}
{com}.         gl ebase = round(_b[d_Grain],0.001)
{txt}
{com}.         
.         * 分产区
.         gen coef_cq = .
{txt}(61,237 missing values generated)

{com}.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_zcq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 4 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}   163{txt}{col 55}Number of obs = {res}     998
{txt}{col 55}F(  2,   162) = {res}   41.51
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 66.77658142{txt}{col 55}Centered R2   = {res}  0.1117
{txt}Total (uncentered) SS   = {res} 66.77658142{txt}{col 55}Uncentered R2 = {res}  0.1117
{txt}Residual SS             = {res} 59.32095905{txt}{col 55}Root MSE      = {res}   .2442

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0622801{col 26}{space 2} .0127849{col 37}{space 1}   -4.87{col 46}{space 3}0.000{col 54}{space 4}-.0875266{col 67}{space 3}-.0370336
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.3224114{col 26}{space 2} .0395332{col 37}{space 1}   -8.16{col 46}{space 3}0.000{col 54}{space 4}-.4004783{col 67}{space 3}-.2443446
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  26.923
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71} 361.974
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  55.911
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}      163{col 27}{space 1}      163{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_zcq==1
{txt}(33,009 real changes made)

{com}.         gl ezcq = round(_b[d_Grain],0.001)
{txt}
{com}.         
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_zxq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 2 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}    18{txt}{col 55}Number of obs = {res}     115
{txt}{col 55}F(  2,    17) = {res}    6.04
{txt}{col 55}Prob > F      = {res}  0.0104
{txt}Total (centered) SS     = {res} 3.350646031{txt}{col 55}Centered R2   = {res}  0.1284
{txt}Total (uncentered) SS   = {res} 3.350646031{txt}{col 55}Uncentered R2 = {res}  0.1284
{txt}Residual SS             = {res} 2.920565299{txt}{col 55}Root MSE      = {res}   .1615

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2} .2940493{col 26}{space 2} .4311897{col 37}{space 1}    0.68{col 46}{space 3}0.504{col 54}{space 4}-.6156816{col 67}{space 3}  1.20378
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.1110314{col 26}{space 2} .1040557{col 37}{space 1}   -1.07{col 46}{space 3}0.301{col 54}{space 4}-.3305699{col 67}{space 3}  .108507
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}   1.132
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.2874
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71}   5.768
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}   1.198
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}       18{col 27}{space 1}       18{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_zxq==1
{txt}(7,033 real changes made)

{com}.         gl ezxq = round(_b[d_Grain],0.001)
{txt}
{com}. 
.         ivreghdfe d_lnGDP_pc lnGDP_pc_03 (d_Grain = dsim_Grain) if year==2016&is_phq==1, absorb(city_id) vce(cluster city_id)
{res}{txt}(dropped 5 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 1 iterations)
{res}
{txt}IV (2SLS) estimation
{hline 20}

Estimates efficient for homoskedasticity only
Statistics robust to heteroskedasticity and clustering on city_id

Number of clusters (city_id) = {col 33}{res}    95{txt}{col 55}Number of obs = {res}     676
{txt}{col 55}F(  2,    94) = {res}   43.91
{txt}{col 55}Prob > F      = {res}  0.0000
{txt}Total (centered) SS     = {res} 59.23146288{txt}{col 55}Centered R2   = {res}  0.2188
{txt}Total (uncentered) SS   = {res} 59.23146288{txt}{col 55}Uncentered R2 = {res}  0.2188
{txt}Residual SS             = {res} 46.27268919{txt}{col 55}Root MSE      = {res}   .2622

{txt}{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}  d_lnGDP_pc{col 14}{c |} Coefficient{col 26}  std. err.{col 38}      t{col 46}   P>|t|{col 54}     [95% con{col 67}f. interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 5}d_Grain {c |}{col 14}{res}{space 2}-.0298051{col 26}{space 2} .0669141{col 37}{space 1}   -0.45{col 46}{space 3}0.657{col 54}{space 4}-.1626645{col 67}{space 3} .1030544
{txt}{space 1}lnGDP_pc_03 {c |}{col 14}{res}{space 2}-.2997192{col 26}{space 2} .0355648{col 37}{space 1}   -8.43{col 46}{space 3}0.000{col 54}{space 4}-.3703339{col 67}{space 3}-.2291044
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{help ivreg2##idtest:Underidentification test} (Kleibergen-Paap rk LM statistic):{res}{col 71}  18.611
{txt}{col 52}Chi-sq({res}1{txt}) P-val =  {res}{col 73}0.0000
{txt}{hline 78}
{help ivreg2##widtest:Weak identification test} (Cragg-Donald Wald F statistic):{res}{col 71}  65.477
{txt}                         (Kleibergen-Paap rk Wald F statistic):{res}{col 71}  21.499
{txt}Stock-Yogo weak ID test critical values:{res}{txt}{col 42}10% maximal IV size{res}{col 73} 16.38
{txt}{col 42}15% maximal IV size{res}{col 73}  8.96
{txt}{col 42}20% maximal IV size{res}{col 73}  6.66
{txt}{col 42}25% maximal IV size{res}{col 73}  5.53
{txt}Source: Stock-Yogo (2005).  Reproduced by permission.
NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
{hline 78}
{help ivreg2##overidtests:Hansen J statistic} (overidentification test of all instruments):{res}{col 71}   0.000
{txt}{col 50}(equation exactly identified)
{hline 78}
Instrumented:{col 23}d_Grain
Included instruments:{col 23}lnGDP_pc_03
Excluded instruments:{col 23}dsim_Grain
{help ivreg2##partial:Partialled-out}:{col 23}_cons
{col 23}nb: total SS, model F and R2s are after partialling-out;
{col 23}    any {help ivreg2##s_small:small-sample adjustments} include partialled-out
{col 23}    variables in regressor count K
{hline 78}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 13}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text} Absorbed FE{col 14}{c |} Categories{col 27} - Redundant{col 39}  = Num. Coefs{col 54}{c |}
{res}{col 1}{text}{hline 13}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text}     city_id{col 14}{c |}{space 1}       95{col 27}{space 1}       95{col 39}{result}{space 1}        0{col 53}{text}*{col 54}{c |}
{res}{col 1}{text}{hline 13}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}.         replace coef_cq = round(_b[d_Grain],0.001) if is_phq==1
{txt}(20,845 real changes made)

{com}.         gl ephq = round(_b[d_Grain],0.001)
{txt}
{com}.         
.                 
.         * 计算样本期间各县增产量，平均人口、人均GDP以及GDP
.         gen is_yr2016 = 1 if year==2016
{txt}(58,692 missing values generated)

{com}.         foreach v of varlist GDP_pc pop GDP farmland_area{c -(}
{txt}  2{com}.                 
.                 bysort county_id (year): egen `v'_03 = mean(`v'*is_yr2003)
{txt}  3{com}.                 bysort county_id (year): egen `v'_16 = mean(`v'*is_yr2016)
{txt}  4{com}.                 
.         {c )-}
{txt}(11,649 missing values generated)
(13,146 missing values generated)
(7,695 missing values generated)
(9,192 missing values generated)
(9,878 missing values generated)
(7,005 missing values generated)
(1,005 missing values generated)
(3,093 missing values generated)

{com}.         
.         bysort county_id (year): egen Grain_16 = mean(Grain*is_yr2016)
{txt}(7,511 missing values generated)

{com}.         gen dgrain_0316 = Grain_16 - Grain_03
{txt}(9,006 missing values generated)

{com}.         gen mgdppc_0316 = (GDP_pc_03 + GDP_pc_16)/2
{txt}(17,123 missing values generated)

{com}.         gen mpop_0316 = (pop_03 + pop_16)/2
{txt}(13,399 missing values generated)

{com}.         gen mgdp_0316 = mgdppc_0316*mpop_0316
{txt}(17,123 missing values generated)

{com}.         
.         drop if dgrain_0316==.|mgdppc_0316==.|mpop_0316==.
{txt}(18,227 observations deleted)

{com}.         keep if year==2016
{txt}(41,140 observations deleted)

{com}.         
.         * 按照基准系数估计成本
.         * i.各县增产成本(GDP)=产量变化*估计系数*人均GDP*人口 (见正文p12)
.         gen gdp_cost = dgrain_0316*coef_base*mgdppc_0316*mpop_0316
{txt}
{com}.         //转换单位：万元-->亿元
.         replace gdp_cost = gdp_cost/10000 
{txt}(1,870 real changes made)

{com}.         * ii. 样本县增产成本加总
.         bysort year: egen ttl_gdp_cost = total(gdp_cost)
{txt}
{com}. 
.         * iii. 人均成本=产量变化*估计系数*人均GDP
.         gen gdppc_cost = dgrain_0316*coef_base*mgdppc_0316
{txt}
{com}.         
.         * iv. 按人口加权平均得到全国人均成本
.         egen na_mpop_0316 = total(mpop_0316)
{txt}
{com}.         egen na_gdppc_cost = total(gdppc_cost*mpop_0316/na_mpop_0316)
{txt}
{com}.         
. 
.         
.         ** (2). 2016年事实的区域发展差距
.         
.         * 基尼系数
.         * 16年人口(万人->人并取整)作为权重
.         gen pop_16_int = round(pop*10000)
{txt}
{com}.         ineqdeco GDP_pc_16 [fweight = pop_16_int]
 
{txt}Percentile ratios

{hline 10}{c TT}{hline 47}
  All obs {c |}    p90/p10     p90/p50     p10/p50     p75/p25
{hline 10}{c +}{hline 47}
          {c |}      {res}4.888       2.424       0.496       2.346
{txt}{hline 10}{c BT}{hline 47}
  
Generalized Entropy indices GE(a), where a = income difference
 sensitivity parameter, and Gini coefficient

{hline 10}{c TT}{hline 59}
  All obs {c |}     GE(-1)       GE(0)       GE(1)       GE(2)        Gini
{hline 10}{c +}{hline 59}
          {c |}    {res}0.25361     0.21964     0.23854     0.34121     0.36545
{txt}{hline 10}{c BT}{hline 59}
   
Atkinson indices, A(e), where e > 0 is the inequality aversion parameter

{hline 10}{c TT}{hline 35}
  All obs {c |}     A(0.5)        A(1)        A(2)
{hline 10}{c +}{hline 35}
          {c |}    {res}0.10799     0.19719     0.33653
{txt}{hline 10}{c BT}{hline 35}

{com}.         gen gini_real = round(r(gini),0.001)
{txt}
{com}.         
.         * 人均GDP，高产组:低产组
.         egen high_dgrain = xtile(dgrain_0316),nquantiles(2)
{txt}
{com}.         //高组=1，低组=0
.         replace high_dgrain = high_dgrain - 1
{txt}(1,870 real changes made)

{com}.         
.         //组内均值(人口加权)
.         bysort high_dgrain: egen ttlpop_by_dgrain = total(pop_16)
{txt}
{com}.         bysort high_dgrain: egen mgdppc_by_dgrain = total(GDP_pc_16*pop_16/ttlpop_by_dgrain)
{txt}
{com}.         
.         sum mgdppc_by_dgrain if high_dgrain==1,meanonly
{txt}
{com}.         gen gdppc_high_real = r(mean)
{txt}
{com}.         
.         sum mgdppc_by_dgrain if high_dgrain==0,meanonly
{txt}
{com}.         gen gdppc_low_real = r(mean)
{txt}
{com}.         
.         gen ratio_gdppc_real = round(gdppc_high_real/gdppc_low_real,0.001)
{txt}
{com}.         
.         
.         
.         ** (3).按不同标准补偿并计算补偿后的发展差距
.         
. 
.         * A.按人口补偿
.         * 16年样本县总人口(万人)
.         egen napop_16 = total(pop_16)
{txt}
{com}.     * 计算补偿标准并换算成元/人
.         gen stad_bypop = abs((ttl_gdp_cost/napop_16)*10000)
{txt}
{com}.         * 补偿后各县反事实GDP(万元)
.         gen cfgdp_bypop = GDP_16+stad_bypop*pop_16
{txt}
{com}.         * 补偿后各县反事实人均GDP(元/人)
.         gen cfgdppc_bypop = cfgdp_bypop/pop_16
{txt}
{com}.         
.         * 计算反事实后的区域发展差距
.         * 基尼系数
.         ineqdeco cfgdppc_bypop [fweight = pop_16_int]
 
{txt}Percentile ratios

{hline 10}{c TT}{hline 47}
  All obs {c |}    p90/p10     p90/p50     p10/p50     p75/p25
{hline 10}{c +}{hline 47}
          {c |}      {res}4.528       2.356       0.520       2.252
{txt}{hline 10}{c BT}{hline 47}
  
Generalized Entropy indices GE(a), where a = income difference
 sensitivity parameter, and Gini coefficient

{hline 10}{c TT}{hline 59}
  All obs {c |}     GE(-1)       GE(0)       GE(1)       GE(2)        Gini
{hline 10}{c +}{hline 59}
          {c |}    {res}0.22457     0.20154     0.22183     0.31628     0.35184
{txt}{hline 10}{c BT}{hline 59}
   
Atkinson indices, A(e), where e > 0 is the inequality aversion parameter

{hline 10}{c TT}{hline 35}
  All obs {c |}     A(0.5)        A(1)        A(2)
{hline 10}{c +}{hline 35}
          {c |}    {res}0.10019     0.18253     0.30994
{txt}{hline 10}{c BT}{hline 35}

{com}.         gen gini_cfpop = round(r(gini),0.001)
{txt}
{com}.         
.         * 人均GDP，高产组:低产组
.         //组内均值(人口加权)
.         bysort high_dgrain: egen mgdppc_by_dgrain_cfpop = total(cfgdppc_bypop*pop_16/ttlpop_by_dgrain)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfpop if high_dgrain==1,meanonly
{txt}
{com}.         gen gdppc_high_cfpop = r(mean)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfpop if high_dgrain==0,meanonly
{txt}
{com}.         gen gdppc_low_cfpop = r(mean)
{txt}
{com}.         
.         gen ratio_gdppc_cfpop = round(gdppc_high_cfpop/gdppc_low_cfpop ,0.001)
{txt}
{com}.         
.         
.         
.         
.                 
.         * B.按照粮食增产补偿
.         * 样本县的总增产量(十万吨)
.         egen na_dgrain_0316 = total(dgrain_0316)
{txt}
{com}.         * 计算补偿标准(亿元/十万吨)
.         gen stad_bydgrain = abs(ttl_gdp_cost/na_dgrain_0316)
{txt}
{com}.         * 换算成元/吨
.         gen stad_bydgrain_ypt = stad_bydgrain*1000
{txt}
{com}.         
.         * 补偿后反事实GDP(万元)
.         gen cfgdp_bydgrain = GDP_16+stad_bydgrain*dgrain_0316*10000
{txt}
{com}.         * 补偿后反事实人均GDP(元/人)
.         gen cfgdppc_bydgrain = cfgdp_bydgrain/pop_16
{txt}
{com}.         
.         
.         * 计算反事实后的区域发展差距
.         * 基尼系数
.         ineqdeco cfgdppc_bydgrain [fweight = pop_16_int]
 
{txt}Percentile ratios

{hline 10}{c TT}{hline 47}
  All obs {c |}    p90/p10     p90/p50     p10/p50     p75/p25
{hline 10}{c +}{hline 47}
          {c |}      {res}4.532       2.339       0.516       2.286
{txt}{hline 10}{c BT}{hline 47}
  
Generalized Entropy indices GE(a), where a = income difference
 sensitivity parameter, and Gini coefficient

{hline 10}{c TT}{hline 59}
  All obs {c |}     GE(-1)       GE(0)       GE(1)       GE(2)        Gini
{hline 10}{c +}{hline 59}
          {c |}    {res}0.22846     0.20190     0.22035     0.31225     0.35119
{txt}{hline 10}{c BT}{hline 59}
   
Atkinson indices, A(e), where e > 0 is the inequality aversion parameter

{hline 10}{c TT}{hline 35}
  All obs {c |}     A(0.5)        A(1)        A(2)
{hline 10}{c +}{hline 35}
          {c |}    {res}0.09991     0.18282     0.31362
{txt}{hline 10}{c BT}{hline 35}

{com}.         gen gini_cfgrn = round(r(gini),0.001)
{txt}
{com}.         * 人均GDP，高产组:低产组
.         //组内均值(人口加权)
.         bysort high_dgrain: egen mgdppc_by_dgrain_cfgrn = total(cfgdppc_bydgrain*pop_16/ttlpop_by_dgrain)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfgrn if high_dgrain==1,meanonly
{txt}
{com}.         gen gdppc_high_cfgrn = r(mean)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfgrn if high_dgrain==0,meanonly
{txt}
{com}.         gen gdppc_low_cfgrn = r(mean)
{txt}
{com}.         
.         gen ratio_gdppc_cfgrn = round(gdppc_high_cfgrn/gdppc_low_cfgrn ,0.001)
{txt}
{com}.         
.         
.         
.         
.         * C.按耕地面积
.         * 样本县总耕地面积
.         egen nacrld_16 = total(farmland_area_16)
{txt}
{com}.         * 按耕地面积补偿标准
.         gen stad_byfmld = abs(ttl_gdp_cost/nacrld_16)
{txt}
{com}.         * 换算成元/亩
.         gen stad_byfmld_ypm = stad_byfmld*10000/1500
{txt}
{com}. 
.         * 补偿后的反事实GDP(万元)
.         gen cfgdp_byfmld = GDP_16+stad_byfmld*farmland_area_16*10000
{txt}(9 missing values generated)

{com}.         * 补偿后反事实人均GDP(元/人)
.         gen cfgdppc_byfmld = cfgdp_byfmld/pop_16
{txt}(9 missing values generated)

{com}.         
.         
.         
.         * 计算反事实后的区域发展差距
.         * 基尼系数
.         ineqdeco cfgdppc_byfmld [fweight = pop_16_int]
 
{txt}Percentile ratios

{hline 10}{c TT}{hline 47}
  All obs {c |}    p90/p10     p90/p50     p10/p50     p75/p25
{hline 10}{c +}{hline 47}
          {c |}      {res}4.570       2.320       0.508       2.312
{txt}{hline 10}{c BT}{hline 47}
  
Generalized Entropy indices GE(a), where a = income difference
 sensitivity parameter, and Gini coefficient

{hline 10}{c TT}{hline 59}
  All obs {c |}     GE(-1)       GE(0)       GE(1)       GE(2)        Gini
{hline 10}{c +}{hline 59}
          {c |}    {res}0.22899     0.20299     0.22202     0.31580     0.35228
{txt}{hline 10}{c BT}{hline 59}
   
Atkinson indices, A(e), where e > 0 is the inequality aversion parameter

{hline 10}{c TT}{hline 35}
  All obs {c |}     A(0.5)        A(1)        A(2)
{hline 10}{c +}{hline 35}
          {c |}    {res}0.10053     0.18371     0.31412
{txt}{hline 10}{c BT}{hline 35}

{com}.         gen gini_cfland = round(r(gini),0.001)
{txt}
{com}.         
.         * 人均GDP，高产组:低产组
.         //组内均值(人口加权)
.         bysort high_dgrain: egen mgdppc_by_dgrain_cfland = total(cfgdppc_byfmld*pop_16/ttlpop_by_dgrain)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfland if high_dgrain==1,meanonly
{txt}
{com}.         gen gdppc_high_cfland = r(mean)
{txt}
{com}.         
.         sum mgdppc_by_dgrain_cfland if high_dgrain==0,meanonly
{txt}
{com}.         gen gdppc_low_cfland = r(mean)
{txt}
{com}.         
.         gen ratio_gdppc_cfland = round(gdppc_high_cfland/gdppc_low_cfland ,0.001)
{txt}
{com}. 
.         
.         
.         
.         ** (4).输出结果
.         
.         preserve
{txt}
{com}.         * 展示补偿标准的绝对值(由负)
.         collapse (mean) standard = stad_bypop gini_real gini_cf = gini_cfpop ratio_gdppc_real ratio_gdppc_cf = ratio_gdppc_cfpop
{res}{txt}
{com}.         gen row = 1
{txt}
{com}.         gen rownames = "按人口平分"
{txt}
{com}.         save $logfiles/table_5/compen_1.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_1.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_1.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
. 
.         preserve
{txt}
{com}.         collapse (mean) standard = stad_bydgrain_ypt gini_real gini_cf = gini_cfgrn ratio_gdppc_real ratio_gdppc_cf = ratio_gdppc_cfgrn
{res}{txt}
{com}.         gen row = 2
{txt}
{com}.         gen rownames = "按粮食增产"
{txt}
{com}.         save $logfiles/table_5/compen_2.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_2.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_2.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.         
.         preserve
{txt}
{com}.         collapse (mean) standard = stad_byfmld_ypm gini_real gini_cf = gini_cfland ratio_gdppc_real ratio_gdppc_cf = ratio_gdppc_cfland
{res}{txt}
{com}.         gen row = 3
{txt}
{com}.         gen rownames = "按耕地存量"
{txt}
{com}.         save $logfiles/table_5/compen_3.dta,replace
{txt}{p 0 4 2}
(file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_3.dta{rm}
not found)
{p_end}
{p 0 4 2}
file {bf}
E:\2024-00768_数据\2024-00768+日志文件/table_5/compen_3.dta{rm}
saved
{p_end}

{com}.         restore
{txt}
{com}.         
.         
.         * 合并输出
.         use $logfiles/table_5/compen_1.dta ,clear
{txt}
{com}.         append using $logfiles/table_5/compen_2.dta
{txt}
{com}.         append using $logfiles/table_5/compen_3.dta
{txt}
{com}.         replace standard = round(standard,0.01)
{txt}(3 real changes made)

{com}.         
.         //保留小数位数
.         gen standard_str = string(standard,"%20.2f")
{txt}
{com}.         foreach v of varlist gini_* ratio_*{c -(}
{txt}  2{com}.                 
.                 gen `v'_str = string(`v',"%20.3f")
{txt}  3{com}.         {c )-}
{txt}
{com}.         
.         keep row rownames *_str
{txt}
{com}.         renvarlab *_str,subst(_str )
{txt}
{com}.         
.         
.         label variable standard "补偿标准"
{txt}
{com}.         label variable gini_real "基尼系数：2016事实"
{txt}
{com}.         label variable gini_cf "基尼系数：一次性补偿后"
{txt}
{com}.         label variable ratio_gdppc_real "人均GDP之比：2016事实"
{txt}
{com}.         label variable ratio_gdppc_cf "人均GDP之比：一次性补偿后"
{txt}
{com}.         order row rownames standard gini_real gini_cf ratio_gdppc_real ratio_gdppc_cf
{txt}
{com}.         
.         export excel using $logfiles/table_5/table_5.xls, firstrow(varlabels) replace
{res}{txt}file {bf:E:\2024-00768_数据\2024-00768+日志文件/table_5/table_5.xls} saved

{com}.         
.         
.         
.         
.         
.         
.         
.         
.         log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}E:\2024-00768_数据\2024-00768+日志文件/log_main.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}23 Apr 2025, 16:31:08
{txt}{.-}
{smcl}
{txt}{sf}{ul off}