全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
9999 5
2014-08-01
悬赏 100 个论坛币 已解决
RT,做好面板数据IV回归之后,想看第一阶段shea R结果,输入:estat firststage
每次都提示:
invalid subcommand firststage


。。。求问这是为啥?感谢!!

最佳答案

蓝色 查看完整内容

没有问题啊 . webuse hsng2 (1980 Census housing data) . ivregress 2sls rent pcturban (hsngval = faminc i.region), small Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 50 -------------+------------------------------ F( 2, 47) = 42.66 Model | 36677.4033 2 18338.7017 Prob > ...
二维码

扫码加我 拉你入群

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

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

全部回复
2014-8-1 18:51:11
没有问题啊


. webuse hsng2
(1980 Census housing data)

. ivregress 2sls rent pcturban (hsngval = faminc i.region), small


Instrumental variables (2SLS) regression

      Source |       SS       df       MS              Number of obs =      50
-------------+------------------------------           F(  2,    47) =   42.66
       Model |  36677.4033     2  18338.7017           Prob > F      =  0.0000
    Residual |  24565.7167    47  522.674823           R-squared     =  0.5989
-------------+------------------------------           Adj R-squared =  0.5818
       Total |    61243.12    49  1249.85959           Root MSE      =  22.862

------------------------------------------------------------------------------
        rent |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     hsngval |   .0022398   .0003388     6.61   0.000     .0015583    .0029213
    pcturban |    .081516   .3081528     0.26   0.793    -.5384074    .7014394
       _cons |   120.7065   15.70688     7.68   0.000     89.10834    152.3047
------------------------------------------------------------------------------
Instrumented:  hsngval
Instruments:   pcturban faminc 2.region 3.region 4.region

. estat firststage

  First-stage regression summary statistics
  --------------------------------------------------------------------------
               |            Adjusted      Partial
      Variable |   R-sq.       R-sq.        R-sq.       F(4,44)   Prob > F
  -------------+------------------------------------------------------------
       hsngval |  0.6908      0.6557       0.5473       13.2978    0.0000
  --------------------------------------------------------------------------


  Minimum eigenvalue statistic = 13.2978     

  Critical Values                      # of endogenous regressors:    1
  Ho: Instruments are weak             # of excluded instruments:     4
  ---------------------------------------------------------------------
                                     |    5%     10%     20%     30%
  2SLS relative bias                 |  16.85   10.27    6.71    5.34
  -----------------------------------+---------------------------------
                                     |   10%     15%     20%     25%
  2SLS Size of nominal 5% Wald test  |  24.58   13.96   10.26    8.31
  LIML Size of nominal 5% Wald test  |   5.44    3.87    3.30    2.98
  ---------------------------------------------------------------------


没有问题啊

二维码

扫码加我 拉你入群

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

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

2014-8-1 23:32:41
蓝色 发表于 2014-8-1 19:48
没有问题啊
谢谢!直接写ivregress, i.region是没有问题,我之前是用xtreg,fe的时候就不行。
我想问一下:
1. 你的i.region写括号里面和外面有区别么?换而言之,我可以写成ivregress 2sls rent pcturban (hsngval = faminc ) i.region, small吗?因为其他变量也需要控制region啊。。。
2. IV的情况下,我用xtreg, fe和ivreg控制i.region变量做出来估计值一样,但是t值是不一样的,这个如果样本大的话会不会结果差很多?
再次感谢!
二维码

扫码加我 拉你入群

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

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

2014-8-2 08:29:23
该用什么命令和选项,你的看帮助和手册里面的具体介绍
1、每一个命令都有对应的选项,而不是你想用什么命令就用什么
ivregress后面才能用estat first
面板数据是没有那个命令的,你在帮助里面面板的iv的命令,你能查到有吗?


2.两种命令的结果是否一样,这需要你懂两种命令背后的理论的推导。
你的从理论上先推导他们的结果到底是什么区别


. webuse nlswork
(National Longitudinal Survey.  Young Women 14-26 years of age in 1968)


. xtivreg ln_w age c.age#c.age not_smsa (tenure = union south), fe  first

First-stage within regression

Fixed-effects (within) regression               Number of obs      =     19007
Group variable: idcode                          Number of groups   =      4134

R-sq:  within  = 0.3019                         Obs per group: min =         1
       between = 0.0578                                        avg =       4.6
       overall = 0.1289                                        max =        12

                                                F(5,14868)         =   1285.83
corr(u_i, Xb)  = -0.1871                        Prob > F           =    0.0000

------------------------------------------------------------------------------
      tenure |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .0863031   .0343238     2.51   0.012     .0190241    .1535821
             |
c.age#c.age |   .0039115    .000549     7.12   0.000     .0028353    .0049876
             |
    not_smsa |  -.3552488   .1269318    -2.80   0.005    -.6040507   -.1064468
       union |   .3896861   .0706568     5.52   0.000     .2511901    .5281821
       south |  -.4296172   .1349122    -3.18   0.001    -.6940618   -.1651726
       _cons |  -2.554764   .5293374    -4.83   0.000     -3.59233   -1.517197
-------------+----------------------------------------------------------------
     sigma_u |  3.1334845
     sigma_e |  2.5869529
         rho |  .59467598   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0:     F(4133, 14868) =     6.40         Prob > F = 0.0000


Fixed-effects (within) IV regression         Number of obs      =        19007
Group variable: idcode                       Number of groups   =         4134

R-sq:  within  =      .                      Obs per group: min =            1
       between = 0.1304                                     avg =          4.6
       overall = 0.0897                                     max =           12

                                             Wald chi2(4)       =    147926.58
corr(u_i, Xb)  = -0.6843                     Prob > chi2        =       0.0000

------------------------------------------------------------------------------
     ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      tenure |   .2403531   .0373419     6.44   0.000     .1671643    .3135419
         age |   .0118437   .0090032     1.32   0.188    -.0058023    .0294897
             |
c.age#c.age |  -.0012145   .0001968    -6.17   0.000    -.0016003   -.0008286
             |
    not_smsa |  -.0167178   .0339236    -0.49   0.622    -.0832069    .0497713
       _cons |   1.678287   .1626657    10.32   0.000     1.359468    1.997106
-------------+----------------------------------------------------------------
     sigma_u |  .70661941
     sigma_e |  .63029359
         rho |  .55690561   (fraction of variance due to u_i)
------------------------------------------------------------------------------
F  test that all u_i=0:     F(4133,14869) =     1.44      Prob > F    = 0.0000
------------------------------------------------------------------------------
Instrumented:   tenure
Instruments:    age c.age#c.age not_smsa union south
------------------------------------------------------------------------------

. xtivreg ln_w age c.age#c.age not_smsa (tenure = union south), re  first

First-stage G2SLS regression
                                                 Number of obs    =      19007
                                                 Wald chi(5)      =       4789
                                                 Prob > chi2      =     0.0000
------------------------------------------------------------------------------
      tenure |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |   .1357715   .0352866     3.85   0.000     .0666109     .204932
             |
c.age#c.age |   .0021357   .0005639     3.79   0.000     .0010305     .003241
             |
    not_smsa |  -.0178559   .0719943    -0.25   0.804    -.1589621    .1232504
       union |   1.032321   .0646406    15.97   0.000      .905628    1.159015
       south |  -.1311183   .0672238    -1.95   0.051    -.2628745    .0006379
       _cons |   -3.02552   .5391171    -5.61   0.000     -4.08217    -1.96887
------------------------------------------------------------------------------

G2SLS random-effects IV regression              Number of obs      =     19007
Group variable: idcode                          Number of groups   =      4134

R-sq:  within  = 0.0620                         Obs per group: min =         1
       between = 0.1745                                        avg =       4.6
       overall = 0.1206                                        max =        12

                                                Wald chi2(4)       =    941.52
corr(u_i, X)       = 0 (assumed)                Prob > chi2        =    0.0000

------------------------------------------------------------------------------
     ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      tenure |   .1772948   .0111724    15.87   0.000     .1553972    .1991924
         age |   .0191674   .0066388     2.89   0.004     .0061555    .0321792
             |
c.age#c.age |  -.0008496   .0001057    -8.04   0.000    -.0010567   -.0006425
             |
    not_smsa |  -.2119932   .0130456   -16.25   0.000    -.2375622   -.1864243
       _cons |    1.42761   .1037797    13.76   0.000     1.224205    1.631014
-------------+----------------------------------------------------------------
     sigma_u |  .33156584
     sigma_e |  .63029359
         rho |  .21674808   (fraction of variance due to u_i)
------------------------------------------------------------------------------
Instrumented:   tenure
Instruments:    age c.age#c.age not_smsa union south
------------------------------------------------------------------------------

二维码

扫码加我 拉你入群

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

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

2014-8-2 14:53:45
蓝色 发表于 2014-8-2 08:29
该用什么命令和选项,你的看帮助和手册里面的具体介绍
1、每一个命令都有对应的选项,而不是你想用什么命令 ...
嗯嗯thanks!!!
二维码

扫码加我 拉你入群

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

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

2017-4-30 12:03:36
蓝色 发表于 2014-8-2 08:29
该用什么命令和选项,你的看帮助和手册里面的具体介绍
1、每一个命令都有对应的选项,而不是你想用什么命令 ...
请问一下,第二个结果中with Rsquare为什么会是空的?对结果有影响吗?
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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