--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:/stata17/Replication_paper/Logfile_forReg/Analysis_进一步讨论_外围制造业企业效益.txt
  log type:  text
 opened on:  25 Jan 2026, 12:06:31

. 
. ***************
. * Run
. ***************
. 
. 
. use "$DATA\intermediate\forBenchmarkReg_pre.dta",clear

. 
. global y_var "lnmainrev lnoperrev lnsales lnemp_yearend "

. global x_var "policy policy_manuf policy_modsrv "

. global z_var "lnasset inv_intensity inv_to_sales leverage ppe_ratio current_assets_ratio roa ros profit_total"

. sum $y_var $z_var

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   lnmainrev |  1,034,854    10.62181    2.004435          0   20.58941
   lnoperrev |  1,043,854    10.62439    2.028006          0   20.59087
     lnsales |    784,265    10.37895    2.119739          0   19.44178
lnemp_year~d |    924,088    4.458913    1.518001          0   16.74697
     lnasset |    908,250     11.0118     2.22083          0   23.61651
-------------+---------------------------------------------------------
inv_intens~y |    846,403    21.58578     2210.01  -13528.09    1978975
inv_to_sales |    972,379    315.1202    24647.77       -9.9   1.39e+07
    leverage |    743,857    98.67503     8650.01    -129245    4706340
   ppe_ratio |    897,351    19.84756    675.3981  -8.720134   636066.7
current_as~o |    908,250    71.28058    30.43491  -15456.01   251.6501
-------------+---------------------------------------------------------
         roa |    907,443    392.7137    141801.8  -9.10e+07   3.66e+07
         ros |  1,043,784    2267.741     1506028  -2.56e+08   1.04e+09
profit_total |  1,065,444    29052.13     1283946  -7.61e+08   3.27e+08

. global controlVar " inv_to_sales leverage ppe_ratio ros profit_total "

. global mechanismVar "taxburden_due taxburden_due_vat taxburden_paid taxburden_paid_vat modern5 modern6 modern5_int modern6_int"

. 
. * manufacture only 
. keep if  industry_group==1
(400,597 observations deleted)

. 
. *利用产业关联度中位数区分实验组和对照组
. * 1) 构造产业关联度的行业代码 industryid_io2007
. gen industryid_io2007 = .
(664,859 missing values generated)

. 
. * -------- 先用 a0116 (3位数) 匹配 --------
. replace industryid_io2007 = 11 if a0116 == 131
(1,421 real changes made)

. replace industryid_io2007 = 12 if a0116 == 132
(1,384 real changes made)

. replace industryid_io2007 = 13 if a0116 == 133
(1,405 real changes made)

. replace industryid_io2007 = 14 if a0116 == 134
(638 real changes made)

. replace industryid_io2007 = 15 if a0116 == 135
(1,441 real changes made)

. replace industryid_io2007 = 16 if a0116 == 136
(2,748 real changes made)

. replace industryid_io2007 = 17 if inlist(a0116, 137, 139)
(5,053 real changes made)

. replace industryid_io2007 = 18 if a0116 == 143
(1,218 real changes made)

. replace industryid_io2007 = 19 if a0116 == 144
(1,207 real changes made)

. replace industryid_io2007 = 20 if a0116 == 146
(1,295 real changes made)

. replace industryid_io2007 = 21 if inlist(a0116, 145, 149, 142, 141)
(8,368 real changes made)

. replace industryid_io2007 = 22 if a0116 == 151
(3,375 real changes made)

. replace industryid_io2007 = 23 if inlist(a0116, 152, 153)
(5,172 real changes made)

. replace industryid_io2007 = 24 if a0116 == 16
(0 real changes made)

. replace industryid_io2007 = 25 if inlist(a0116, 171, 175)
(20,660 real changes made)

. replace industryid_io2007 = 26 if a0116 == 172
(2,178 real changes made)

. replace industryid_io2007 = 27 if inlist(a0116, 173, 174)
(1,679 real changes made)

. replace industryid_io2007 = 28 if inlist(a0116, 177, 178)
(5,915 real changes made)

. replace industryid_io2007 = 29 if a0116 == 176
(5,984 real changes made)

. replace industryid_io2007 = 30 if inlist(a0116, 18, 195)
(5,804 real changes made)

. replace industryid_io2007 = 31 if inlist(a0116, 191, 192, 193, 194)
(9,022 real changes made)

. replace industryid_io2007 = 32 if a0116 == 20
(0 real changes made)

. replace industryid_io2007 = 33 if a0116 == 21
(0 real changes made)

. replace industryid_io2007 = 34 if a0116 == 22
(0 real changes made)

. replace industryid_io2007 = 35 if a0116 == 23
(0 real changes made)

. replace industryid_io2007 = 36 if inlist(a0116, 241, 244)
(3,780 real changes made)

. replace industryid_io2007 = 37 if inlist(a0116, 251, 253)
(2,096 real changes made)

. replace industryid_io2007 = 38 if a0116 == 252
(1,096 real changes made)

. replace industryid_io2007 = 39 if a0116 == 261
(11,514 real changes made)

. replace industryid_io2007 = 40 if a0116 == 262
(1,545 real changes made)

. replace industryid_io2007 = 41 if a0116 == 263
(900 real changes made)

. replace industryid_io2007 = 42 if a0116 == 264
(6,030 real changes made)

. replace industryid_io2007 = 43 if a0116 == 265
(3,940 real changes made)

. replace industryid_io2007 = 44 if a0116 == 266
(10,995 real changes made)

. replace industryid_io2007 = 45 if a0116 == 268
(3,022 real changes made)

. replace industryid_io2007 = 46 if a0116 == 27
(0 real changes made)

. replace industryid_io2007 = 47 if a0116 == 28
(0 real changes made)

. replace industryid_io2007 = 48 if a0116 == 291
(6,741 real changes made)

. replace industryid_io2007 = 49 if a0116 == 292
(23,503 real changes made)

. replace industryid_io2007 = 50 if a0116 == 301
(6,880 real changes made)

. replace industryid_io2007 = 51 if a0116 == 302
(9,126 real changes made)

. replace industryid_io2007 = 52 if a0116 == 303
(4,568 real changes made)

. replace industryid_io2007 = 53 if inlist(a0116, 304, 305, 306)
(4,375 real changes made)

. replace industryid_io2007 = 54 if a0116 == 307
(3,528 real changes made)

. replace industryid_io2007 = 55 if a0116 == 308
(3,271 real changes made)

. replace industryid_io2007 = 56 if a0116 == 309
(8,491 real changes made)

. replace industryid_io2007 = 57 if a0116 == 311
(3,012 real changes made)

. replace industryid_io2007 = 58 if a0116 == 312
(3,557 real changes made)

. replace industryid_io2007 = 59 if a0116 == 314
(7,355 real changes made)

. replace industryid_io2007 = 60 if a0116 == 315
(2,163 real changes made)

. replace industryid_io2007 = 61 if inlist(a0116, 321, 322, 323, 324, 325)
(8,321 real changes made)

. replace industryid_io2007 = 62 if a0116 == 326
(5,803 real changes made)

. replace industryid_io2007 = 63 if a0116 == 33
(0 real changes made)

. replace industryid_io2007 = 64 if a0116 == 341
(4,552 real changes made)

. replace industryid_io2007 = 65 if a0116 == 342
(6,175 real changes made)

. replace industryid_io2007 = 66 if a0116 == 343
(2,080 real changes made)

. replace industryid_io2007 = 67 if a0116 == 344
(6,078 real changes made)

. replace industryid_io2007 = 68 if inlist(a0116, 345, 346, 347, 348)
(17,272 real changes made)

. replace industryid_io2007 = 69 if a0116 == 351
(5,584 real changes made)

. replace industryid_io2007 = 70 if a0116 == 352
(8,254 real changes made)

. replace industryid_io2007 = 71 if a0116 == 357
(5,152 real changes made)

. replace industryid_io2007 = 72 if inlist(a0116, 353, 354, 355, 356, 358, 359)
(23,763 real changes made)

. replace industryid_io2007 = 73 if a0116 == 371
(2,238 real changes made)

. replace industryid_io2007 = 74 if a0116 == 36
(0 real changes made)

. replace industryid_io2007 = 75 if a0116 == 373
(4,397 real changes made)

. replace industryid_io2007 = 76 if inlist(a0116, 372, 374, 375, 376, 377, 379)
(17,015 real changes made)

. replace industryid_io2007 = 77 if a0116 == 381
(2,756 real changes made)

. replace industryid_io2007 = 78 if a0116 == 382
(8,664 real changes made)

. replace industryid_io2007 = 79 if a0116 == 383
(5,768 real changes made)

. replace industryid_io2007 = 80 if inlist(a0116, 385, 386)
(3,787 real changes made)

. replace industryid_io2007 = 81 if inlist(a0116, 387, 389, 384)
(7,269 real changes made)

. replace industryid_io2007 = 82 if a0116 == 392
(7,097 real changes made)

. replace industryid_io2007 = 83 if inlist(a0116, 393, 394)
(3,684 real changes made)

. replace industryid_io2007 = 84 if a0116 == 391
(3,369 real changes made)

. replace industryid_io2007 = 85 if inlist(a0116, 396, 397)
(16,368 real changes made)

. replace industryid_io2007 = 86 if a0116 == 395
(2,035 real changes made)

. replace industryid_io2007 = 87 if a0116 == 399
(11,359 real changes made)

. replace industryid_io2007 = 88 if a0116 == 40
(0 real changes made)

. replace industryid_io2007 = 89 if a0116 == 347
(383 real changes made)

. replace industryid_io2007 = 90 if inlist(a0116, 41, 242, 243, 245, 246)
(4,853 real changes made)

. replace industryid_io2007 = 91 if a0116 == 42
(0 real changes made)

. 
. * -------- 再用 a0114 (2位数) 补充缺失 --------
. replace industryid_io2007 = 24 if missing(industryid_io2007) & a0114 == 16
(463 real changes made)

. replace industryid_io2007 = 30 if missing(industryid_io2007) & a0114 == 18
(39,104 real changes made)

. replace industryid_io2007 = 32 if missing(industryid_io2007) & a0114 == 20
(10,475 real changes made)

. replace industryid_io2007 = 33 if missing(industryid_io2007) & a0114 == 21
(6,392 real changes made)

. replace industryid_io2007 = 34 if missing(industryid_io2007) & a0114 == 22
(12,027 real changes made)

. replace industryid_io2007 = 35 if missing(industryid_io2007) & a0114 == 23
(9,751 real changes made)

. replace industryid_io2007 = 46 if missing(industryid_io2007) & a0114 == 27
(14,114 real changes made)

. replace industryid_io2007 = 47 if missing(industryid_io2007) & a0114 == 28
(3,347 real changes made)

. replace industryid_io2007 = 63 if missing(industryid_io2007) & a0114 == 33
(32,402 real changes made)

. replace industryid_io2007 = 74 if missing(industryid_io2007) & a0114 == 36
(36,417 real changes made)

. replace industryid_io2007 = 88 if missing(industryid_io2007) & a0114 == 40
(23,119 real changes made)

. replace industryid_io2007 = 90 if missing(industryid_io2007) & a0114 == 41
(28,157 real changes made)

. replace industryid_io2007 = 91 if missing(industryid_io2007) & a0114 == 42
(8,068 real changes made)

. 
. * 2) match 产业关联度指标 use industryid_io2007:43 金属设备修理没有匹配.
. merge m:1 industryid_io2007 using "$DATA\sourcedata\industryRelation2007.dta"

    Result                      Number of obs
    -----------------------------------------
    Not matched                        29,875
        from master                    29,875  (_merge==1)
        from using                          0  (_merge==2)

    Matched                           634,984  (_merge==3)
    -----------------------------------------

. keep if _merge == 3
(29,875 observations deleted)

. drop _merge

. 
. 
. * 3) gen policy var * industryRelation2007 : directly use industryRelation2007 as density DID.
. * gen X variables
. rename group D_manuf_highRelation  //区分与试点服务业产业关联度高低(0/1)虚拟变量

. gen double policy_manuf  = policy * D_manuf_highRelation    // 制造业的政策效应

. label var policy_manuf  "Policy × Manufacturing (vs control Manu)"

. 
. *outlier process
. winsor2 $y_var $controlVar $mechanismVar, replace cut(1 99)

. 
. * combine citycluster and distance
. merge m:1 countycode using  "$DATA\sourcedata\distanceBetweenCounty.dta" 

    Result                      Number of obs
    -----------------------------------------
    Not matched                       204,238
        from master                   203,976  (_merge==1)
        from using                        262  (_merge==2)

    Matched                           431,008  (_merge==3)
    -----------------------------------------

. keep if _merge == 3
(204,238 observations deleted)

. drop _merge

. replace km = km - 1 //调整县区到所在中心县区的距离基准点为0，原有数据+ 1km，现在调整回去
(431,008 real changes made)

. rename km distance

. rename km1 relativedistance

. rename bb citycluster

. rename a0114 industrycode2

. 
. *----------------
. * regression
. *----------------
. xtset firm_id years

Panel variable: firm_id (unbalanced)
 Time variable: years, 2009 to 2014, but with gaps
         Delta: 1 unit

. 
. 
. ********************************************************************************
. *************进一步分析: 表7 城市群中心—外围县区的制造业企业效益
. 
. replace distance = distance/1000  //变量缩放1000倍,以便统一小数点后3位数
(426,221 real changes made)

. 
. *外围制造业企业收益更多
. gen lny_l = lnmainrev - lnemp_yearend //ln_y/l  主营业务收入/职工人数: 劳动生产率
(67,521 missing values generated)

. gen capitalroll = operating_rev/total_assets //资产周转率= 营业收入 / 总资产
(68,844 missing values generated)

. gen lntotalasset = ln(total_asset)
(68,822 missing values generated)

. local zvar "lny_l  capitalroll  lntotalasset"

. winsor2 `zvar' ,replace cut(1 99) 

. 
. reghdfe lny_l i.policy_manuf##c.distance  , absorb(firm_id prov#years citycluster#years) cluster(firm_id) //劳动生产率
(dropped 18089 singleton observations)
(MWFE estimator converged in 78 iterations)

HDFE Linear regression                            Number of obs   =    345,398
Absorbing 3 HDFE groups                           F(   3, 102230) =       9.80
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.8811
                                                  Adj R-squared   =     0.8310
                                                  Within R-sq.    =     0.0002
Number of clusters (firm_id) =    102,231         Root MSE        =     0.4469

                                     (Std. err. adjusted for 102,231 clusters in firm_id)
-----------------------------------------------------------------------------------------
                        |               Robust
                  lny_l | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
         1.policy_manuf |   .0123139   .0057878     2.13   0.033     .0009699     .023658
               distance |   1.130031   .5576452     2.03   0.043     .0370535    2.223008
                        |
policy_manuf#c.distance |
                     1  |   .0443535   .0267808     1.66   0.098    -.0081365    .0968435
                        |
                  _cons |   5.721846   .0833257    68.67   0.000     5.558529    5.885163
-----------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-------------------------------------------------------------+
         Absorbed FE | Categories  - Redundant  = Num. Coefs |
---------------------+---------------------------------------|
             firm_id |    102231      102231           0    *|
          prov#years |       145           1         144     |
   citycluster#years |        85          70          15     |
-------------------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store m1

. reghdfe capitalroll i.policy_manuf##c.distance  , absorb(firm_id prov#years citycluster#years) cluster(firm_id) //资产周转率
(dropped 18352 singleton observations)
(MWFE estimator converged in 65 iterations)

HDFE Linear regression                            Number of obs   =    343,812
Absorbing 3 HDFE groups                           F(   3, 102142) =       6.52
Statistics robust to heteroskedasticity           Prob > F        =     0.0002
                                                  R-squared       =     0.7947
                                                  Adj R-squared   =     0.7077
                                                  Within R-sq.    =     0.0001
Number of clusters (firm_id) =    102,143         Root MSE        =     0.6678

                                     (Std. err. adjusted for 102,143 clusters in firm_id)
-----------------------------------------------------------------------------------------
                        |               Robust
            capitalroll | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
         1.policy_manuf |   .0076023    .008031     0.95   0.344    -.0081384     .023343
               distance |   .2384869   .8031297     0.30   0.767    -1.335637    1.812611
                        |
policy_manuf#c.distance |
                     1  |     .09858   .0401034     2.46   0.014     .0199779    .1771821
                        |
                  _cons |   1.307888    .120144    10.89   0.000     1.072408    1.543369
-----------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-------------------------------------------------------------+
         Absorbed FE | Categories  - Redundant  = Num. Coefs |
---------------------+---------------------------------------|
             firm_id |    102143      102143           0    *|
          prov#years |       145           1         144     |
   citycluster#years |        85          70          15     |
-------------------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store m2

. reghdfe lntotalasset i.policy_manuf##c.distance  , absorb(firm_id prov#years citycluster#years) cluster(firm_id) //总资产
(dropped 18350 singleton observations)
(MWFE estimator converged in 65 iterations)

HDFE Linear regression                            Number of obs   =    343,836
Absorbing 3 HDFE groups                           F(   3, 102150) =       8.19
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.9707
                                                  Adj R-squared   =     0.9583
                                                  Within R-sq.    =     0.0001
Number of clusters (firm_id) =    102,151         Root MSE        =     0.3746

                                     (Std. err. adjusted for 102,151 clusters in firm_id)
-----------------------------------------------------------------------------------------
                        |               Robust
           lntotalasset | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
------------------------+----------------------------------------------------------------
         1.policy_manuf |   .0105343   .0048985     2.15   0.032     .0009334    .0201352
               distance |   .5261351   1.535769     0.34   0.732    -2.483952    3.536222
                        |
policy_manuf#c.distance |
                     1  |   .0389072   .0233589     1.67   0.096    -.0068759    .0846903
                        |
                  _cons |   10.57064   .2297156    46.02   0.000      10.1204    11.02088
-----------------------------------------------------------------------------------------

Absorbed degrees of freedom:
-------------------------------------------------------------+
         Absorbed FE | Categories  - Redundant  = Num. Coefs |
---------------------+---------------------------------------|
             firm_id |    102151      102151           0    *|
          prov#years |       145           1         144     |
   citycluster#years |        85          70          15     |
-------------------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation

. estimates store m3

. 
. outreg2 [m1] using "$EXHIBIT/results.doc", replace ///
>     ctitle("lny_l")          /// 列标题
>     se                       /// 报告括号内标准误
>     dec(3) nocons addtext(Firm FE, Yes, Province#Year FE, Yes, CityCluster#Year FE,Yes)
D:/stata17/Replication_paper/Exhibits/results.doc
dir : seeout

.         
. outreg2 [m2] using "$EXHIBIT/results.doc", append ///
>     ctitle("capitalroll")          /// 列标题
>     se                       /// 报告括号内标准误
>     dec(3) nocons addtext(Firm FE, Yes, Province#Year FE, Yes, CityCluster#Year FE,Yes)
D:/stata17/Replication_paper/Exhibits/results.doc
dir : seeout

. 
. outreg2 [m3] using "$EXHIBIT/results.doc", append ///
>     ctitle("lntotalasset")          /// 列标题
>     se                       /// 报告括号内标准误
>     dec(3) nocons addtext(Firm FE, Yes, Province#Year FE, Yes, CityCluster#Year FE,Yes)
D:/stata17/Replication_paper/Exhibits/results.doc
dir : seeout

. 
. 
. 
. 
. *****************
. * close log txt
. *****************
. 
. log close
      name:  <unnamed>
       log:  D:/stata17/Replication_paper/Logfile_forReg/Analysis_进一步讨论_外围制造业企业效益.txt
  log type:  text
 closed on:  25 Jan 2026, 12:07:27
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
