Announcement

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

  • Hausman test for panel data

    I am performing a Hausman test to decide whether to use fixed effects or random effects model. The results I get are as follows:
    HTML Code:
    . *Huasman test
    
    . 
    .  xtreg  lnTotal lnINS lnINFO EX Fopen  DCC  DDiff lnINF lnliquid lnreserve GDP  DC, fe
    
    Fixed-effects (within) regression               Number of obs     =        166
    Group variable: Country1                        Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.0961                                         min =         14
         between = 0.0023                                         avg =       16.6
         overall = 0.0000                                         max =         19
    
                                                    F(11,145)         =       1.40
    corr(u_i, Xb)  = -0.1736                        Prob > F          =     0.1782
    
    ------------------------------------------------------------------------------
         lnTotal |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           lnINS |  -.0185582   .0639773    -0.29   0.772    -.1450068    .1078903
          lnINFO |  -.0898688   .0363678    -2.47   0.015    -.1617483   -.0179893
              EX |   .0006407   .0026112     0.25   0.807    -.0045203    .0058016
           Fopen |  -.0000704    .006281    -0.01   0.991    -.0124846    .0123438
             DCC |   .0696891   .0565816     1.23   0.220    -.0421421    .1815203
           DDiff |   -.000171   .0003266    -0.52   0.601    -.0008164    .0004744
           lnINF |  -.0024146   .0038216    -0.63   0.528    -.0099678    .0051386
        lnliquid |   .0069447   .0162551     0.43   0.670    -.0251829    .0390722
       lnreserve |  -.0000648   .0094526    -0.01   0.995    -.0187476    .0186179
             GDP |  -2.41e-07   8.55e-07    -0.28   0.779    -1.93e-06    1.45e-06
              DC |    .000066   .0001659     0.40   0.691    -.0002619    .0003938
           _cons |    2.41544   .2245863    10.76   0.000     1.971554    2.859326
    -------------+----------------------------------------------------------------
         sigma_u |  .10458566
         sigma_e |  .03365599
             rho |  .90616053   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(9, 145) = 39.74                     Prob > F = 0.0000
    
    . 
    . . est store fe
    
    . 
    .  xtreg  lnTotal lnINS lnINFO EX Fopen  DCC  DDiff lnINF lnliquid lnreserve GDP  DC, re
    
    Random-effects GLS regression                   Number of obs     =        166
    Group variable: Country1                        Number of groups  =         10
    
    R-sq:                                           Obs per group:
         within  = 0.0333                                         min =         14
         between = 0.8975                                         avg =       16.6
         overall = 0.7080                                         max =         19
    
                                                    Wald chi2(11)     =     373.44
    corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
    
    ------------------------------------------------------------------------------
         lnTotal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           lnINS |  -.2017622   .0624443    -3.23   0.001    -.3241509   -.0793735
          lnINFO |  -.3138742   .0415717    -7.55   0.000    -.3953532   -.2323952
              EX |   .0198729   .0019662    10.11   0.000     .0160192    .0237266
           Fopen |   .0489099   .0037879    12.91   0.000     .0414857    .0563341
             DCC |   .1402536   .1003481     1.40   0.162     -.056425    .3369322
           DDiff |  -.0001883    .000587    -0.32   0.748    -.0013388    .0009622
           lnINF |  -.0174453   .0056082    -3.11   0.002    -.0284372   -.0064533
        lnliquid |   .1004124   .0197108     5.09   0.000       .06178    .1390448
       lnreserve |   .0142735   .0091647     1.56   0.119     -.003689     .032236
             GDP |   2.92e-06   3.19e-07     9.17   0.000     2.30e-06    3.55e-06
              DC |  -.0002536   .0002279    -1.11   0.266    -.0007003    .0001932
           _cons |   3.094598   .2414919    12.81   0.000     2.621283    3.567914
    -------------+----------------------------------------------------------------
         sigma_u |          0
         sigma_e |  .03365599
             rho |          0   (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    
    . 
    . . est store re
    
    . 
    . . hausman fe re,sigmamore
    
    Note: the rank of the differenced variance matrix (9) does not equal the number of coefficients being tested
            (11); be sure this is what you expect, or there may be problems computing the test.  Examine the output
            of your estimators for anything unexpected and possibly consider scaling your variables so that the
            coefficients are on a similar scale.
    
                     ---- Coefficients ----
                 |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                 |       fe           re         Difference          S.E.
    -------------+----------------------------------------------------------------
           lnINS |   -.0185582    -.2017622         .183204        .0972626
          lnINFO |   -.0898688    -.3138742        .2240054        .0508787
              EX |    .0006407     .0198729       -.0192322        .0042882
           Fopen |   -.0000704     .0489099       -.0489803        .0106965
             DCC |    .0696891     .1402536       -.0705645        .0194799
           DDiff |    -.000171    -.0001883        .0000172         .000059
           lnINF |   -.0024146    -.0174453        .0150307        .0040267
        lnliquid |    .0069447     .1004124       -.0934677        .0217691
       lnreserve |   -.0000648     .0142735       -.0143383        .0144098
             GDP |   -2.41e-07     2.92e-06       -3.16e-06        1.51e-06
              DC |     .000066    -.0002536        .0003195        .0001946
    ------------------------------------------------------------------------------
                               b = consistent under Ho and Ha; obtained from xtreg
                B = inconsistent under Ha, efficient under Ho; obtained from xtreg
    
        Test:  Ho:  difference in coefficients not systematic
    
                      chi2(9) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                              =      109.57
                    Prob>chi2 =      0.0000
                    (V_b-V_B is not positive definite)
    
    . 
    . *Breusch Pagan  LM test for random effects VS OLS
    
    . 
    . . quietly xtreg Total INS INFO Fopen Topen Diff INF    liquid reserve DC, re
    
    . 
    . xttest0
    
    Breusch and Pagan Lagrangian multiplier test for random effects
    
            Total[Country1,t] = Xb + u[Country1] + e[Country1,t]
    
            Estimated results:
                             |       Var     sd = sqrt(Var)
                    ---------+-----------------------------
                       Total |    .473289         .68796
                           e |   .0465037       .2156472
                           u |          0              0
    
            Test:   Var(u) = 0
                                 chibar2(01) =     0.00
                              Prob > chibar2 =   1.0000
    
    . 
    . ** Test FE or RE STD**
    
    . 
    . xtoverid
    Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS
    r(198);

    How do I go about interpreting the results?

  • #2
    Abdelmoneam:
    I would repeat -hausman- with the -sigmamore- option.
    The -xttest0- should be performed before (and not after) -hausman-.
    That said, I'm under the impression that the -fe- specification fits your data better than the -re- one.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you,

      I did the xttest0 before hausman and it gives me the same results

      Comment


      • #4
        Abdelmonean:
        have you add the -sigmamore- option to -hausman-?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Yes, I have

          Comment


          • #6
            Abdelmonean:
            I would go -fe-.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Can we apply hausman for a regression clustered by company ID over two years? And is there any easy legend explaining step by step about whether endogeneity exists and so on?

              Comment


              • #8
                Ferra:
                welcome to this forum.
                1),no, you should switch to the community-contributed command -xtoverid- (assuming that you refer to -xtreg-);
                2) there's no hard and fast rule about endogeneity detection. Take a look at the reference quoted in -xtivreg- and -ivregress-.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment

                Working...
                X