Announcement

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

  • Different results from fixed effect model with ivregress, ivreg2 and ivreg

    I am trying to run a IV regression with fixed effect of Year and Industry. My data is xtset on industry before running the regressions. However, after testing for three different methods ivregress, ivreg and invreg2 - I get different results which I think should not happen. Any advice would be very helpful as I am stuck with this. Thank you in advance


    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, robust
    note: 1995.Year identifies no observations in the sample.
    note: 1999.Year omitted because of collinearity.
    note: 2003.Year omitted because of collinearity.
    
    Instrumental variables 2SLS regression            Number of obs   =      1,347
                                                      Wald chi2(20)   =     208.48
                                                      Prob > chi2     =     0.0000
                                                      R-squared       =     0.1087
                                                      Root MSE        =     .22122
    
    ------------------------------------------------------------------------------
                 |               Robust
     REM_PROXY_w | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        ABS_DA_w |  -.3505179    1.17747    -0.30   0.766    -2.658317    1.957282
        POST_REG |   .0737734   .0259507     2.84   0.004     .0229111    .1246358
            INBD |   .0139644   .0383945     0.36   0.716    -.0612875    .0892163
           ROA_w |  -.4788653   .2399727    -2.00   0.046    -.9492032   -.0085274
            Size |  -.0013434   .0053234    -0.25   0.801     -.011777    .0090902
         MTB_x_w |  -.0492885   .0144491    -3.41   0.001    -.0776083   -.0209687
           LEV_w |   .1441121   .0328768     4.38   0.000     .0796749    .2085494
         NOA_X_w |   .0118403    .005255     2.25   0.024     .0015407      .02214
                 |
            Year |
           1995  |          0  (empty)
           1996  |   .0111472   .0237327     0.47   0.639    -.0353681    .0576625
           1997  |  -.0532041    .058688    -0.91   0.365    -.1682305    .0618222
           1998  |  -.0195365   .0386865    -0.50   0.614    -.0953608    .0562877
           1999  |          0  (omitted)
           2000  |  -.0694717   .0260511    -2.67   0.008    -.1205309   -.0184126
           2001  |  -.0572479   .0285827    -2.00   0.045     -.113269   -.0012268
           2002  |  -.0296003    .049465    -0.60   0.550      -.12655    .0673494
           2003  |          0  (omitted)
                 |
         SICCode |
             22  |   .0310299   .0257599     1.20   0.228    -.0194586    .0815185
             33  |   .0243452   .0643089     0.38   0.705    -.1016978    .1503883
             44  |   .0488511   .0376297     1.30   0.194    -.0249018     .122604
             55  |   .0098873   .0162591     0.61   0.543    -.0219801    .0417546
             66  |  -.0155326   .0216523    -0.72   0.473    -.0579703     .026905
             77  |   .0101794   .0649133     0.16   0.875    -.1170483    .1374071
                 |
           _cons |  -.0068068    .106281    -0.06   0.949    -.2151137    .2015002
    ------------------------------------------------------------------------------
    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
    
    . xtivreg REM_PROXY_w POST_REG  INBD ROA_w Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w), fe small
    
    Fixed-effects (within) IV regression            Number of obs     =      1,347
    Group variable: id                              Number of groups  =        286
    
    R-squared:                                      Obs per group:
         Within  =      .                                         min =          1
         Between = 0.0011                                         avg =        4.7
         Overall = 0.0006                                         max =          8
    
                                                    F(294,1053)       =      0.05
    corr(u_i, Xb) = -0.6195                         Prob > F          =     0.9999
    
    ------------------------------------------------------------------------------
     REM_PROXY_w | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        ABS_DA_w |  -23.50012   112.8014    -0.21   0.835    -244.8413     197.841
        POST_REG |   .1519669   .5973908     0.25   0.799    -1.020245    1.324179
            INBD |   .2510134   1.457103     0.17   0.863    -2.608143     3.11017
           ROA_w |  -4.913975   22.30776    -0.22   0.826     -48.6867    38.85875
            Size |   .3925018   1.766158     0.22   0.824    -3.073088    3.858092
         MTB_x_w |   .0074161   .1199761     0.06   0.951    -.2280033    .2428355
           LEV_w |   .5953087   2.840017     0.21   0.834    -4.977428    6.168045
         NOA_X_w |  -.0264263   .2228178    -0.12   0.906    -.4636436     .410791
           _cons |  -4.231823   18.53357    -0.23   0.819    -40.59875     32.1351
    -------------+----------------------------------------------------------------
         sigma_u |  1.4468996
         sigma_e |  1.6827241
             rho |  .42507308   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
     F test that all u_i=0: F(285,1053) =     0.06            Prob > F    = 1.0000
    ------------------------------------------------------------------------------
    Instrumented: ABS_DA_w
     Instruments: POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w C_PROD_w
    
    . 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, fe r
    > obust endog(ABS_DA_w)
    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
    
    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)
    -endog- option:
    Endogeneity test of endogenous regressors:                               4.792
                                                       Chi-sq(1) P-val =    0.0286
    Regressors tested:    ABS_DA_w
    ------------------------------------------------------------------------------
    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
    xtivreg2 is from SSC, as you are asked to explain (FAQ Advice #12).

    My data is xtset on industry before running the regressions.
    If your industry variable is "SICCode", clearly not from the xtivreg results as it shows the group variable is "id" from below.

    . xtivreg REM_PROXY_w POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w), fe small Fixed-effects (within) IV regression Number of obs = 1,347 Group variable: id Number of groups = 286

    There are no year dummies in the xtivreg regression as well. Finally, xtivreg2 will drop singletons by default, so the estimation samples are not the same.

    Comment


    • #3
      Farhan
      1) your -ivregress- code corrects for heteroskedasticity only and neglect autocorrelation;
      2) your second code does not seem to support any evidence of panel-wise effect.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Andrew Musau Carlo Lazzaro Thank you Andrew and Carlo for your helpful advice in pointing my mistakes. Perhaps, I should have been more clear on the SICCode and ids. I should not have said my data is xtset on industry (which I now feel made a wrong meaning).

        When I xtset my data it's set on ids which are grouped by Ticker/firms. I might be totally wrong but my idea was that since industry of firms rarely change and is time invariant the effect is wiped out. So in my regressions I use i.Year for Year fixed effect and I believe the "fe" takes the effect of firms/industry since the data is xtset on ids. For the ivregress equation I used i.SICCode cause it can not take fe argument.

        I am sorry I noticed I did not account for Year fixed effect in my second regression (xtivreg), but please find below the regression result that I just ran.

        Honestly, I am having a hard time in making my head around the different regressions and not really sure which one is the correct method and I should follow through. The reason I was playing around with ivregress command was that in my study I need to report Durbin-Wu-Hausman test endogeny test which can not be done for the xtivreg and xtivreg2 commands.

        Thank you once again for your kind advice and this helps me fill my understanding gaps

        Code:
         xtivreg 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, fe vce(
        > robust) small
        note: 2003.Year omitted because of collinearity.
        
        Fixed-effects (within) IV regression            Number of obs     =      1,347
        Group variable: id                              Number of groups  =        286
        
        R-squared:                                      Obs per group:
             Within  =      .                                         min =          1
             Between = 0.0062                                         avg =        4.7
             Overall = 0.0002                                         max =          8
        
        
                                                        F( 300,   1047)   =      0.00
        corr(u_i, Xb) = -0.6227                         Prob > F          =     1.0000
        
                                           (Std. err. adjusted for 286 clusters in id)
        ------------------------------------------------------------------------------
                     |               Robust
         REM_PROXY_w | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
            ABS_DA_w |   60.49753   1120.013     0.05   0.957    -2137.229    2258.224
            POST_REG |  -.0826648   2.124591    -0.04   0.969    -4.251607    4.086277
                INBD |  -.6315695   10.72891    -0.06   0.953    -21.68418    20.42104
               ROA_w |   9.618423   184.3593     0.05   0.958    -352.1373    371.3742
                Size |  -.9940734   19.12817    -0.05   0.959    -38.52799    36.53984
             MTB_x_w |   -.370475   6.571353    -0.06   0.955      -13.265    12.52405
               LEV_w |   -.356007    6.84824    -0.05   0.959    -13.79384    13.08183
             NOA_X_w |   .0460123   .5964272     0.08   0.939    -1.124316    1.216341
                     |
                Year |
               1997  |  -2.519421   45.70716    -0.06   0.956    -92.20749    87.16865
               1998  |  -1.310166    24.1878    -0.05   0.957    -48.77224    46.15191
               1999  |   .2439523    4.44755     0.05   0.956    -8.483174    8.971079
               2000  |  -.4395395   7.911409    -0.06   0.956    -15.96356    15.08448
               2001  |  -.9103606   16.73963    -0.05   0.957     -33.7574    31.93668
               2002  |  -1.895217   34.93383    -0.05   0.957    -70.44351    66.65307
               2003  |          0  (omitted)
                     |
               _cons |   11.22575   218.7877     0.05   0.959    -418.0865     440.538
        -------------+----------------------------------------------------------------
             sigma_u |  3.5407745
             sigma_e |  4.2261429
                 rho |  .41243979   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        Instrumented: ABS_DA_w
         Instruments: POST_REG INBD ROA_w Size MTB_x_w LEV_w NOA_X_w 1997.Year
                      1998.Year 1999.Year 2000.Year 2001.Year 2002.Year C_PROD_w

        Comment


        • #5
          Farhan:
          basically no within panel variation across the 8 (max)-year time-horizon?
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Carlo Lazzaro If I understand you correctly, yes these were years with not much observations anyway

            Comment


            • #7
              Farhan:
              usually, this is one of the situation in which the -fe- estimator works at its worst.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Code:
                xtset id
                xtivreg 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, fe small
                is equivalent to

                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.id i.Year

                Comment


                • #9
                  Carlo Lazzaro Thank you for your input, I believe then I should go for random effect model

                  Andrew Musau This works perfectly. Thank you for your kind help

                  Comment


                  • #10
                    Andrew explained to you what was "wrong" about your initial set of regressions -- they were different regressions, one was controlling for industry fixed effects, the other for id fixed effects. So there is no reason to expect that those give you the same results.

                    You are right to think that most id would not change industry, so most of the time controlling for id fixed effects is already controlling for industry fixed effects. However it does not go the other way round -- controlling for industry fixed effects, you are not controlling for id fixed effects.

                    With so few ids, on the order of 200-300 you can run the regression any way you please, including as Andrew showed by -ivregress- and i.id.

                    Also there are a dozen ways how to do Hausman test after every command, so this is not a problem either.

                    Comment


                    • #11
                      Joro Kolev Thank you for you insightful advice. Yes, I was thinking wrong way while thinking about the fixed effects using ids.

                      I noticed you mentioned about few ways to do the Hausman test for endogenity -- if you could kindly give some directions on where to look It would be very helpful.

                      On a side note, I am following the xtivregress command as advised by Andrew earlier and using the command dmexogxt which is the Hausman Test proposed by Davidson-MacKinnon (1993). However, I do have issues running that on Stata

                      Comment


                      • #12
                        Andrew Musau Andrew thank you once again for guiding me on my regressions which helped me progress much in my study. However, there is one thing though - if you have any advice on which command to add if I want to show the regression coefficient of my instrumental variable which in this case C_PROD -- I have noticed other literatures that I follow does report that in my 2SLS reporting. Would really kind of you if you could show me some direction on this

                        Below is my regression result and a paper regression table where their instrumental variable is AEM_I and BIG_4 (marked in yellow)

                        Code:
                        . xtivreg REM_PROXY_w POST_REG INBD POSTREG_X_ABS_DA ROA_w Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w) i.Year, fe vce(robust) small
                        note: 2003.Year omitted because of collinearity.
                        
                        Fixed-effects (within) IV regression            Number of obs     =      1,347
                        Group variable: id                              Number of groups  =        286
                        
                        R-squared:                                      Obs per group:
                             Within  =      .                                         min =          1
                             Between = 0.0004                                         avg =        4.7
                             Overall = 0.0033                                         max =          8
                        
                        
                                                                        F( 301,   1046)   =      1.08
                        corr(u_i, Xb) = -0.4541                         Prob > F          =     0.2079
                        
                                                               (Std. err. adjusted for 286 clusters in id)
                        ----------------------------------------------------------------------------------
                                         |               Robust
                             REM_PROXY_w | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
                        -----------------+----------------------------------------------------------------
                                ABS_DA_w |  -5.286474   6.021732    -0.88   0.380    -17.10252    6.529577
                                POST_REG |  -.3211694   .4007492    -0.80   0.423    -1.107533    .4651945
                                    INBD |  -.0560114   .0544244    -1.03   0.304    -.1628049    .0507821
                        POSTREG_X_ABS_DA |   5.161341   5.760719     0.90   0.370    -6.142542    16.46522
                                   ROA_w |  -1.209218   1.027742    -1.18   0.240    -3.225889    .8074533
                                    Size |   .1252531   .1103738     1.13   0.257    -.0913261    .3418323
                                 MTB_x_w |   .0052143   .0276592     0.19   0.851    -.0490596    .0594882
                                   LEV_w |  -.1997928   .2968749    -0.67   0.501     -.782331    .3827453
                                 NOA_X_w |   .0038331   .0220354     0.17   0.862    -.0394056    .0470718
                                         |
                                    Year |
                                   1997  |   .1785558   .2653733     0.67   0.501    -.3421689    .6992805
                                   1998  |   .1172968   .1424572     0.82   0.410    -.1622377    .3968313
                                   1999  |  -.0227091   .0529922    -0.43   0.668    -.1266921    .0812739
                                   2000  |   .0097312   .0393736     0.25   0.805    -.0675291    .0869915
                                   2001  |   .0194177   .0398292     0.49   0.626    -.0587365    .0975719
                                   2002  |   .0124077    .032446     0.38   0.702     -.051259    .0760744
                                   2003  |          0  (omitted)
                                         |
                                   _cons |  -1.407409   1.150831    -1.22   0.222    -3.665609    .8507912
                        -----------------+----------------------------------------------------------------
                                 sigma_u |  .29809241
                                 sigma_e |  .26925785
                                     rho |  .55069227   (fraction of variance due to u_i)
                        ----------------------------------------------------------------------------------
                        Instrumented: ABS_DA_w
                         Instruments: POST_REG INBD POSTREG_X_ABS_DA ROA_w Size MTB_x_w LEV_w NOA_X_w
                                      1997.Year 1998.Year 1999.Year 2000.Year 2001.Year 2002.Year C_PROD_w
                        Click image for larger version

Name:	Screen Shot 2565-05-29 at 02.20.18.png
Views:	1
Size:	108.2 KB
ID:	1666676

                        Comment


                        • #13
                          If you add the option -first-, you get the first-stage estimates.

                          Code:
                          xtivreg REM_PROXY_w POST_REG INBD POSTREG_X_ABS_DA ///
                          ROA_w  Size MTB_x_w LEV_w NOA_X_w (ABS_DA_w = C_PROD_w) ///
                          i.Year, fe vce(robust) small first

                          Comment


                          • #14
                            Andrew Musau Thank you Andrew for you help. So, is it the case that the authors of the papers might have reported 2SLS regression coefficients for all variables and first-stage estimates for the instrumental variables ? I am sorry the question might be a bit odd but to be honest few of these papers do not really through in talking about the details of their 2SLS regressions. Thank you once again for you kind input.

                            Comment


                            • #15
                              Must be the case.

                              Comment

                              Working...
                              X