全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
6109 3
2011-06-30
soe_em_sh already defined
r(110);

yeardum1 already defined
r(110);

请问:以上错误或问题如何解决?



*%%%%%%%%%%%%%%%%%%
.
. * data generation
.
. *%%%%%%%%%%%%%%%%%%
.
.
.
. gen soe_em_sh = soe_em/total_em
soe_em_sh already defined
r(110);
.
. gen va_pw = total_va/total_em
va_pw already defined
r(110);
.
.
.
. tab year, gen(yeardum)
       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       2001 |         37       16.67       16.67
       2002 |         37       16.67       33.33
       2003 |         37       16.67       50.00
       2005 |         37       16.67       66.67
       2006 |         37       16.67       83.33
       2007 |         37       16.67      100.00
------------+-----------------------------------
      Total |        222      100.00
yeardum1 already defined
r(110);
.
.
.
. tsset id year
       panel variable:  id (strongly balanced)
        time variable:  year, 2001 to 2007, but with gaps
                delta:  1 unit
.
.
.
. gen va_growth = (va_pw-L.va_pw)/L.va_pw*100
va_growth already defined
r(110);
.
.
.
. gen nonsoe_em_sh = 100 - soe_em_sh*100
nonsoe_em_sh already defined
r(110);
.
. gen nonsoe_em_sh_diff = nonsoe_em_sh - L.nonsoe_em_sh
nonsoe_em_sh_diff already defined
r(110);
.
.
.
. *************
.
. * regression
.
. *************
.
.
.
. reg va_growth nonsoe_em_sh_diff yeardum* if id >= 7 & id <= 34, clust
> er(id) robust
note: yeardum1 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum6 omitted because of collinearity
Linear regression                                      Number of obs =
>     112
                                                       F(  4,    27) =
>    6.44
                                                       Prob > F      =
>  0.0009
                                                       R-squared     =
>  0.2104
                                                       Root MSE      =
>  8.2037
                                    (Std. Err. adjusted for 28 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
   va_growth |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
nonsoe_em_~f |   1.425684   .4785462     2.98   0.006     .4437888     
> 2.40758
    yeardum1 |  (omitted)
    yeardum2 |  -10.68388    2.46168    -4.34   0.000    -15.73483   -5
> .632928
    yeardum3 |  -5.742956   2.333601    -2.46   0.021    -10.53111   -.
> 9548016
    yeardum4 |  (omitted)
    yeardum5 |  -2.087157   1.874801    -1.11   0.275     -5.93393    1
> .759617
    yeardum6 |  (omitted)
       _cons |   18.30978   1.549779    11.81   0.000     15.12989    2
> 1.48966
-----------------------------------------------------------------------
> -------
.
. reg va_growth nonsoe_em_sh_diff L.va_pw yeardum* if id >= 7 & id <= 3
> 4, cluster(id) robust
note: yeardum1 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum6 omitted because of collinearity
Linear regression                                      Number of obs =
>     112
                                                       F(  5,    27) =
>   18.13
                                                       Prob > F      =
>  0.0000
                                                       R-squared     =
>  0.2577
                                                       Root MSE      =
>  7.9915
                                    (Std. Err. adjusted for 28 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
   va_growth |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
nonsoe_em_~f |    1.59726   .3571964     4.47   0.000     .8643536    2
> .330166
             |
       va_pw |
         L1. |   .1282623    .015193     8.44   0.000     .0970889    .
> 1594358
             |
    yeardum1 |  (omitted)
    yeardum2 |  -10.01552   2.221582    -4.51   0.000    -14.57383   -5
> .457211
    yeardum3 |  -5.281558    2.06656    -2.56   0.017    -9.521788   -1
> .041328
    yeardum4 |  (omitted)
    yeardum5 |  -1.851206    1.92793    -0.96   0.345    -5.806992     
> 2.10458
    yeardum6 |  (omitted)
       _cons |   15.98687   1.336928    11.96   0.000     13.24372    1
> 8.73002
-----------------------------------------------------------------------
> -------
二维码

扫码加我 拉你入群

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

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

全部回复
2011-6-30 13:38:58
zhangtao 发表于 2011-6-30 12:06
soe_em_sh already defined
r(110);
yeardum1 already defined
r(110);
欲新生成的变量不能与内存中已有的变量同名。

(代换已有变量的值用replace)
二维码

扫码加我 拉你入群

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

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

2011-6-30 15:22:22
note: yeardum1 omitted because of collinearity
note: yeardum2 omitted because of collinearity
note: yeardum3 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum5 omitted because of collinearity
note: yeardum8 omitted because of collinearity
note: yeardum9 omitted because of collinearity
note: yeardum10 omitted because of collinearity
版主老师,按您的指导,我的第一问题已经解决,
那以上问题又该如何解决?非常感谢!



. tsset id year
       panel variable:  id (strongly balanced)
        time variable:  year, 1997 to 2007
                delta:  1 unit

.
.
.
. reg surplus em_dpe_sh_diff yeardum*, cluster(id) robust
note: yeardum1 omitted because of collinearity
note: yeardum2 omitted because of collinearity
note: yeardum3 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum5 omitted because of collinearity
note: yeardum8 omitted because of collinearity
note: yeardum9 omitted because of collinearity
note: yeardum10 omitted because of collinearity

Linear regression                                      Number of obs =
>     124
                                                       F(  4,    30) =
>    4.64
                                                       Prob > F      =
>  0.0049
                                                       R-squared     =
>  0.0424
                                                       Root MSE      =
>  14.645

                                    (Std. Err. adjusted for 31 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
     surplus |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
em_dpe_sh_~f |   .9963701   .4888561     2.04   0.050    -.0020071    1
> .994747
    yeardum1 |  (omitted)
    yeardum2 |  (omitted)
    yeardum3 |  (omitted)
    yeardum4 |  (omitted)
    yeardum5 |  (omitted)
    yeardum6 |   .9905183   2.042234     0.49   0.631    -3.180281    5
> .161317
    yeardum7 |  -3.754647   1.727222    -2.17   0.038    -7.282106   -.
> 2271894
    yeardum8 |  (omitted)
    yeardum9 |  (omitted)
   yeardum10 |  (omitted)
   yeardum11 |  -.6023245   1.117833    -0.54   0.594    -2.885244    1
> .680594
       _cons |  -9.163297     3.3582    -2.73   0.011    -16.02166   -2
> .304937
-----------------------------------------------------------------------
> -------

.
. reg surplus em_dpe_sh_diff L.gdp_pc_real_10thousand yeardum*, cluster
> (id) robust
note: yeardum1 omitted because of collinearity
note: yeardum2 omitted because of collinearity
note: yeardum3 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum5 omitted because of collinearity
note: yeardum8 omitted because of collinearity
note: yeardum9 omitted because of collinearity
note: yeardum11 omitted because of collinearity

Linear regression                                      Number of obs =
>     124
                                                       F(  5,    30) =
>    4.76
                                                       Prob > F      =
>  0.0025
                                                       R-squared     =
>  0.1984
                                                       Root MSE      =
>  13.456

                                    (Std. Err. adjusted for 31 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
     surplus |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
em_dpe_sh_~f |   .8920254   .4659141     1.91   0.065    -.0594981    1
> .843549
             |
gdp_pc_rea~d |
         L1. |   6.626847   2.395232     2.77   0.010     1.735131    1
> 1.51856
             |
    yeardum1 |  (omitted)
    yeardum2 |  (omitted)
    yeardum3 |  (omitted)
    yeardum4 |  (omitted)
    yeardum5 |  (omitted)
    yeardum6 |   6.043045   3.231462     1.87   0.071    -.5564806    1
> 2.64257
    yeardum7 |   .8587139   2.623398     0.33   0.746     -4.49898    6
> .216408
    yeardum8 |  (omitted)
    yeardum9 |  (omitted)
   yeardum10 |   1.754974    1.15049     1.53   0.138    -.5946394    4
> .104587
   yeardum11 |  (omitted)
       _cons |  -20.07886    4.98818    -4.03   0.000    -30.26608   -9
> .891639
-----------------------------------------------------------------------
> -------

.
.
.
. reg gdp_pc_growth em_dpe_sh_diff yeardum*, cluster(id) robust
note: yeardum1 omitted because of collinearity
note: yeardum2 omitted because of collinearity
note: yeardum3 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum5 omitted because of collinearity
note: yeardum8 omitted because of collinearity
note: yeardum9 omitted because of collinearity
note: yeardum10 omitted because of collinearity

Linear regression                                      Number of obs =
>     124
                                                       F(  4,    30) =
>   10.05
                                                       Prob > F      =
>  0.0000
                                                       R-squared     =
>  0.2252
                                                       Root MSE      =
>  2.0373

                                    (Std. Err. adjusted for 31 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
gdp_pc_gro~h |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
em_dpe_sh_~f |   .1893175   .0602833     3.14   0.004     .0662026    .
> 3124325
    yeardum1 |  (omitted)
    yeardum2 |  (omitted)
    yeardum3 |  (omitted)
    yeardum4 |  (omitted)
    yeardum5 |  (omitted)
    yeardum6 |   -2.32433   .4770798    -4.87   0.000    -3.298657   -1
> .350003
    yeardum7 |  -1.971977   .5142309    -3.83   0.001    -3.022177   -.
> 9217777
    yeardum8 |  (omitted)
    yeardum9 |  (omitted)
   yeardum10 |  (omitted)
   yeardum11 |  -.1233241   .2426223    -0.51   0.615    -.6188249    .
> 3721767
       _cons |   11.56854    .425673    27.18   0.000      10.6992    1
> 2.43788
-----------------------------------------------------------------------
> -------

.
. reg gdp_pc_growth em_dpe_sh_diff L.gdp_pc_real_10thousand yeardum*, c
> luster(id) robust
note: yeardum1 omitted because of collinearity
note: yeardum2 omitted because of collinearity
note: yeardum3 omitted because of collinearity
note: yeardum4 omitted because of collinearity
note: yeardum5 omitted because of collinearity
note: yeardum8 omitted because of collinearity
note: yeardum9 omitted because of collinearity
note: yeardum11 omitted because of collinearity

Linear regression                                      Number of obs =
>     124
                                                       F(  5,    30) =
>    7.92
                                                       Prob > F      =
>  0.0001
                                                       R-squared     =
>  0.2258
                                                       Root MSE      =
>  2.0451

                                    (Std. Err. adjusted for 31 clusters
>  in id)
-----------------------------------------------------------------------
> -------
             |               Robust
gdp_pc_gro~h |      Coef.   Std. Err.      t    P>|t|     [95% Conf. In
> terval]
-------------+---------------------------------------------------------
> -------
em_dpe_sh_~f |   .1903354   .0609947     3.12   0.004     .0657675    .
> 3149033
             |
gdp_pc_rea~d |
         L1. |  -.0646441     .21361    -0.30   0.764     -.500894    .
> 3716057
             |
    yeardum1 |  (omitted)
    yeardum2 |  (omitted)
    yeardum3 |  (omitted)
    yeardum4 |  (omitted)
    yeardum5 |  (omitted)
    yeardum6 |  -2.244417   .4686773    -4.79   0.000    -3.201584   -1
> .287251
    yeardum7 |   -1.88778   .5110647    -3.69   0.001    -2.931514   -.
> 8440471
    yeardum8 |  (omitted)
    yeardum9 |  (omitted)
   yeardum10 |   .1120802     .24746     0.45   0.654    -.3933007     
> .617461
   yeardum11 |  (omitted)
       _cons |   11.54582   .5324548    21.68   0.000      10.4584    1
> 2.63324
-----------------------------------------------------------------------
> -------

.
二维码

扫码加我 拉你入群

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

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

2011-7-1 13:32:35
学习一下。。
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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