-------------
      name:  <unnamed>
       log:  D:\Program Files\Stata18\第12章.smcl
  log type:  smcl
 opened on:  24 Jan 2024, 16:24:02

. use "E:\【计量经济学及stata】\陈强计量经济学及stata应用(网课+PPT+Data)\《计量经济学及Stata应用》Data-Finished-本科计量\lin_1992.dta",clear

.
. xtset province year

 Panel variable: province (strongly balanced)


Time variable: year, 70   to 87


         Delta: 1 unit

.
. xtdes

province:  1, 2, ..., 28                                     n =         28
    year:  70, 71, ..., 87                                   T =         18
           Delta(year) = 1 unit
           Span(year)  = 18 periods
           (province*year uniquely identifies each observation)

Distribution of T_i:   min      5%     25%       50%       75%     95%     max
                        18      18      18        18        18      18      18

     Freq.  Percent    Cum. |  Pattern
 ---------------------------+--------------------
       28    100.00  100.00 |  111111111111111111
 ---------------------------+--------------------
       28    100.00         |  XXXXXXXXXXXXXXXXXX

.
. xtsum ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca

Variable         |      Mean   Std. dev.       Min        Max |    Observations
-----------------+--------------------------------------------+----------------
ltvfo    overall |  7.647758   .5331999       5.51       9.33 |     N =     504
         between |             .4611992   6.982222   8.977222 |     n =      28
         within  |             .2806888    5.61498   8.471647 |     T =      18
                 |                                            |
ltlan    overall |  5.837877   .8084866       4.57       7.76 |     N =     504
         between |             .8143036   4.617222   7.697778 |     n =      28
         within  |             .1138892   4.758988   6.163988 |     T =      18
                 |                                            |
ltwlab   overall |   3.19752   .4193496        .98       3.86 |     N =     504
         between |             .3195715   2.303889   3.646111 |     n =      28
         within  |             .2778123   1.618631   4.053631 |     T =      18
                 |                                            |
ltpow    overall |  2.692778   .9463811         .2       5.04 |     N =     504
         between |             .7702036      1.475   4.180556 |     n =      28
         within  |             .5678668        .31   3.909444 |     T =      18
                 |                                            |
ltfer    overall |   2.15119   .7903761       -.23       3.98 |     N =     504
         between |             .5624935   1.081111   3.649444 |     n =      28
         within  |              .564791   .4173016   3.510079 |     T =      18
                 |                                            |
hrs      overall |  .3497479   .4526283          0          1 |     N =     476
         between |             .0453814   .2123529   .4094118 |     n =      28
         within  |             .4504245  -.0596639   1.053866 |     T =      17
                 |                                            |
mipric1  overall |  2.248889   .2431379       1.76       2.73 |     N =     504
         between |                    0   2.248889   2.248889 |     n =      28
         within  |             .2431379       1.76       2.73 |     T =      18
                 |                                            |
giprice  overall |  2.858889   .4537578       2.39       3.56 |     N =     504
         between |                    0   2.858889   2.858889 |     n =      28
         within  |             .4537578       2.39       3.56 |     T =      18
                 |                                            |
mci      overall |  1.538452   .4931854        .85       2.55 |     N =     504
         between |             .4972044   .8666667   2.487222 |     n =      28
         within  |             .0661412   1.323452   1.880119 |     T =      18
                 |                                            |
ngca     overall |   .199623    .076145        .06        .91 |     N =     504
         between |             .0631671   .1144444   .3466667 |     n =      28
         within  |             .0440777   .1151786   .8951786 |     T =      18

.
. xtline ltvfo

.
. reg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca,vce(cluster province)

Linear regression                               Number of obs     =        476
                                                F(9, 27)          =      81.39
                                                Prob > F          =     0.0000
                                                R-squared         =     0.8685
                                                Root MSE          =     .19689

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |     .693795     .115024      6.03    0.000      .4577853     .9298048
      ltwlab |    .2650224    .0566294      4.68    0.000      .1488285     .3812164
       ltpow |   -.0291884    .0670385     -0.44    0.667     -.1667401     .1083633
       ltfer |    .3110617    .0531318      5.85    0.000      .2020443     .4200792
         hrs |    .2286926    .0489458      4.67    0.000      .1282642      .329121
     mipric1 |    .0122048    .0547799      0.22    0.825     -.1001943     .1246039
     giprice |   -.0538892    .0274468     -1.96    0.060     -.1102054      .002427
         mci |    .6949202    .1689692      4.11    0.000      .3482241     1.041616
        ngca |    .3053056    .5222639      0.58    0.564     -.7662914     1.376903
       _cons |    1.080587    .8269888      1.31    0.202     -.6162544     2.777427
-------------+----------------------------------------------------------------

.
. estimates store OLS

.
. reg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca

      Source |       SS           df       MS      Number of obs   =       476
-------------+----------------------------------   F(9, 466)       =    342.09
       Model |  119.355964         9  13.2617737   Prob > F        =    0.0000
    Residual |  18.0652415       466  .038766613   R-squared       =    0.8685
-------------+----------------------------------   Adj R-squared   =    0.8660
       Total |  137.421205       475    .2893078   Root MSE        =    .19689

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |     .693795    .0368914     18.81    0.000      .6213008     .7662892
      ltwlab |    .2650224    .0238406     11.12    0.000      .2181741     .3118708
       ltpow |   -.0291884    .0331891     -0.88    0.380     -.0944073     .0360305
       ltfer |    .3110617    .0206459     15.07    0.000      .2704911     .3516324
         hrs |    .2286926    .0307121      7.45    0.000      .1683412      .289044
     mipric1 |    .0122048    .0533863      0.23    0.819     -.0927028     .1171125
     giprice |   -.0538892    .0271999     -1.98    0.048     -.1073389    -.0004395
         mci |    .6949202    .0522416     13.30    0.000       .592262     .7975784
        ngca |    .3053056    .1952732      1.56    0.119     -.0784195     .6890306
       _cons |    1.080587    .2832576      3.81    0.000      .5239661     1.637207
-------------+----------------------------------------------------------------

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca,fe r

Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8746                                         min =         17
     Between = 0.6483                                         avg =       17.0
     Overall = 0.6993                                         max =         17

                                                F(9, 27)          =     274.25
corr(u_i, Xb) = -0.3877                         Prob > F          =     0.0000

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .6370234    .1681335      3.79    0.001      .2920421     .9820048
      ltwlab |    .1387786    .0624585      2.22    0.035      .0106242     .2669329
       ltpow |    .0577152    .0755568      0.76    0.452     -.0973146     .2127451
       ltfer |    .1826281     .043592      4.19    0.000      .0931846     .2720716
         hrs |    .2134022    .0391104      5.46    0.000      .1331542     .2936501
     mipric1 |    .0543577    .0590331      0.92    0.365     -.0667682     .1754837
     giprice |   -.0151451    .0245968     -0.62    0.543     -.0656135     .0353233
         mci |    .1943697    .0770515      2.52    0.018      .0362731     .3524663
        ngca |    .7562031    .3821261      1.98    0.058     -.0278549     1.540261
       _cons |    2.337895    .8552224      2.73    0.011       .583124     4.092667
-------------+----------------------------------------------------------------
     sigma_u |  .30549743
     sigma_e |  .10589274
         rho |  .89273901   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. estimates store FE_robust

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca,fe

Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8746                                         min =         17
     Between = 0.6483                                         avg =       17.0
     Overall = 0.6993                                         max =         17

                                                F(9, 439)         =     340.20
corr(u_i, Xb) = -0.3877                         Prob > F          =     0.0000

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .6370234    .0673191      9.46    0.000      .5047156     .7693312
      ltwlab |    .1387786    .0261554      5.31    0.000      .0873732      .190184
       ltpow |    .0577152    .0332508      1.74    0.083     -.0076352     .1230657
       ltfer |    .1826281    .0219921      8.30    0.000      .1394053      .225851
         hrs |    .2134022    .0223886      9.53    0.000         .1694     .2574043
     mipric1 |    .0543577    .0421659      1.29    0.198     -.0285145     .1372299
     giprice |   -.0151451    .0187457     -0.81    0.420     -.0519876     .0216975
         mci |    .1943697    .0876884      2.22    0.027      .0220285      .366711
        ngca |    .7562031    .2168141      3.49    0.001      .3300804     1.182326
       _cons |    2.337895     .385253      6.07    0.000      1.580726     3.095065
-------------+----------------------------------------------------------------
     sigma_u |  .30549743
     sigma_e |  .10589274
         rho |  .89273901   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------
F test that all u_i=0: F(27, 439) = 43.41                    Prob > F = 0.0000

.
. estimates store FE

.
. reg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca i.province,vce(cluster province)

Linear regression                               Number of obs     =        476
                                                F(8, 27)          =          .
                                                Prob > F          =          .
                                                R-squared         =     0.9642
                                                Root MSE          =     .10589

(Std. err. adjusted for 28 clusters in province)
--------------+----------------------------------------------------------------
              |               Robust
         ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
--------------+----------------------------------------------------------------
        ltlan |    .6370234    .1732267      3.68    0.001      .2815916     .9924553
       ltwlab |    .1387786    .0643506      2.16    0.040      .0067421     .2708151
        ltpow |    .0577152    .0778457      0.74    0.465     -.1020109     .2174414
        ltfer |    .1826281    .0449126      4.07    0.000      .0904751     .2747811
          hrs |    .2134022    .0402952      5.30    0.000      .1307233      .296081
      mipric1 |    .0543577    .0608214      0.89    0.379     -.0704375     .1791529
      giprice |   -.0151451    .0253419     -0.60    0.555     -.0671423     .0368522
          mci |    .1943697    .0793856      2.45    0.021      .0314839     .3572555
         ngca |    .7562031    .3937018      1.92    0.065     -.0516063     1.564013
              |
     province |
     beijing  |   -.1816498    .1247829     -1.46    0.157     -.4376832     .0743835
      fujian  |     .051657    .0501916      1.03    0.313     -.0513277     .1546418
       gansu  |   -.8165674    .1380808     -5.91    0.000     -1.099886    -.5332489
   guangdong  |    -.010488     .055811     -0.19    0.852     -.1250028     .1040268
     guangxi  |   -.2304637    .0570853     -4.04    0.000     -.3475932    -.1133342
     guizhou  |   -.2350768    .0615353     -3.82    0.001     -.3613369    -.1088167
       hebei  |   -.2923854    .0997217     -2.93    0.007     -.4969974    -.0877733
heilongjiang  |   -.1410195    .2892268     -0.49    0.630     -.7344638     .4524249
       henan  |   -.0904581    .0435714     -2.08    0.048     -.1798593    -.0010569
       hubei  |    .1118905    .0340584      3.29    0.003      .0420085     .1817725
       hunan  |   -.0373775    .0607647     -0.62    0.544     -.1620563     .0873014
     jiangsu  |    .1150954    .0342058      3.36    0.002      .0449109       .18528
     jiangxi  |   -.1352577    .0579781     -2.33    0.027     -.2542188    -.0162965
       jilin  |   -.2220282    .2253552     -0.99    0.333     -.6844189     .2403624
    liaoning  |   -.2789811     .172656     -1.62    0.118     -.6332419     .0752797
     neimong  |   -.9288069    .2561317     -3.63    0.001     -1.454346     -.403268
     ningxia  |   -.8813594    .1975659     -4.46    0.000     -1.286731    -.4759877
     qinghai  |   -.7062497    .1521719     -4.64    0.000     -1.018481    -.3940187
     shaanxi  |   -.3342067    .0925991     -3.61    0.001     -.5242045     -.144209
   shangdong  |   -.0049215    .0581511     -0.08    0.933     -.1242377     .1143947
    shanghai  |     .113901    .0648627      1.76    0.090     -.0191862     .2469882
      shanxi  |   -.5312338    .1514863     -3.51    0.002     -.8420581    -.2204095
     sichuan  |    .0251618    .0320732      0.78    0.440      -.040647     .0909707
     tianjin  |   -.3047612    .1190042     -2.56    0.016     -.5489376    -.0605848
    xinjiang  |   -.4007117    .2397817     -1.67    0.106     -.8927032     .0912797
      yunnan  |   -.2774542    .0632713     -4.39    0.000     -.4072763    -.1476321
    zhejiang  |    .1764445    .0822195      2.15    0.041       .007744      .345145
              |
        _cons |    2.568156    .8279625      3.10    0.004      .8693177     4.266995
--------------+----------------------------------------------------------------

.
. estimates store LSDV

.
. xtserial ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca,output

Linear regression                               Number of obs     =        420
                                                F(9, 27)          =     902.61
                                                Prob > F          =     0.0000
                                                R-squared         =     0.5797
                                                Root MSE          =     .11179

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
      D.ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |
         D1. |    .9807158    .0926143     10.59    0.000       .790687     1.170745
             |
      ltwlab |
         D1. |    .2420082    .0734117      3.30    0.003      .0913798     .3926366
             |
       ltpow |
         D1. |   -.0171023    .0747984     -0.23    0.821      -.170576     .1363714
             |
       ltfer |
         D1. |    .2768317    .0589799      4.69    0.000       .155815     .3978485
             |
         hrs |
         D1. |    .2427773    .0372382      6.52    0.000      .1663709     .3191837
             |
     mipric1 |
         D1. |    .0250908    .0357935      0.70    0.489     -.0483513     .0985329
             |
     giprice |
         D1. |   -.0157708     .021774     -0.72    0.475     -.0604473     .0289057
             |
         mci |
         D1. |    .1314675    .1260309      1.04    0.306     -.1271266     .3900616
             |
        ngca |
         D1. |   -.0260777    .4846049     -0.05    0.957     -1.020405     .9682494
-------------+----------------------------------------------------------------

Wooldridge test for autocorrelation in panel data
H0: no first order autocorrelation
    F(  1,      27) =     12.511
           Prob > F =      0.0015

.
. estimates store FD

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mipric1 giprice mci ngca t,fe r

Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8749                                         min =         17
     Between = 0.6490                                         avg =       17.0
     Overall = 0.7006                                         max =         17

                                                F(10, 27)         =     247.93
corr(u_i, Xb) = -0.3767                         Prob > F          =     0.0000

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .6517195    .1843858      3.53    0.001      .2733911     1.030048
      ltwlab |    .1431791    .0589267      2.43    0.022      .0222716     .2640866
       ltpow |    .0366317    .0991178      0.37    0.715     -.1667413     .2400047
       ltfer |     .180359    .0428995      4.20    0.000      .0923365     .2683816
         hrs |    .1916276    .0295596      6.48    0.000      .1309763     .2522789
     mipric1 |    .0198772    .0515121      0.39    0.703     -.0858168     .1255713
     giprice |    -.026268    .0226875     -1.16    0.257     -.0728189     .0202829
         mci |    .2014685     .078794      2.56    0.016      .0397965     .3631404
        ngca |    .6761116     .421738      1.60    0.121     -.1892234     1.541447
           t |    .0063068    .0106492      0.59    0.559     -.0155436     .0281572
       _cons |     2.36174    .8262751      2.86    0.008      .6663633     4.057116
-------------+----------------------------------------------------------------
     sigma_u |  .30327958
     sigma_e |  .10589784
         rho |  .89132628   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. estimates store FE_trend

.
. tab year,gen(year_)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
         70 |         28        5.56        5.56
         71 |         28        5.56       11.11
         72 |         28        5.56       16.67
         73 |         28        5.56       22.22
         74 |         28        5.56       27.78
         75 |         28        5.56       33.33
         76 |         28        5.56       38.89
         77 |         28        5.56       44.44
         78 |         28        5.56       50.00
         79 |         28        5.56       55.56
         80 |         28        5.56       61.11
         81 |         28        5.56       66.67
         82 |         28        5.56       72.22
         83 |         28        5.56       77.78
         84 |         28        5.56       83.33
         85 |         28        5.56       88.89
         86 |         28        5.56       94.44
         87 |         28        5.56      100.00
------------+-----------------------------------
      Total |        504      100.00

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca year_2-year_18,fe r


note: year_11 omitted because of collinearity.


Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8932                                         min =         17
     Between = 0.6596                                         avg =       17.0
     Overall = 0.7156                                         max =         17

                                                F(23, 27)         =     949.82
corr(u_i, Xb) = -0.3425                         Prob > F          =     0.0000

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .5833594    .1745834      3.34    0.002      .2251439     .9415749
      ltwlab |    .1514909    .0585107      2.59    0.015      .0314368      .271545
       ltpow |    .0971114     .090911      1.07    0.295     -.0894225     .2836453
       ltfer |    .1693346    .0438098      3.87    0.001      .0794444     .2592248
         hrs |    .1503752    .0587581      2.56    0.016      .0298136     .2709368
         mci |    .1978373    .0810587      2.44    0.022      .0315186      .364156
        ngca |    .7784081    .4016301      1.94    0.063     -.0456688     1.602485
      year_2 |   -.0240404     .023366     -1.03    0.313     -.0719836     .0239027
      year_3 |   -.1323624    .0404832     -3.27    0.003     -.2154272    -.0492977
      year_4 |   -.0377336    .0357883     -1.05    0.301      -.111165     .0356979
      year_5 |    .0058554    .0500774      0.12    0.908      -.096895     .1086058
      year_6 |    .0096731    .0566898      0.17    0.866     -.1066448     .1259911
      year_7 |   -.0476465     .061423     -0.78    0.445     -.1736761     .0783832
      year_8 |   -.0869336    .0680579     -1.28    0.212     -.2265767     .0527096
      year_9 |   -.0325205    .0766428     -0.42    0.675     -.1897785     .1247376
     year_10 |   -.0076332    .0833462     -0.09    0.928     -.1786454      .163379
     year_11 |           0   (omitted)
     year_12 |    -.093479    .1093614     -0.85    0.400     -.3178701     .1309121
     year_13 |   -.0447862    .1207405     -0.37    0.714     -.2925251     .2029528
     year_14 |   -.0309435    .1377207     -0.22    0.824      -.313523     .2516361
     year_15 |    .0442535    .1428764      0.31    0.759     -.2489048     .3374117
     year_16 |   -.0033372    .1561209     -0.02    0.983     -.3236709     .3169965
     year_17 |      .00484     .157992      0.03    0.976     -.3193329     .3290129
     year_18 |    .0386475    .1639608      0.24    0.815     -.2977723     .3750674
       _cons |    2.651286    .7738994      3.43    0.002      1.063376     4.239196
-------------+----------------------------------------------------------------
     sigma_u |  .29344594
     sigma_e |  .09930555
         rho |  .89724523   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. estimates store FE_TW

.
. test year_2 year_3 year_4 year_5 year_6 year_7 year_8 year_9 year_10 year_12 year_13 year_14 year_15 year_16 year_17 year_18


 ( 1)  year_2 = 0


 ( 2)  year_3 = 0


 ( 3)  year_4 = 0


 ( 4)  year_5 = 0


 ( 5)  year_6 = 0


 ( 6)  year_7 = 0


 ( 7)  year_8 = 0


 ( 8)  year_9 = 0


 ( 9)  year_10 = 0


 (10)  year_12 = 0


 (11)  year_13 = 0


 (12)  year_14 = 0


 (13)  year_15 = 0


 (14)  year_16 = 0


 (15)  year_17 = 0


 (16)  year_18 = 0


       F( 16,    27) =   14.82
            Prob > F =    0.0000

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca i.year,fe r

Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8932                                         min =         17
     Between = 0.6596                                         avg =       17.0
     Overall = 0.7156                                         max =         17

                                                F(23, 27)         =     949.82
corr(u_i, Xb) = -0.3425                         Prob > F          =     0.0000

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .5833594    .1745834      3.34    0.002      .2251439     .9415749
      ltwlab |    .1514909    .0585107      2.59    0.015      .0314368      .271545
       ltpow |    .0971114     .090911      1.07    0.295     -.0894225     .2836453
       ltfer |    .1693346    .0438098      3.87    0.001      .0794444     .2592248
         hrs |    .1503752    .0587581      2.56    0.016      .0298136     .2709368
         mci |    .1978373    .0810587      2.44    0.022      .0315186      .364156
        ngca |    .7784081    .4016301      1.94    0.063     -.0456688     1.602485
             |
        year |
         71  |   -.0240404     .023366     -1.03    0.313     -.0719836     .0239027
         72  |   -.1323624    .0404832     -3.27    0.003     -.2154272    -.0492977
         73  |   -.0377336    .0357883     -1.05    0.301      -.111165     .0356979
         74  |    .0058554    .0500774      0.12    0.908      -.096895     .1086058
         75  |    .0096731    .0566898      0.17    0.866     -.1066448     .1259911
         76  |   -.0476465     .061423     -0.78    0.445     -.1736761     .0783832
         77  |   -.0869336    .0680579     -1.28    0.212     -.2265767     .0527096
         78  |   -.0325205    .0766428     -0.42    0.675     -.1897785     .1247376
         79  |   -.0076332    .0833462     -0.09    0.928     -.1786454      .163379
         81  |    -.093479    .1093614     -0.85    0.400     -.3178701     .1309121
         82  |   -.0447862    .1207405     -0.37    0.714     -.2925251     .2029528
         83  |   -.0309435    .1377207     -0.22    0.824      -.313523     .2516361
         84  |    .0442535    .1428764      0.31    0.759     -.2489048     .3374117
         85  |   -.0033372    .1561209     -0.02    0.983     -.3236709     .3169965
         86  |      .00484     .157992      0.03    0.976     -.3193329     .3290129
         87  |    .0386475    .1639608      0.24    0.815     -.2977723     .3750674
             |
       _cons |    2.651286    .7738994      3.43    0.002      1.063376     4.239196
-------------+----------------------------------------------------------------
     sigma_u |  .29344594
     sigma_e |  .09930555
         rho |  .89724523   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,re r theta

Random-effects GLS regression                   Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8700                                         min =         17
     Between = 0.8135                                         avg =       17.0
     Overall = 0.8263                                         max =         17

                                                Wald chi2(7)      =    2452.50
corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
theta        = .81012778

(Std. err. adjusted for 28 clusters in province)
-------------+----------------------------------------------------------------
             |               Robust
        ltvfo | Coefficient   std. err.       z    P>|z|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .5655915    .1089863      5.19    0.000      .3519823     .7792007
      ltwlab |    .1441844    .0462225      3.12    0.002      .0535899      .234779
       ltpow |     .060477    .0508828      1.19    0.235     -.0392515     .1602055
       ltfer |    .1882741    .0386418      4.87    0.000      .1125376     .2640107
         hrs |    .2186096    .0377121      5.80    0.000      .1446952     .2925241
         mci |    .4702368    .0836862      5.62    0.000       .306215     .6342587
        ngca |    .6745175    .3663329      1.84    0.066     -.0434818     1.392517
       _cons |    2.387878    .5672669      4.21    0.000      1.276055     3.499701
-------------+----------------------------------------------------------------
     sigma_u |  .13324845
     sigma_e |  .10624809
         rho |   .6113231   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. estimates store RE_robust

.
. xttest0

Breusch and Pagan Lagrangian multiplier test for random effects

        ltvfo[province,t] = Xb + u[province] + e[province,t]

        Estimated results:
                         |       Var     SD = sqrt(Var)
                ---------+-----------------------------
                   ltvfo |   .2893078       .5378734
                       e |   .0112887       .1062481
                       u |   .0177551       .1332484

        Test: Var(u) = 0
                             chibar2(01) =  1235.75
                          Prob > chibar2 =   0.0000

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,re

Random-effects GLS regression                   Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8700                                         min =         17
     Between = 0.8135                                         avg =       17.0
     Overall = 0.8263                                         max =         17

                                                Wald chi2(7)      =    2981.73
corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       z    P>|z|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .5655915    .0478214     11.83    0.000      .4718633     .6593196
      ltwlab |    .1441844    .0233398      6.18    0.000      .0984394     .1899295
       ltpow |     .060477    .0252917      2.39    0.017      .0109062     .1100478
       ltfer |    .1882741    .0208337      9.04    0.000      .1474408     .2291075
         hrs |    .2186096    .0216932     10.08    0.000      .1760918     .2611275
         mci |    .4702368     .064681      7.27    0.000      .3434643     .5970093
        ngca |    .6745175    .2121571      3.18    0.001      .2586973     1.090338
       _cons |    2.387878    .2895274      8.25    0.000      1.820414     2.955341
-------------+----------------------------------------------------------------
     sigma_u |  .13324845
     sigma_e |  .10624809
         rho |   .6113231   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------

.
. estimates store RE

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,mle nolog

 Random-effects ML regression                        Number of obs    = 476
 Group variable: province                            Number of groups    = 28

 Random effects u_i ~ Gaussian                       Obs per group:
                                                     min              = 17
                                                     avg              = 17.0
                                                     max              = 17

                                                     LR chi2(7)       = 961.00
 Log likelihood    = 332.89739                       Prob > chi2      = 0.0000

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       z    P>|z|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .5643288    .0518396     10.89    0.000       .462725     .6659326
      ltwlab |    .1408974    .0235161      5.99    0.000      .0948067     .1869882
       ltpow |    .0717013    .0248585      2.88    0.004      .0229794     .1204231
       ltfer |    .1772027    .0206075      8.60    0.000      .1368127     .2175927
         hrs |    .2153264     .020987     10.26    0.000      .1741926     .2564602
         mci |    .4064832    .0712859      5.70    0.000      .2667654      .546201
        ngca |    .7149811    .2105466      3.40    0.001      .3023172     1.127645
       _cons |    2.490512    .3039688      8.19    0.000      1.894744      3.08628
-------------+----------------------------------------------------------------
    /sigma_u |    .2141094    .0317827                    .1600597     .2864107
    /sigma_e |    .1061021    .0035665                    .0993371     .1133278
         rho |    .8028448    .0486812                    .6942946     .8840722
-------------+----------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 464.22             Prob >= chibar2 = 0.000

.
. estimates store MLE

.
. hausman FE RE,constant sigmamore

                 ---- Coefficients ----
             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
             |       FE           RE         Difference       Std. err.
-------------+----------------------------------------------------------------
       ltlan |    .6370234     .5655915        .0714319        .0522174
      ltwlab |    .1387786     .1441844       -.0054059        .0145627
       ltpow |    .0577152      .060477       -.0027618        .0241549
       ltfer |    .1826281     .1882741        -.005646        .0100505
         hrs |    .2134022     .2186096       -.0052075        .0091613
         mci |    .1943697     .4702368       -.2758671        .0657487
        ngca |    .7562031     .6745175        .0816856         .083631
       _cons |    2.337895     2.387878       -.0499825        .2834941
-------------+----------------------------------------------------------------
b = Consistent under H0 and Ha; obtained from xtreg.
B = Inconsistent under Ha, efficient under H0; obtained from xtreg.

Test of H0: Difference in coefficients not systematic

chi2(8)   = (b-B)'[(V_b-V_B)^(-1)](b-B)
   = 38.56
Prob > chi2   = 0.0000
(V_b-V_B is not positive definite)

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,fe

Fixed-effects (within) regression               Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.8732                                         min =         17
     Between = 0.6650                                         avg =       17.0
     Overall = 0.7135                                         max =         17

                                                F(7, 441)         =     433.77
corr(u_i, Xb) = -0.3549                         Prob > F          =     0.0000

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .6399658    .0644132      9.94    0.000      .5133708     .7665608
      ltwlab |    .1239927    .0252933      4.90    0.000      .0742824      .173703
       ltpow |    .0771604    .0253406      3.04    0.002       .027357     .1269638
       ltfer |    .1762775    .0212356      8.30    0.000       .134542      .218013
         hrs |    .2075817    .0212974      9.75    0.000      .1657246     .2494388
         mci |    .2580359    .0831122      3.10    0.002      .0946907     .4213811
        ngca |    .7722795    .2172755      3.55    0.000      .3452553     1.199304
       _cons |    2.310114    .3399789      6.79    0.000      1.641934     2.978294
-------------+----------------------------------------------------------------
     sigma_u |  .29277754
     sigma_e |  .10624809
         rho |  .88363091   (fraction of variance due to u_i)
-------------+----------------------------------------------------------------
F test that all u_i=0: F(27, 441) = 43.54                    Prob > F = 0.0000

.
. estimates store FE_hausman

.
. hausman FE_hausman RE,constant sigmamore

                 ---- Coefficients ----
             |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
             |   FE_hausman       RE         Difference       Std. err.
-------------+----------------------------------------------------------------
       ltlan |    .6399658     .5655915        .0743743        .0476709
      ltwlab |    .1239927     .1441844       -.0201917        .0125808
       ltpow |    .0771604      .060477        .0166834        .0081232
       ltfer |    .1762775     .1882741       -.0119966        .0078425
         hrs |    .2075817     .2186096       -.0110279        .0052769
         mci |    .2580359     .4702368       -.2122009        .0583709
        ngca |    .7722795     .6745175         .097762        .0828671
       _cons |    2.310114     2.387878       -.0777638        .2078242
-------------+----------------------------------------------------------------
b = Consistent under H0 and Ha; obtained from xtreg.
B = Inconsistent under Ha, efficient under H0; obtained from xtreg.

Test of H0: Difference in coefficients not systematic

chi2(8)   = (b-B)'[(V_b-V_B)^(-1)](b-B)
   = 48.49
Prob > chi2   = 0.0000
(V_b-V_B is not positive definite)

.
. quietly xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,r

.
. xtoverid

Test of overidentifying restrictions: fixed vs random effects
Cross-section time-series model: xtreg re  robust cluster(province)
Sargan-Hansen statistic 221.225  Chi-sq(7)    P-value = 0.0000

.
. xtreg ltvfo ltlan ltwlab ltpow ltfer hrs mci ngca,be

Between regression (regression on group means)  Number of obs     =        476
Group variable: province                        Number of groups  =         28

R-squared:                                      Obs per group:
     Within  = 0.4673                                         min =         17
     Between = 0.9362                                         avg =       17.0
     Overall = 0.0232                                         max =         17

                                                F(7,20)           =      41.93
sd(u_i + avg(e_i.)) = .1357173                  Prob > F          =     0.0000

-------------+----------------------------------------------------------------
        ltvfo | Coefficient   Std. err.       t    P>|t|      [95% con f. interval]
-------------+----------------------------------------------------------------
       ltlan |    .7021718    .1177241      5.96    0.000      .4566037     .9477398
      ltwlab |    .5020747    .0940029      5.34    0.000      .3059881     .6981612
       ltpow |   -.1511518    .1188815     -1.27    0.218     -.3991344     .0968307
       ltfer |    .1132485    .0976941      1.16    0.260     -.0905377     .3170347
         hrs |   -3.757418    1.242961     -3.02    0.007     -6.350189    -1.164647
         mci |     .586029    .1838616      3.19    0.005      .2025005     .9695575
        ngca |    .4443814    .6565795      0.68    0.506     -.9252194     1.813982
       _cons |    2.432839    1.005985      2.42    0.025      .3343904     4.531288
-------------+----------------------------------------------------------------

.
. esttab OLS FE_robust FE_trend FE RE,b se mtitle

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)
                      OLS       FE_robust        FE_trend              FE              RE
--------------------------------------------------------------------------------------------
ltlan               0.694***        0.637***        0.652**         0.637***        0.566***
             (0.115)      (0.168)      (0.184)      (0.0673)      (0.0478)

ltwlab              0.265***        0.139*          0.143*          0.139***        0.144***
             (0.0566)      (0.0625)      (0.0589)      (0.0262)      (0.0233)

ltpow             -0.0292          0.0577          0.0366          0.0577          0.0605*
             (0.0670)      (0.0756)      (0.0991)      (0.0333)      (0.0253)

ltfer               0.311***        0.183***        0.180***        0.183***        0.188***
             (0.0531)      (0.0436)      (0.0429)      (0.0220)      (0.0208)

hrs                 0.229***        0.213***        0.192***        0.213***        0.219***
             (0.0489)      (0.0391)      (0.0296)      (0.0224)      (0.0217)

mipric1            0.0122          0.0544          0.0199          0.0544
             (0.0548)      (0.0590)      (0.0515)      (0.0422)

giprice           -0.0539         -0.0151         -0.0263         -0.0151
             (0.0274)      (0.0246)      (0.0227)      (0.0187)

mci                 0.695***        0.194*          0.201*          0.194*          0.470***
             (0.169)      (0.0771)      (0.0788)      (0.0877)      (0.0647)

ngca                0.305           0.756           0.676           0.756***        0.675**
             (0.522)      (0.382)      (0.422)      (0.217)      (0.212)

t                                                 0.00631
                                             (0.0106)

_cons               1.081           2.338*          2.362**         2.338***        2.388***
             (0.827)      (0.855)      (0.826)      (0.385)      (0.290)
--------------------------------------------------------------------------------------------
N                     476             476             476             476             476
--------------------------------------------------------------------------------------------
Standard errors in parentheses
* p<0.05, ** p<0.01, *** p<0.001

.
. esttab OLS FE_robust FE_trend FE_hausman RE,b se mtitle

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)
                      OLS       FE_robust        FE_trend      FE_hausman              RE
--------------------------------------------------------------------------------------------
ltlan               0.694***        0.637***        0.652**         0.640***        0.566***
             (0.115)      (0.168)      (0.184)      (0.0644)      (0.0478)

ltwlab              0.265***        0.139*          0.143*          0.124***        0.144***
             (0.0566)      (0.0625)      (0.0589)      (0.0253)      (0.0233)

ltpow             -0.0292          0.0577          0.0366          0.0772**        0.0605*
             (0.0670)      (0.0756)      (0.0991)      (0.0253)      (0.0253)

ltfer               0.311***        0.183***        0.180***        0.176***        0.188***
             (0.0531)      (0.0436)      (0.0429)      (0.0212)      (0.0208)

hrs                 0.229***        0.213***        0.192***        0.208***        0.219***
             (0.0489)      (0.0391)      (0.0296)      (0.0213)      (0.0217)

mipric1            0.0122          0.0544          0.0199
             (0.0548)      (0.0590)      (0.0515)

giprice           -0.0539         -0.0151         -0.0263
             (0.0274)      (0.0246)      (0.0227)

mci                 0.695***        0.194*          0.201*          0.258**         0.470***
             (0.169)      (0.0771)      (0.0788)      (0.0831)      (0.0647)

ngca                0.305           0.756           0.676           0.772***        0.675**
             (0.522)      (0.382)      (0.422)      (0.217)      (0.212)

t                                                 0.00631
                                             (0.0106)

_cons               1.081           2.338*          2.362**         2.310***        2.388***
             (0.827)      (0.855)      (0.826)      (0.340)      (0.290)
--------------------------------------------------------------------------------------------
N                     476             476             476             476             476
--------------------------------------------------------------------------------------------
Standard errors in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. log close
      name:  <unnamed>
       log:  D:\Program Files\Stata18\第12章.smcl
  log type:  smcl
 closed on:  24 Jan 2024, 16:24:43
-------------