Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • ivendog (Hausman test) after xtivreg2 throwing error

    My regression equation has endogenous variable and since I want fixed effect for Year and Industry I am using xtivreg2 user written command. After going through the documentation of ivreg2 on the different tests the command does I found Hausman Test can be done using the command ivendog command.

    However, whenever I run ivendog right after the regression it throws me an error. Reading through the documentation of ivendog although I found mentioning of ivreg and invreg2 but did not find anything about xtivreg2. I am stuck with this, it would be really helpful if anyone could advise a way around this.

    Additionally, if anyone has suggestion/advise on my overall regression results would be helpful as well. Thank you for you kind help.

    Code:
    . xtset id Year, y
    
    Panel variable: id (strongly balanced)
     Time variable: Year, 1995 to 2003
             Delta: 1 year
    
    . xi:xtivreg2 REM_PROXY_w POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w) i.Year, first
    >  fe robust
    i.Year            _IYear_1995-2003    (naturally coded; _IYear_1995 omitted)
    Warning - singleton groups detected.  24 observation(s) not used.
    Warning - collinearities detected
    Vars dropped:       _IYear_1999 _IYear_2003
    
    FIXED EFFECTS ESTIMATION
    ------------------------
    Number of groups =       262                    Obs per group: min =         2
                                                                   avg =       5.0
                                                                   max =         8
    Warning - collinearities detected
    Vars dropped:  _IYear_1999 _IYear_2003
    
    First-stage regressions
    -----------------------
    
    
    FIXED EFFECTS ESTIMATION
    ------------------------
    Number of groups =       262                    Obs per group: min =         2
                                                                   avg =       5.0
                                                                   max =         8
    
    First-stage regression of ABS_DA_w:
    
    Statistics robust to heteroskedasticity
    Number of obs =                   1323
    ------------------------------------------------------------------------------
                 |               Robust
        ABS_DA_w | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        C_PROD_w |   .0003189   .0051077     0.06   0.950    -.0097035    .0103414
        POST_REG |   .0058297   .0077954     0.75   0.455    -.0094667    .0211261
            INBD |   .0097056   .0139399     0.70   0.486    -.0176477    .0370589
           ROA_w |  -.1641145   .0462745    -3.55   0.000    -.2549157   -.0733133
            Size |   .0169224   .0113974     1.48   0.138     -.005442    .0392867
         MTB_x_w |   .0058593   .0036976     1.58   0.113    -.0013963    .0131149
           LEV_w |   .0063436   .0261565     0.24   0.808    -.0449815    .0576688
         NOA_X_w |  -.0005691   .0042303    -0.13   0.893    -.0088699    .0077317
     _IYear_1996 |   .0039979   .0074563     0.54   0.592     -.010633    .0186288
     _IYear_1997 |   .0447984   .0095482     4.69   0.000     .0260627    .0635341
     _IYear_1998 |    .025455   .0077656     3.28   0.001      .010217     .040693
     _IYear_1999 |          0  (omitted)
     _IYear_2000 |   .0070051   .0080869     0.87   0.387    -.0088632    .0228734
     _IYear_2001 |   .0148897   .0088242     1.69   0.092    -.0024254    .0322048
     _IYear_2002 |   .0311732   .0076571     4.07   0.000     .0161482    .0461982
     _IYear_2003 |          0  (omitted)
    ------------------------------------------------------------------------------
    F test of excluded instruments:
      F(  1,  1047) =     0.00
      Prob > F      =   0.9502
    Sanderson-Windmeijer multivariate F test of excluded instruments:
      F(  1,  1047) =     0.00
      Prob > F      =   0.9502
    
    
    
    Summary results for first-stage regressions
    -------------------------------------------
    
                                               (Underid)            (Weak id)
    Variable     | F(  1,  1047)  P-val | SW Chi-sq(  1) P-val | SW F(  1,  1047)
    ABS_DA_w     |       0.00    0.9502 |        0.00   0.9499 |        0.00
    
    NB: first-stage test statistics heteroskedasticity-robust
    
    Stock-Yogo weak ID F test critical values for single endogenous regressor:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for i.i.d. errors only.
    
    Underidentification test
    Ho: matrix of reduced form coefficients has rank=K1-1 (underidentified)
    Ha: matrix has rank=K1 (identified)
    Kleibergen-Paap rk LM statistic          Chi-sq(1)=0.00     P-val=0.9498
    
    Weak identification test
    Ho: equation is weakly identified
    Cragg-Donald Wald F statistic                                       0.00
    Kleibergen-Paap Wald rk F statistic                                 0.00
    
    Stock-Yogo weak ID test critical values for K1=1 and L1=1:
                                       10% maximal IV size             16.38
                                       15% maximal IV size              8.96
                                       20% maximal IV size              6.66
                                       25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    
    Weak-instrument-robust inference
    Tests of joint significance of endogenous regressors B1 in main equation
    Ho: B1=0 and orthogonality conditions are valid
    Anderson-Rubin Wald test           F(1,1047)=      4.71     P-val=0.0302
    Anderson-Rubin Wald test           Chi-sq(1)=      4.78     P-val=0.0289
    Stock-Wright LM S statistic        Chi-sq(1)=      4.97     P-val=0.0258
    
    NB: Underidentification, weak identification and weak-identification-robust
        test statistics heteroskedasticity-robust
    
    Number of observations               N  =       1323
    Number of regressors                 K  =         14
    Number of endogenous regressors      K1 =          1
    Number of instruments                L  =         14
    Number of excluded instruments       L1 =          1
    
    IV (2SLS) estimation
    --------------------
    
    Estimates efficient for homoskedasticity only
    Statistics robust to heteroskedasticity
    
                                                          Number of obs =     1323
                                                          F( 14,  1047) =     0.00
                                                          Prob > F      =   1.0000
    Total (centered) SS     =  21.63923171                Centered R2   = -8.6e+02
    Total (uncentered) SS   =  21.63923171                Uncentered R2 = -8.6e+02
    Residual SS             =  18699.71733                Root MSE      =    4.198
    
    ------------------------------------------------------------------------------
                 |               Robust
     REM_PROXY_w | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        ABS_DA_w |   60.49753   963.3464     0.06   0.950    -1827.627    1948.622
        POST_REG |  -.3266171   5.633492    -0.06   0.954    -11.36806    10.71482
            INBD |  -.6315695   9.362187    -0.07   0.946    -18.98112    17.71798
           ROA_w |   9.618423   158.7458     0.06   0.952    -301.5177    320.7545
            Size |  -.9940734   16.34961    -0.06   0.952    -33.03872    31.05057
         MTB_x_w |   -.370475   5.658206    -0.07   0.948    -11.46036    10.71941
           LEV_w |   -.356007   6.121573    -0.06   0.954    -12.35407    11.64206
         NOA_X_w |   .0460123   .5477467     0.08   0.933    -1.027552    1.119576
     _IYear_1996 |  -.2439523     3.8278    -0.06   0.949    -7.746302    7.258397
     _IYear_1997 |  -2.763374   43.07429    -0.06   0.949    -87.18743    81.66068
     _IYear_1998 |  -1.554118   24.59491    -0.06   0.950    -49.75926    46.65102
     _IYear_1999 |          0  (omitted)
     _IYear_2000 |  -.4395395   6.761036    -0.07   0.948    -13.69093    12.81185
     _IYear_2001 |  -.9103606   14.36654    -0.06   0.949    -29.06827    27.24754
     _IYear_2002 |  -1.895217   30.04091    -0.06   0.950    -60.77431    56.98388
     _IYear_2003 |          0  (omitted)
    ------------------------------------------------------------------------------
    Underidentification test (Kleibergen-Paap rk LM statistic):              0.004
                                                       Chi-sq(1) P-val =    0.9498
    ------------------------------------------------------------------------------
    Weak identification test (Cragg-Donald Wald F statistic):                0.005
                             (Kleibergen-Paap rk Wald F statistic):          0.004
    Stock-Yogo weak ID test critical values: 10% maximal IV size             16.38
                                             15% maximal IV size              8.96
                                             20% maximal IV size              6.66
                                             25% maximal IV size              5.53
    Source: Stock-Yogo (2005).  Reproduced by permission.
    NB: Critical values are for Cragg-Donald F statistic and i.i.d. errors.
    ------------------------------------------------------------------------------
    Hansen J statistic (overidentification test of all instruments):         0.000
                                                     (equation exactly identified)
    ------------------------------------------------------------------------------
    Instrumented:         ABS_DA_w
    Included instruments: POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w
                          _IYear_1996 _IYear_1997 _IYear_1998 _IYear_2000
                          _IYear_2001 _IYear_2002
    Excluded instruments: C_PROD_w
    Dropped collinear:    _IYear_1999 _IYear_2003
    ------------------------------------------------------------------------------

  • #2

    I have worked on a way around with ivregress with which I can do the Hausman Test. However the results are different from what I got in xtivreg2. Please note SICCode represents industry as hardcode by me since my Industries are string variables

    Code:
     ivregress 2sls REM_PROXY_w POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w) i.Year i.
    > SICCode, first
    note: 1995.Year identifies no observations in the sample.
    note: 1999.Year omitted because of collinearity.
    note: 2003.Year omitted because of collinearity.
    
    First-stage regressions
    -----------------------
    
                                                            Number of obs =  1,347
                                                            F(20, 1326)   =  16.20
                                                            Prob > F      = 0.0000
                                                            R-squared     = 0.1963
                                                            Adj R-squared = 0.1842
                                                            Root MSE      = 0.0740
    
    ------------------------------------------------------------------------------
        ABS_DA_w | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        POST_REG |   .0125176   .0078603     1.59   0.112    -.0029024    .0279376
            INBD |   .0038995   .0128525     0.30   0.762    -.0213139    .0291129
           ROA_w |  -.1881559   .0240704    -7.82   0.000    -.2353761   -.1409356
            Size |   -.001285    .001806    -0.71   0.477     -.004828    .0022579
         MTB_x_w |   .0104141   .0022317     4.67   0.000     .0060361    .0147921
           LEV_w |  -.0097852   .0107037    -0.91   0.361    -.0307833    .0112128
         NOA_X_w |    .000887   .0020459     0.43   0.665    -.0031265    .0049006
                 |
            Year |
           1995  |          0  (empty)
           1996  |   .0055803   .0085653     0.65   0.515    -.0112228    .0223834
           1997  |   .0453681   .0089808     5.05   0.000       .02775    .0629862
           1998  |   .0276126   .0085568     3.23   0.001     .0108264    .0443989
           1999  |          0  (omitted)
           2000  |   .0005239   .0080615     0.06   0.948    -.0152908    .0163385
           2001  |   .0089788   .0079153     1.13   0.257     -.006549    .0245067
           2002  |   .0341066   .0072272     4.72   0.000     .0199285    .0482846
           2003  |          0  (omitted)
                 |
         SICCode |
             22  |   .0080634   .0069872     1.15   0.249    -.0056437    .0217706
             33  |   .0512473   .0103705     4.94   0.000      .030903    .0715916
             44  |   .0213235   .0091345     2.33   0.020     .0034038    .0392432
             55  |   .0010675   .0066599     0.16   0.873    -.0119976    .0141325
             66  |  -.0086308   .0075134    -1.15   0.251    -.0233702    .0061086
             77  |   .0536253   .0073805     7.27   0.000     .0391465     .068104
                 |
        C_PROD_w |  -.0055221   .0022992    -2.40   0.016    -.0100325   -.0010117
           _cons |   .0702527   .0264328     2.66   0.008      .018398    .1221073
    ------------------------------------------------------------------------------
    
    
    Instrumental variables 2SLS regression            Number of obs   =      1,347
                                                      Wald chi2(20)   =     194.98
                                                      Prob > chi2     =     0.0000
                                                      R-squared       =     0.1087
                                                      Root MSE        =     .22122
    
    ------------------------------------------------------------------------------
     REM_PROXY_w | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        ABS_DA_w |  -.3505179   1.244109    -0.28   0.778    -2.788926     2.08789
        POST_REG |   .0737734   .0279994     2.63   0.008     .0188956    .1286513
            INBD |   .0139644   .0387687     0.36   0.719    -.0620208    .0899497
           ROA_w |  -.4788653   .2339244    -2.05   0.041    -.9373487   -.0203819
            Size |  -.0013434   .0055604    -0.24   0.809    -.0122415    .0095548
         MTB_x_w |  -.0492885   .0146137    -3.37   0.001    -.0779308   -.0206462
           LEV_w |   .1441121   .0332805     4.33   0.000     .0788835    .2093407
         NOA_X_w |   .0118403   .0054825     2.16   0.031     .0010949    .0225858
                 |
            Year |
           1995  |          0  (empty)
           1996  |   .0111472   .0269695     0.41   0.679     -.041712    .0640064
           1997  |  -.0532041   .0643866    -0.83   0.409    -.1793996    .0729913
           1998  |  -.0195365   .0428019    -0.46   0.648    -.1034267    .0643537
           1999  |          0  (omitted)
           2000  |  -.0694717   .0241228    -2.88   0.004    -.1167516   -.0221919
           2001  |  -.0572479   .0260669    -2.20   0.028     -.108338   -.0061577
           2002  |  -.0296003   .0476557    -0.62   0.535    -.1230038    .0638031
           2003  |          0  (omitted)
                 |
         SICCode |
             22  |   .0310299   .0238551     1.30   0.193    -.0157253    .0777851
             33  |   .0243452   .0706665     0.34   0.730    -.1141585     .162849
             44  |   .0488511    .041315     1.18   0.237    -.0321248     .129827
             55  |   .0098873   .0198347     0.50   0.618    -.0289881    .0487627
             66  |  -.0155326   .0244611    -0.63   0.525    -.0634755    .0324103
             77  |   .0101794   .0697522     0.15   0.884    -.1265323    .1468911
                 |
           _cons |  -.0068068   .1103539    -0.06   0.951    -.2230965    .2094829
    ------------------------------------------------------------------------------
    Instrumented: ABS_DA_w
     Instruments: POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w 1996.Year
                  1997.Year 1998.Year 2000.Year 2001.Year 2002.Year 22.SICCode
                  33.SICCode 44.SICCode 55.SICCode 66.SICCode 77.SICCode
                  C_PROD_w

    Comment

    Working...
    X