Announcement

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

  • Hausman Test for FE and RE

    Hi, I have a question, if my Hausman test is like below, which model should I use? Is it FE or RE?



    Code:
    . hausman fe re
    
                     ---- Coefficients ----
                 |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                 |       fe           re         Difference       Std. err.
    -------------+----------------------------------------------------------------
       div_yield |    .0171481     .0126373        .0045108         .051287
       firm_size |   -.1940015    -.3004789        .1064773        .3209853
    ------------------------------------------------------------------------------
                              b = Consistent under H0 and Ha; obtained from xtreg.
               B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
    
    Test of H0: Difference in coefficients not systematic
    
        chi2(2) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                =   0.12
    Prob > chi2 = 0.9432


    I also did this command to rerun RE, then test for presence of u_i:

    Code:
    . quietly xtreg caar div_yield firm_size, re
    
    . xttest0
    
    Breusch and Pagan Lagrangian multiplier test for random effects
    
            caar[companyid,t] = Xb + u[companyid] + e[companyid,t]
    
            Estimated results:
                             |       Var     SD = sqrt(Var)
                    ---------+-----------------------------
                        caar |   112.5604       10.60945
                           e |   107.0638       10.34717
                           u |   6.004459         2.4504
    
            Test: Var(u) = 0
                                 chibar2(01) =     2.89
                              Prob > chibar2 =   0.0444

  • #2
    Kathy:
    you should go -xtreg,re- because:
    1) -hausman- does not eject the null (its H0 is: -re- is the way to go;
    2) -xttest0- outcome tells you that your dataset actually shows ecidence of a panel-wise effect.

    As an aside, with two predictors only your model is at high risk of misspecification.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Mr Carlo, thank you for responding.

      Will use the RE model.


      As an aside, with two predictors only your model is at high risk of misspecification - Does this mean that I have to add more variables?

      Comment


      • #4
        Kathy:
        first off, please call me Carlo. Thanks.
        Two precitors are very unlikely to give back any informative result (being it statistically significant or not).
        That said, there's a pretty easy to implement procedure to check the correct specification form of your regressand (in general terms, this test tells you whether your regression is correctly specified or not; see alo -linktest-, that unfrtunately you cannot call after -xtreg-):
        Code:
        . use "https://www.stata-press.com/data/r17/nlswork.dta"
        (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
        
        . xtreg ln_wage c.age##c.age
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-squared:                                      Obs per group:
             Within  = 0.1087                                         min =          1
             Between = 0.1015                                         avg =        6.1
             Overall = 0.0870                                         max =         15
        
                                                        Wald chi2(2)      =    3388.51
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 age |   .0590339   .0027172    21.73   0.000     .0537083    .0643596
                     |
         c.age#c.age |  -.0006758   .0000451   -15.00   0.000    -.0007641   -.0005876
                     |
               _cons |   .5479714   .0397476    13.79   0.000     .4700675    .6258752
        -------------+----------------------------------------------------------------
             sigma_u |   .3654049
             sigma_e |  .30245467
                 rho |  .59342665   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . predict fitted, xb
        (24 missing values generated)
        
        . g sq_fitted=fitted^2
        (24 missing values generated)
        
        . xtreg ln_wage fitted sq_fitted
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-squared:                                      Obs per group:
             Within  = 0.1088                                         min =          1
             Between = 0.1045                                         avg =        6.1
             Overall = 0.0887                                         max =         15
        
                                                        Wald chi2(2)      =    3407.81
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
              fitted |   2.805959   .4327827     6.48   0.000      1.95772    3.654197
           sq_fitted |  -.5516341   .1320951    -4.18   0.000    -.8105358   -.2927324
               _cons |  -1.468083   .3527217    -4.16   0.000    -2.159405   -.7767613
        -------------+----------------------------------------------------------------
             sigma_u |  .36481589
             sigma_e |  .30242516
                 rho |  .59269507   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . test sq_fitted
        
         ( 1)  sq_fitted = 0
        
                   chi2(  1) =   17.44
                 Prob > chi2 =    0.0000
        
        .
        As the -test- outcome reaches statistical significance, the regression is (as expected) misspecified. More predictors and/or interactions are called for to give a fair and true view of the data generating process.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you very much for the detailed explanation, Carlo. I really appreciate it.

          Comment

          Working...
          X