全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
8262 5
2016-02-04
面板数据设置了年份、行业、地区三个虚拟变量,代码如下:

tabulate provinceid,gen(PRO)

tabulate industry_4 , gen(IND)

tabulate  year,gen(REG)

drop REG1

drop IND1

drop PRO1

xtreg  lresearch vsum hhilnlabor1 ros1 lsubsidy soe private foreign REG* PRO* IND*,fe

三个虚拟变量都出现共线性问题:

结果如下:

xtreg  lresearch vsum hhi lnlabor1 ros1 lsubsidy soe private foreign REG* PRO* IND*,fe

note: REG2 omitted because of collinearity

note: REG3 omitted because of collinearity

note: REG6 omitted because of collinearity

note: REG7 omitted because of collinearity

note: PRO2 omitted because of collinearity

note: PRO3 omitted because of collinearity

note: PRO4 omitted because of collinearity

note: PRO5 omitted because of collinearity

note: PRO6 omitted because of collinearity

note: PRO7 omitted because of collinearity

note: PRO8 omitted because of collinearity

note: PRO9 omitted because of collinearity

note: PRO10 omitted because of collinearity

note: PRO11 omitted because of collinearity

note: PRO12 omitted because of collinearity

note: PRO13 omitted because of collinearity

note: PRO14 omitted because of collinearity

note: PRO15 omitted because of collinearity

note: PRO16 omitted because of collinearity

note: PRO17 omitted because of collinearity

note: PRO18 omitted because of collinearity

note: PRO19 omitted because of collinearity

note: PRO20 omitted because of collinearity

note: PRO21 omitted because of collinearity

note: PRO22 omitted because of collinearity

note: PRO23 omitted because of collinearity

note: PRO24 omitted because of collinearity

note: PRO25 omitted because of collinearity

note: PRO26 omitted because of collinearity

note: PRO27 omitted because of collinearity

note: PRO28 omitted because of collinearity

note: PRO29 omitted because of collinearity

note: IND2 omitted because of collinearity

note: IND3 omitted because of collinearity

note: IND4 omitted because of collinearity

note: IND5 omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =       339

Group variable: id                              Number of groups   =       249

R-sq:  within  = 0.2790                         Obs per group: min =         1

       between = 0.0290                                        avg =       1.4

       overall = 0.0524                                        max =         3

                                                F(10,80)           =      3.10

corr(u_i, Xb)  = -0.2694                        Prob > F           =    0.0022

------------------------------------------------------------------------------

   lresearch |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

-------------+----------------------------------------------------------------

        vsum |   .0015206   .0027876     0.55   0.587    -.0040269    .0070681

         hhi |   .5849587   13.10891     0.04   0.965     -25.5026    26.67252

    lnlabor1 |   .0933548   .3189847     0.29   0.771    -.5414449    .7281546

        ros1 |  -.7806015   .8556584    -0.91   0.364    -2.483416     .922213

    lsubsidy |  -.1140379   .0848694    -1.34   0.183    -.2829333    .0548575

         soe |   .6553425    .629896     1.04   0.301    -.5981904    1.908876

     private |   .8968121   .3547705     2.53   0.013     .1907963    1.602828

     foreign |   1.857314   1.202142     1.55   0.126    -.5350247    4.249654

        REG2 |          0  (omitted)

        REG3 |          0  (omitted)

        REG4 |  -1.331041   .4414639    -3.02   0.003    -2.209582   -.4524997

        REG5 |  -1.148099   .4552052    -2.52   0.014    -2.053987   -.2422121

        REG6 |          0  (omitted)

        REG7 |          0  (omitted)

        PRO2 |          0  (omitted)

        PRO3 |          0  (omitted)

        PRO4 |          0  (omitted)

        PRO5 |          0  (omitted)

        PRO6 |          0  (omitted)

        PRO7 |          0  (omitted)

        PRO8 |          0  (omitted)

        PRO9 |          0  (omitted)

       PRO10 |          0  (omitted)

       PRO11 |          0  (omitted)

       PRO12 |          0  (omitted)

       PRO13 |          0  (omitted)

       PRO14 |          0  (omitted)

       PRO15 |          0  (omitted)

       PRO16 |          0  (omitted)

       PRO17 |          0  (omitted)

       PRO18 |          0  (omitted)

       PRO19 |          0  (omitted)

       PRO20 |          0  (omitted)

       PRO21 |          0  (omitted)

       PRO22 |          0  (omitted)

       PRO23 |          0  (omitted)

       PRO24 |          0  (omitted)

       PRO25 |          0  (omitted)

       PRO26 |          0  (omitted)

       PRO27 |          0  (omitted)

       PRO28 |          0  (omitted)

       PRO29 |          0  (omitted)

        IND2 |          0  (omitted)

        IND3 |          0  (omitted)

        IND4 |          0  (omitted)

        IND5 |          0  (omitted)

       _cons |   7.362842   1.906623     3.86   0.000      3.56854    11.15714

-------------+----------------------------------------------------------------

     sigma_u |  2.2161597

     sigma_e |  .77200962

         rho |  .89178144   (fraction of variance due to u_i)

------------------------------------------------------------------------------

F test that all u_i=0:     F(248, 80) =     6.22             Prob > F = 0.0000

.

求问如何解决


附件列表
gongxianxing.PNG

原图尺寸 24.28 KB

gongxianxing.PNG

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2016-2-4 22:10:06
由于你选择的是FE估计,而设定的虚拟变量全部都相当于截距项发生变化,所以stata估计不出来你的虚拟变量的参数。(类似于虚拟变量与individual effect线性相关了)。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-2-4 22:22:20
liuzhen123123 发表于 2016-2-4 22:10
由于你选择的是FE估计,而设定的虚拟变量全部都相当于截距项发生变化,所以stata估计不出来你的虚拟变量的参 ...
不是很明白,怎样才是正确的做法呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-2-4 23:53:01
YouHeBK 发表于 2016-2-4 22:22
不是很明白,怎样才是正确的做法呢
用随机效应RE
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-2-5 10:17:00
liuzhen123123 发表于 2016-2-4 23:53
用随机效应RE
用随机效应共线性问题确实变小了,但问题依然存在,结果如下:
xtreg  lresearch vsum hhi lnlabor1 ros1 lsubsidy soe private foreign REG* PRO* IND*,re
note: REG2 omitted because of collinearity
note: REG5 omitted because of collinearity
note: REG6 omitted because of collinearity
note: REG7 omitted because of collinearity
note: PRO7 omitted because of collinearity
note: PRO21 omitted because of collinearity
note: PRO24 omitted because of collinearity
note: PRO28 omitted because of collinearity
note: PRO29 omitted because of collinearity

Random-effects GLS regression                   Number of obs      =       339
Group variable: id                              Number of groups   =       249

R-sq:  within  = 0.0979                         Obs per group: min =         1
       between = 0.4767                                        avg =       1.4
       overall = 0.4892                                        max =         3

                                                Wald chi2(37)      =    198.77
corr(u_i, X)   = 0 (assumed)                    Prob > chi2        =    0.0000

------------------------------------------------------------------------------
   lresearch |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        vsum |   .0023162   .0025001     0.93   0.354     -.002584    .0072164
         hhi |   .4577016   11.60256     0.04   0.969    -22.28289    23.19829
    lnlabor1 |   .7070137   .0906137     7.80   0.000     .5294141    .8846133
        ros1 |   .5586112   .3730528     1.50   0.134    -.1725589    1.289781
    lsubsidy |   .1071422   .0472872     2.27   0.023     .0144611    .1998233
         soe |    .049736   .4381083     0.11   0.910    -.8089406    .9084126
     private |    .472537   .2165465     2.18   0.029     .0481136    .8969603
     foreign |   .5193684   .3211996     1.62   0.106    -.1101712    1.148908
        REG2 |          0  (omitted)
        REG3 |   .5866695   .3710565     1.58   0.114    -.1405879    1.313927
        REG4 |  -.0356062   .2204048    -0.16   0.872    -.4675916    .3963793
        REG5 |          0  (omitted)
        REG6 |          0  (omitted)
        REG7 |          0  (omitted)
        PRO2 |  -.6727465   .8511793    -0.79   0.429    -2.341027    .9955344
        PRO3 |  -2.075265   .9074633    -2.29   0.022     -3.85386   -.2966692
        PRO4 |  -3.220087   1.281755    -2.51   0.012    -5.732281   -.7078925
        PRO5 |    2.12665   1.776995     1.20   0.231    -1.356196    5.609496
        PRO6 |  -2.515329   1.225881    -2.05   0.040    -4.918011   -.1126462
        PRO7 |          0  (omitted)
        PRO8 |  -.7254231   1.222893    -0.59   0.553    -3.122249    1.671403
        PRO9 |  -.5656478   .5345239    -1.06   0.290    -1.613296    .4819998
       PRO10 |  -.0858753   .5785998    -0.15   0.882     -1.21991    1.048159
       PRO11 |  -1.511633   .4366466    -3.46   0.001    -2.367445   -.6558217
       PRO12 |  -1.928918   .8022319    -2.40   0.016    -3.501264   -.3565726
       PRO13 |  -1.064023   .4804511    -2.21   0.027     -2.00569   -.1223562
       PRO14 |  -.5838177   1.297846    -0.45   0.653     -3.12755    1.959914
       PRO15 |  -.2423671   1.069616    -0.23   0.821    -2.338775    1.854041
       PRO16 |  -2.673526   1.279329    -2.09   0.037    -5.180965   -.1660873
       PRO17 |  -1.201143   .9399534    -1.28   0.201    -3.043418    .6411313
       PRO18 |  -2.370076   .7735942    -3.06   0.002    -3.886292   -.8538589
       PRO19 |  -.8302714   .4065542    -2.04   0.041    -1.627103   -.0334398
       PRO20 |  -2.275143   .8350239    -2.72   0.006     -3.91176   -.6385266
       PRO21 |          0  (omitted)
       PRO22 |   -1.97852   1.067705    -1.85   0.064    -4.071184    .1141429
       PRO23 |  -.9463541   .4851692    -1.95   0.051    -1.897268    .0045601
       PRO24 |          0  (omitted)
       PRO25 |  -1.086027   1.235169    -0.88   0.379    -3.506913    1.334859
       PRO26 |  -.9099553   1.244921    -0.73   0.465    -3.349955    1.530045
       PRO27 |  -1.400949   1.765517    -0.79   0.427    -4.861299    2.059401
       PRO28 |          0  (omitted)
       PRO29 |          0  (omitted)
        IND2 |  -2.693401    2.18549    -1.23   0.218    -6.976883    1.590081
        IND3 |  -.2242765    .595456    -0.38   0.706    -1.391349    .9427958
        IND4 |  -1.336956   1.935964    -0.69   0.490    -5.131376    2.457463
        IND5 |  -.6220279   .6795258    -0.92   0.360    -1.953874    .7098182
       _cons |   3.279821    .761345     4.31   0.000     1.787612     4.77203
-------------+----------------------------------------------------------------
     sigma_u |  1.4658252
     sigma_e |  .77200962
         rho |   .7828501   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. xtreg  lresearch vsum hhi lnlabor1 ros1 lsubsidy soe private foreign REG* PRO* IND*,re robust
note: REG2 omitted because of collinearity
note: REG5 omitted because of collinearity
note: REG6 omitted because of collinearity
note: REG7 omitted because of collinearity
note: PRO7 omitted because of collinearity
note: PRO21 omitted because of collinearity
note: PRO24 omitted because of collinearity
note: PRO28 omitted because of collinearity
note: PRO29 omitted because of collinearity

Random-effects GLS regression                   Number of obs      =       339
Group variable: id                              Number of groups   =       249

R-sq:  within  = 0.0979                         Obs per group: min =         1
       between = 0.4767                                        avg =       1.4
       overall = 0.4892                                        max =         3

                                                Wald chi2(36)      =         .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2        =         .

                                   (Std. Err. adjusted for 249 clusters in id)
------------------------------------------------------------------------------
             |               Robust
   lresearch |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        vsum |   .0023162   .0029899     0.77   0.439    -.0035439    .0081762
         hhi |   .4577016   12.24461     0.04   0.970    -23.54129    24.45669
    lnlabor1 |   .7070137   .0975989     7.24   0.000     .5157234     .898304
        ros1 |   .5586112   .6028119     0.93   0.354    -.6228785    1.740101
    lsubsidy |   .1071422   .0503156     2.13   0.033     .0085255    .2057589
         soe |    .049736   .4451589     0.11   0.911    -.8227594    .9222313
     private |    .472537   .1811693     2.61   0.009     .1174517    .8276222
     foreign |   .5193684    .368236     1.41   0.158    -.2023608    1.241098
        REG2 |          0  (omitted)
        REG3 |   .5866695    .568013     1.03   0.302    -.5266155    1.699954
        REG4 |  -.0356062   .2409854    -0.15   0.883    -.5079288    .4367165
        REG5 |          0  (omitted)
        REG6 |          0  (omitted)
        REG7 |          0  (omitted)
        PRO2 |  -.6727465   .9122044    -0.74   0.461    -2.460634    1.115141
        PRO3 |  -2.075265    .510092    -4.07   0.000    -3.075027   -1.075503
        PRO4 |  -3.220087   .4321022    -7.45   0.000    -4.066991   -2.373182
        PRO5 |    2.12665   .4125928     5.15   0.000     1.317983    2.935317
        PRO6 |  -2.515329   .4402904    -5.71   0.000    -3.378282   -1.652376
        PRO7 |          0  (omitted)
        PRO8 |  -.7254231   .4408533    -1.65   0.100     -1.58948    .1386335
        PRO9 |  -.5656478   .4996717    -1.13   0.258    -1.544986    .4136906
       PRO10 |  -.0858753   .5266995    -0.16   0.870    -1.118187    .9464368
       PRO11 |  -1.511633   .4578593    -3.30   0.001    -2.409021   -.6142456
       PRO12 |  -1.928918    1.09084    -1.77   0.077    -4.066926    .2090889
       PRO13 |  -1.064023   .4067766    -2.62   0.009    -1.861291   -.2667554
       PRO14 |  -.5838177   1.183184    -0.49   0.622    -2.902816    1.735181
       PRO15 |  -.2423671   1.150534    -0.21   0.833    -2.497372    2.012638
       PRO16 |  -2.673526   .7326455    -3.65   0.000    -4.109485   -1.237567
       PRO17 |  -1.201143     .98684    -1.22   0.224    -3.135314    .7330274
       PRO18 |  -2.370076   .4152416    -5.71   0.000    -3.183934   -1.556217
       PRO19 |  -.8302714   .3690541    -2.25   0.024    -1.553604   -.1069386
       PRO20 |  -2.275143   .6470113    -3.52   0.000    -3.543262   -1.007024
       PRO21 |          0  (omitted)
       PRO22 |   -1.97852   1.178987    -1.68   0.093    -4.289292    .3322513
       PRO23 |  -.9463541   .5248294    -1.80   0.071    -1.975001    .0822926
       PRO24 |          0  (omitted)
       PRO25 |  -1.086027   .7809961    -1.39   0.164    -2.616752    .4446969
       PRO26 |  -.9099553   .8910542    -1.02   0.307    -2.656389    .8364789
       PRO27 |  -1.400949     .36499    -3.84   0.000    -2.116316   -.6855817
       PRO28 |          0  (omitted)
       PRO29 |          0  (omitted)
        IND2 |  -2.693401   2.029495    -1.33   0.184    -6.671138    1.284337
        IND3 |  -.2242765   .6368778    -0.35   0.725    -1.472534    1.023981
        IND4 |  -1.336956   2.286117    -0.58   0.559    -5.817663     3.14375
        IND5 |  -.6220279   .7417812    -0.84   0.402    -2.075892    .8318365
       _cons |   3.279821   .7492114     4.38   0.000     1.811394    4.748248
-------------+----------------------------------------------------------------
     sigma_u |  1.4658252
     sigma_e |  .77200962
         rho |   .7828501   (fraction of variance due to u_i)
------------------------------------------------------------------------------

.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2016-5-16 12:03:34
liuzhen123123 发表于 2016-2-4 23:53
用随机效应RE
不应该设置省份虚拟变量,因为你用固定效应,就已经是在处理个体效应了。加入省份虚拟变量还是为了控制个体效应。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群