楼主: 听见海涛声
21345 15

[回归分析求助] 急!ivreg2 回归结果中只报告了 Hansen J statistic 的结果,无法显示其他检验结果。 [推广有奖]

11
黃河泉 在职认证  发表于 2018-5-2 07:30:49
听见海涛声 发表于 2018-5-1 20:50
是的,我用的是Stata SE 15.1.

有劳您为我指出问题所在。
我不是用 Mac,请你找个同学用他的电脑试试看。

12
听见海涛声 发表于 2018-5-2 10:56:32
黃河泉 发表于 2018-5-2 07:30
我不是用 Mac,请你找个同学用他的电脑试试看。
谢谢您,已经请好朋友把数据跑了一半,可以正常显示。我很想找出为什么我的stata for mac 会出现只显示 Hansen J 统计量的原因,然后使之恢复正常。

再次感谢您的帮助,我先自己琢磨一下,看看如何解决这个问题。

祝好:)

13
蓝色 发表于 2018-5-2 20:16:35
mac 的结果
  1. .  use http://fmwww.bc.edu/ec-p/data/hayashi/griliches76.dta, clear
  2. (Wages of Very Young Men, Zvi Griliches, J.Pol.Ec. 1976)

  3. .  ivreg2 lw s expr tenure rns smsa i.year (iq=med kww age mrt), small first

  4. First-stage regressions
  5. -----------------------


  6. First-stage regression of iq:

  7. Statistics consistent for homoskedasticity only
  8. Number of obs =                    758
  9. ------------------------------------------------------------------------------
  10.           iq |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
  11. -------------+----------------------------------------------------------------
  12.          med |   .2877745   .1622338     1.77   0.077    -.0307176    .6062665
  13.          kww |   .4581116   .0699323     6.55   0.000     .3208229    .5954003
  14.          age |  -.8809144   .2232535    -3.95   0.000    -1.319198   -.4426307
  15.          mrt |   -.584791    .946056    -0.62   0.537    -2.442056    1.272474
  16.            s |   2.497742   .2858159     8.74   0.000     1.936638    3.058846
  17.         expr |   -.033548   .2534458    -0.13   0.895    -.5311042    .4640082
  18.       tenure |   .6158215   .2731146     2.25   0.024     .0796522    1.151991
  19.          rns |  -2.610221   .9499731    -2.75   0.006    -4.475177   -.7452663
  20.         smsa |   .0260481   .9222585     0.03   0.977    -1.784499    1.836595
  21.              |
  22.         year |
  23.          67  |   .9254935   1.655969     0.56   0.576    -2.325449    4.176436
  24.          68  |   .4706951   1.574561     0.30   0.765    -2.620429     3.56182
  25.          69  |   2.164635   1.521387     1.42   0.155    -.8221007     5.15137
  26.          70  |   5.734786   1.696033     3.38   0.001     2.405191    9.064381
  27.          71  |   5.180639   1.562156     3.32   0.001     2.113866    8.247411
  28.          73  |   4.526686    1.48294     3.05   0.002     1.615429    7.437943
  29.              |
  30.        _cons |   67.20449   4.107281    16.36   0.000     59.14121    75.26776
  31. ------------------------------------------------------------------------------
  32. F test of excluded instruments:
  33.   F(  4,   742) =    13.79
  34.   Prob > F      =   0.0000
  35. Sanderson-Windmeijer multivariate F test of excluded instruments:
  36.   F(  4,   742) =    13.79
  37.   Prob > F      =   0.0000



  38. Summary results for first-stage regressions
  39. -------------------------------------------

  40.                                            (Underid)            (Weak id)
  41. Variable     | F(  4,   742)  P-val | SW Chi-sq(  4) P-val | SW F(  4,   742)
  42. iq           |      13.79    0.0000 |       56.33   0.0000 |       13.79

  43. Stock-Yogo weak ID F test critical values for single endogenous regressor:
  44.                                     5% maximal IV relative bias    16.85
  45.                                    10% maximal IV relative bias    10.27
  46.                                    20% maximal IV relative bias     6.71
  47.                                    30% maximal IV relative bias     5.34
  48.                                    10% maximal IV size             24.58
  49.                                    15% maximal IV size             13.96
  50.                                    20% maximal IV size             10.26
  51.                                    25% maximal IV size              8.31
  52. Source: Stock-Yogo (2005).  Reproduced by permission.
  53. NB: Critical values are for Sanderson-Windmeijer F statistic.

  54. Underidentification test
  55. Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
  56. Ha: matrix has rank=K1 (identified)
  57. Anderson canon. corr. LM statistic       Chi-sq(4)=52.44    P-val=0.0000

  58. Weak identification test
  59. Ho: equation is weakly identified
  60. Cragg-Donald Wald F statistic                                      13.79

  61. Stock-Yogo weak ID test critical values for K1=1 and L1=4:
  62.                                     5% maximal IV relative bias    16.85
  63.                                    10% maximal IV relative bias    10.27
  64.                                    20% maximal IV relative bias     6.71
  65.                                    30% maximal IV relative bias     5.34
  66.                                    10% maximal IV size             24.58
  67.                                    15% maximal IV size             13.96
  68.                                    20% maximal IV size             10.26
  69.                                    25% maximal IV size              8.31
  70. Source: Stock-Yogo (2005).  Reproduced by permission.

  71. Weak-instrument-robust inference
  72. Tests of joint significance of endogenous regressors B1 in main equation
  73. Ho: B1=0 and orthogonality conditions are valid
  74. Anderson-Rubin Wald test           F(4,742)=      24.23     P-val=0.0000
  75. Anderson-Rubin Wald test           Chi-sq(4)=     98.99     P-val=0.0000
  76. Stock-Wright LM S statistic        Chi-sq(4)=     87.56     P-val=0.0000

  77. Number of observations               N  =        758
  78. Number of regressors                 K  =         13
  79. Number of endogenous regressors      K1 =          1
  80. Number of instruments                L  =         16
  81. Number of excluded instruments       L1 =          4

  82. IV (2SLS) estimation
  83. --------------------

  84. Estimates efficient for homoskedasticity only
  85. Statistics consistent for homoskedasticity only

  86.                                                       Number of obs =      758
  87.                                                       F( 12,   745) =    45.91
  88.                                                       Prob > F      =   0.0000
  89. Total (centered) SS     =  139.2861498                Centered R2   =   0.4255
  90. Total (uncentered) SS   =  24652.24662                Uncentered R2 =   0.9968
  91. Residual SS             =   80.0182337                Root MSE      =    .3277

  92. ------------------------------------------------------------------------------
  93.           lw |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
  94. -------------+----------------------------------------------------------------
  95.           iq |   .0001747   .0039374     0.04   0.965    -.0075551    .0079044
  96.            s |   .0691759    .013049     5.30   0.000     .0435587    .0947931
  97.         expr |    .029866    .006697     4.46   0.000     .0167189    .0430132
  98.       tenure |   .0432738   .0076934     5.62   0.000     .0281705     .058377
  99.          rns |  -.1035897   .0297371    -3.48   0.001    -.1619682   -.0452111
  100.         smsa |   .1351148   .0268889     5.02   0.000     .0823277    .1879019
  101.              |
  102.         year |
  103.          67  |   -.052598   .0481067    -1.09   0.275    -.1470388    .0418428
  104.          68  |   .0794686   .0451078     1.76   0.079     -.009085    .1680222
  105.          69  |   .2108962   .0443153     4.76   0.000     .1238984    .2978939
  106.          70  |   .2386338   .0514161     4.64   0.000     .1376962    .3395714
  107.          71  |   .2284609   .0441236     5.18   0.000     .1418396    .3150823
  108.          73  |   .3258944   .0410718     7.93   0.000     .2452642    .4065247
  109.              |
  110.        _cons |    4.39955   .2708771    16.24   0.000     3.867777    4.931323
  111. ------------------------------------------------------------------------------
  112. Underidentification test (Anderson canon. corr. LM statistic):          52.436
  113.                                                    Chi-sq(4) P-val =    0.0000
  114. ------------------------------------------------------------------------------
  115. Weak identification test (Cragg-Donald Wald F statistic):               13.786
  116. Stock-Yogo weak ID test critical values:  5% maximal IV relative bias    16.85
  117.                                          10% maximal IV relative bias    10.27
  118.                                          20% maximal IV relative bias     6.71
  119.                                          30% maximal IV relative bias     5.34
  120.                                          10% maximal IV size             24.58
  121.                                          15% maximal IV size             13.96
  122.                                          20% maximal IV size             10.26
  123.                                          25% maximal IV size              8.31
  124. Source: Stock-Yogo (2005).  Reproduced by permission.
  125. ------------------------------------------------------------------------------
  126. Sargan statistic (overidentification test of all instruments):          87.655
  127.                                                    Chi-sq(3) P-val =    0.0000
  128. ------------------------------------------------------------------------------
  129. Instrumented:         iq
  130. Included instruments: s expr tenure rns smsa 67.year 68.year 69.year 70.year
  131.                       71.year 73.year
  132. Excluded instruments: med kww age mrt
  133. ------------------------------------------------------------------------------
复制代码


14
听见海涛声 发表于 2018-5-3 11:51:59
蓝色 发表于 2018-5-2 20:16
mac 的结果
再次感谢您的帮助~

我刚刚找到问题的根源:是ivreg2命令的安装出了问题。黄老师提醒我更新ivreg2时,我直接findit ivreg2,然后安装。stata 提醒我已经是最新版。

今天使用ssc install ivreg2,replace。之后,可以出现您所呈现的结果。

敬礼!

15
镜子儿 发表于 2022-6-7 00:40:35
黃河泉 发表于 2018-5-1 16:17
黄老师您好!我正在用ivreg2这个命令,得到的结果正如您展示的样子,想问一下您,结果里是不是没有第一阶段的F统计量呢?还是说就是第一阶段结果的summary里的F值?我看这个F值和弱识别检验的F值完全一样,是这样吗?小白刚学这个,还请您指教

16
wlingxue 发表于 2024-3-19 15:19:35
黃河泉 发表于 2018-5-1 16:16
奇怪了,我试了都没问题 (你也试一下)。
老师,您好,请问我使用了您这个原始数据代码可以得到 识别不足 等检验结果,但用自己的数据做工具变量回归时就不会显示这些结果呢
ivregress 2sls shangzhicxrh grpduishu renjungrp cpi shequ keyun i.year i.code (shuzijingji=gong
> ju) ,r first

First-stage regressions
-----------------------

                                                        Number of obs =     70
                                                        F(21, 48)     =  45.79
                                                        Prob > F      = 0.0000
                                                        R-squared     = 0.9186
                                                        Adj R-squared = 0.8829
                                                        Root MSE      = 0.0482

---------------------------------------------------------------------------------
                |               Robust
shuzijingjizh~u | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
----------------+----------------------------------------------------------------
      grpduishu |  -.0578206   .0691644    -0.84   0.407    -.1968849    .0812437
      renjungrp |  -9.24e-07   7.16e-07    -1.29   0.203    -2.36e-06    5.15e-07
            cpi |    .014552   .0107174     1.36   0.181    -.0069967    .0361008
          shequ |   .0000281    .000092     0.31   0.761    -.0001568     .000213
          keyun |  -7.62e-07   8.68e-07    -0.88   0.384    -2.51e-06    9.83e-07
                |
           year |
          2014  |   .0490418   .0238744     2.05   0.045     .0010391    .0970446
          2015  |   .0767599   .0253209     3.03   0.004     .0258488     .127671
          2016  |   .1119565   .0291993     3.83   0.000     .0532474    .1706656
          2017  |   .1165454   .0334981     3.48   0.001      .049193    .1838979
          2018  |   .1954376   .0360533     5.42   0.000     .1229476    .2679276
          2019  |   .2663214   .0419712     6.35   0.000     .1819326    .3507101
          2020  |   .3478126   .0440673     7.89   0.000     .2592095    .4364158
          2021  |   .2306333   .0531789     4.34   0.000     .1237099    .3375566
          2022  |   .2395223   .0497993     4.81   0.000      .139394    .3396505
                |
           code |
             2  |   .0251238   .0498542     0.50   0.617    -.0751147    .1253624
             3  |  -.1430153   .0409603    -3.49   0.001    -.2253715   -.0606591
             4  |  -.1237437   .1399938    -0.88   0.381    -.4052201    .1577328
             5  |  -.1515676   .1530394    -0.99   0.327    -.4592738    .1561387
             7  |  -.1562863   .0547471    -2.85   0.006    -.2663628   -.0462098
             8  |  -.0635687   .0480906    -1.32   0.192    -.1602613     .033124
                |
gongjubianliang |   1.06e-06   5.86e-07     1.82   0.076    -1.14e-07    2.24e-06
          _cons |   -.785816    1.33629    -0.59   0.559    -3.472607    1.900975
---------------------------------------------------------------------------------


Instrumental variables 2SLS regression            Number of obs   =         70
                                                  Wald chi2(21)   =    1923.15
                                                  Prob > chi2     =     0.0000
                                                  R-squared       =     0.9584
                                                  Root MSE        =      .0263

-----------------------------------------------------------------------------------
                  |               Robust
     shangzhicxrh | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
------------------+----------------------------------------------------------------
shuzijingjizhishu |   .2444346   .2872948     0.85   0.395    -.3186529    .8075221
        grpduishu |   .0624645   .0503203     1.24   0.214    -.0361614    .1610904
        renjungrp |  -2.21e-07   3.42e-07    -0.65   0.517    -8.91e-07    4.48e-07
              cpi |   .0048327    .006994     0.69   0.490    -.0088752    .0185407
            shequ |   .0001126   .0000467     2.41   0.016     .0000211    .0002042
            keyun |   1.06e-06   7.18e-07     1.48   0.139    -3.45e-07    2.47e-06
                  |
             year |
            2014  |   .0132133   .0191165     0.69   0.489    -.0242543     .050681
            2015  |  -.0227431   .0328115    -0.69   0.488    -.0870525    .0415663
            2016  |  -.0234324   .0446704    -0.52   0.600    -.1109848      .06412
            2017  |  -.0540701     .05135    -1.05   0.292    -.1547142     .046574
            2018  |  -.0758195   .0776714    -0.98   0.329    -.2280525    .0764136
            2019  |   .2769308   .0964201     2.87   0.004     .0879507    .4659108
            2020  |  -.1204645     .12107    -0.99   0.320    -.3577573    .1168284
            2021  |  -.0649956   .0929109    -0.70   0.484    -.2470977    .1171064
            2022  |  -.0894111   .0955557    -0.94   0.349    -.2766968    .0978746
                  |
             code |
               2  |  -.0221402   .0154364    -1.43   0.151    -.0523949    .0081146
               3  |  -.0078821   .0490236    -0.16   0.872    -.1039667    .0882025
               4  |   .1736486   .1304133     1.33   0.183    -.0819568    .4292541
               5  |    .092869   .1436399     0.65   0.518    -.1886602    .3743981
               7  |    .086805   .0563703     1.54   0.124    -.0236788    .1972888
               8  |  -.0716005   .0123701    -5.79   0.000    -.0958454   -.0473556
                  |
            _cons |  -.9534107   .6106203    -1.56   0.118    -2.150204     .243383
-----------------------------------------------------------------------------------
Instrumented: shuzijingjizhishu
Instruments: grpduishu renjungrp cpi shequ keyun 2014.year 2015.year 2016.year
              2017.year 2018.year 2019.year 2020.year 2021.year 2022.year 2.code
              3.code 4.code 5.code 7.code 8.code gongjubianliang

.
end of do-file

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2025-12-29 11:11