全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
14644 29
2018-01-16
求助大神们,固定效应中加入行业虚拟变量而且也drop掉了第一个行业,但是为什么回归时显示剩余的行业虚拟变量全部被omitted呢?(数据放在附件了)
我的代码及结果:. xtset company year       panel variable:  company (unbalanced)
        time variable:  year, 2011 to 2016
                delta:  1 unit

. tab indus_sw,gen(ind_sw)

   indus_sw |      Freq.     Percent        Cum.
------------+-----------------------------------
       采掘 |         18        0.53        0.53
       传媒 |        120        3.52        4.05
   电气设备 |        306        8.98       13.02
       电子 |        311        9.12       22.15
     房地产 |          6        0.18       22.32
   纺织服装 |        168        4.93       27.25
       钢铁 |         24        0.70       27.96
   公用事业 |         30        0.88       28.84
   国防军工 |         35        1.03       29.86
       化工 |        389       11.41       41.27
   机械设备 |        388       11.38       52.65
     计算机 |        198        5.81       58.46
   家用电器 |        137        4.02       62.48
   建筑材料 |        132        3.87       66.35
   建筑装饰 |        102        2.99       69.35
   交通运输 |         18        0.53       69.87
   农林牧渔 |         96        2.82       72.69
       汽车 |        185        5.43       78.12
   轻工制造 |        191        5.60       83.72
   商业贸易 |         12        0.35       84.07
   食品饮料 |         84        2.46       86.54
       通信 |        102        2.99       89.53
   休闲服务 |          6        0.18       89.70
   医药生物 |        240        7.04       96.74
   有色金属 |        111        3.26      100.00
------------+-----------------------------------
      Total |      3,409      100.00

.
. drop ind_sw1

. xtreg y x1 x2 c.c_x1#c.c_x2 x3 x4 x5 x6 x7 ind_sw*,fe
note: ind_sw2 omitted because of collinearity
note: ind_sw3 omitted because of collinearity
note: ind_sw4 omitted because of collinearity
note: ind_sw5 omitted because of collinearity
note: ind_sw6 omitted because of collinearity
note: ind_sw7 omitted because of collinearity
note: ind_sw8 omitted because of collinearity
note: ind_sw9 omitted because of collinearity
note: ind_sw10 omitted because of collinearity
note: ind_sw11 omitted because of collinearity
note: ind_sw12 omitted because of collinearity
note: ind_sw13 omitted because of collinearity
note: ind_sw14 omitted because of collinearity
note: ind_sw15 omitted because of collinearity
note: ind_sw16 omitted because of collinearity
note: ind_sw17 omitted because of collinearity
note: ind_sw18 omitted because of collinearity
note: ind_sw19 omitted because of collinearity
note: ind_sw20 omitted because of collinearity
note: ind_sw21 omitted because of collinearity
note: ind_sw22 omitted because of collinearity
note: ind_sw23 omitted because of collinearity
note: ind_sw24 omitted because of collinearity
note: ind_sw25 omitted because of collinearity

Fixed-effects (within) regression               Number of obs      =      3409
Group variable: company                         Number of groups   =       570

R-sq:  within  = 0.0866                         Obs per group: min =         5
       between = 0.0034                                        avg =       6.0
       overall = 0.0066                                        max =         6

                                                F(8,2831)          =     33.57
corr(u_i, Xb)  = -0.3911                        Prob > F           =    0.0000

-------------------------------------------------------------------------------
            y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
           x1 |   1.39e-12   5.10e-13     2.72   0.007     3.87e-13    2.39e-12
           x2 |  -.0004315   .0001572    -2.75   0.006    -.0007397   -.0001233
              |
c.c_x1#c.c_x2 |   6.36e-13   3.90e-13     1.63   0.103    -1.29e-13    1.40e-12
              |
           x3 |  -.0084076   .0005553   -15.14   0.000    -.0094963   -.0073189
           x4 |   .0110672   .0041595     2.66   0.008     .0029112    .0192233
           x5 |   .0009815    .000522     1.88   0.060     -.000042     .002005
           x6 |  -.0066004   .0024292    -2.72   0.007    -.0113636   -.0018373
           x7 |   .0013011   .0001313     9.91   0.000     .0010436    .0015587
      ind_sw2 |          0  (omitted)
      ind_sw3 |          0  (omitted)
      ind_sw4 |          0  (omitted)
      ind_sw5 |          0  (omitted)
      ind_sw6 |          0  (omitted)
      ind_sw7 |          0  (omitted)
      ind_sw8 |          0  (omitted)
      ind_sw9 |          0  (omitted)
     ind_sw10 |          0  (omitted)
     ind_sw11 |          0  (omitted)
     ind_sw12 |          0  (omitted)
     ind_sw13 |          0  (omitted)
     ind_sw14 |          0  (omitted)
     ind_sw15 |          0  (omitted)
     ind_sw16 |          0  (omitted)
     ind_sw17 |          0  (omitted)
     ind_sw18 |          0  (omitted)
     ind_sw19 |          0  (omitted)
     ind_sw20 |          0  (omitted)
     ind_sw21 |          0  (omitted)
     ind_sw22 |          0  (omitted)
     ind_sw23 |          0  (omitted)
     ind_sw24 |          0  (omitted)
     ind_sw25 |          0  (omitted)
        _cons |   .1866912   .0106203    17.58   0.000      .165867    .2075155
--------------+----------------------------------------------------------------
      sigma_u |  .01884253
      sigma_e |  .00833753
          rho |  .83626546   (fraction of variance due to u_i)
-------------------------------------------------------------------------------
F test that all u_i=0:     F(569, 2831) =    24.63           Prob > F = 0.0000

.


附件列表

试验.dta

大小:312.14 KB

 马上下载

二维码

扫码加我 拉你入群

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

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

全部回复
2018-1-16 14:20:30
上面的我是按申万行业为划分标准设置的虚拟变量,也就是用dta表中的indus_sw生成虚拟变量ind_sw。后来我又试了按证监会行业划分设置的虚拟变量,即用dta表中的indus生成虚拟变量ind,结果直接显示no observationsr(2000); 不知道为啥?
. tab indus,gen(ind)

                           indus |      Freq.     Percent        Cum.
---------------------------------+-----------------------------------
                          采矿业 |         30        0.88        0.88
电力、热力、燃气及水生产和供应业 |         24        0.70        1.58
                        房地产业 |         18        0.53        2.11
                          建筑业 |         84        2.46        4.58
          交通运输、仓储和邮政业 |         18        0.53        5.10
            科学研究和技术服务业 |         24        0.70        5.81
                农、林、牧、渔业 |         30        0.88        6.69
                    批发和零售业 |         18        0.53        7.22
      水利、环境和公共设施管理业 |         12        0.35        7.57
              文化、体育和娱乐业 |         18        0.53        8.10
  信息传输、软件和信息技术服务业 |        234        6.86       14.96
                          制造业 |      2,875       84.34       99.30
                    住宿和餐饮业 |          6        0.18       99.47
                租赁和商务服务业 |         18        0.53      100.00
---------------------------------+-----------------------------------
                           Total |      3,409      100.00

.
. drop ind1

. xtreg y x1 x2 c.c_x1#c.c_x2 x3 x4 x5 x6 x7 ind*,fe
no observations
r(2000);




二维码

扫码加我 拉你入群

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

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

2018-1-17 08:22:10
这是必然的,因为产业别通常不随时间改变,在固定效果估计下,会被删去(完全共线性)。
二维码

扫码加我 拉你入群

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

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

2018-1-17 10:11:11
一家企业行业类别,基本不随时间变化,你采用固定效应回归,肯定要被删除的
二维码

扫码加我 拉你入群

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

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

2018-1-17 10:42:48
谢谢,我明白了
二维码

扫码加我 拉你入群

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

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

2018-1-17 11:28:13
我也是做面板固定效应,回归中既有年份虚拟变量,又有行业虚拟变量。本来没有加行业虚拟变量,加了行业虚拟变量之后就omitted了,而且我想问一下我设置行业虚拟变量之后,回归的时候总是出现type mismatch,我使用之前黄梅夏新平老师行业分类的标准,用sic2进行行业分类的,是不是因为sic2里面有字母,比如C9,这是字符型,我怎么变成数值型呢?
二维码

扫码加我 拉你入群

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

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

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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