Announcement

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

  • Hausman test

    Hi,

    I'm running a panel regression. These are my panel commands, followed by regression commands for random effects and fixed effects and hausman test. But the hausman test says,

    chi2(0) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = 0.00
    Prob>chi2 = .
    (V_b-V_B is not positive definite)


    Can someone please guide me? Is there an issue in my data set, panel commands or what?

  • #2
    Maryam:
    what if you invoke the option -sigmamore- available from -hausman-?
    Kind regards,
    Carlo
    (Stata 18.0 SE)

    Comment


    • #3
      Carlo Lazzaro I just tried and no luck. Is there an issue with my data?

      Comment


      • #4
        egen idc = group( Distrcts)
        move idc Distrcts
        xtset idc
        xtset idc Years, yearly
        xtreg MPI BISPEXP CANTONMENT BANKS AGRICULTURE
        xtreg MPI BISPEXP CANTONMENT BANKS AGRICULTURE, fe
        estimate store random
        estimate store fixed
        hausman random fixed


        These are my commands

        Comment


        • #5
          Maryam:
          the main issue is that the correct sequence should be:
          Code:
          hausman fixed random
          Besides,
          Code:
          xtset idc
          is redundant vs
          Code:
          xtset idc Years, yearly
          Kind regards,
          Carlo
          (Stata 18.0 SE)

          Comment


          • #6
            Thank you Cralo, Ill try these.

            Comment


            • #7
              You also need to put -estimates store random- soon after the first xtreg command:
              xtreg MPI BISPEXP CANTONMENT BANKS AGRICULTURE
              estimate store random
              xtreg MPI BISPEXP CANTONMENT BANKS AGRICULTURE, fe
              estimate store fixed

              Comment


              • #8
                Thanks Eric, will do

                Comment


                • #9
                  Maryam:
                  as Eric skillfully noticed, your delay in saving -xtreg,re- (that I baldly overlooked) made -hausman- comparing the same -fe- model (that you actually saved, inadvertently, twice):, as you can see from the following toy-example, that replicates your discouraging (but really frequent even when every step before -hausman- is correct) -hausman- result:
                  Code:
                  . xtreg ln_wage age, fe
                  
                  Fixed-effects (within) regression               Number of obs     =     28,510
                  Group variable: idcode                          Number of groups  =      4,710
                  
                  R-sq:                                           Obs per group:
                       within  = 0.1026                                         min =          1
                       between = 0.0877                                         avg =        6.1
                       overall = 0.0774                                         max =         15
                  
                                                                  F(1,23799)        =    2720.20
                  corr(u_i, Xb)  = 0.0314                         Prob > F          =     0.0000
                  
                  ------------------------------------------------------------------------------
                       ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                           age |   .0181349   .0003477    52.16   0.000     .0174534    .0188164
                         _cons |   1.148214   .0102579   111.93   0.000     1.128107     1.16832
                  -------------+----------------------------------------------------------------
                       sigma_u |  .40635023
                       sigma_e |  .30349389
                           rho |  .64192015   (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------
                  F test that all u_i=0: F(4709, 23799) = 8.81                 Prob > F = 0.0000
                  
                  . xtreg ln_wage age, re
                  
                  Random-effects GLS regression                   Number of obs     =     28,510
                  Group variable: idcode                          Number of groups  =      4,710
                  
                  R-sq:                                           Obs per group:
                       within  = 0.1026                                         min =          1
                       between = 0.0877                                         avg =        6.1
                       overall = 0.0774                                         max =         15
                  
                                                                  Wald chi2(1)      =    3140.35
                  corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                  
                  ------------------------------------------------------------------------------
                       ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                  -------------+----------------------------------------------------------------
                           age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
                         _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
                  -------------+----------------------------------------------------------------
                       sigma_u |  .36972456
                       sigma_e |  .30349389
                           rho |  .59743613   (fraction of variance due to u_i)
                  ------------------------------------------------------------------------------
                  
                  . estimates store fe
                  
                  . estimates store re
                  
                  . hausman fe re
                  
                  Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients being tested (1); 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.
                  -------------+----------------------------------------------------------------
                           age |    .0185667     .0185667               0               0
                  ------------------------------------------------------------------------------
                                             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(0) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                            =        0.00
                                  Prob>chi2 =           .
                                  (V_b-V_B is not positive definite)
                  Set aside my need for a new pair of spectacles, what happened remind me of the need to post what one have typed and received from Stata (output tables included), as recommended by the FAQ.
                  Kind regards,
                  Carlo
                  (Stata 18.0 SE)

                  Comment


                  • #10
                    Thank you Carlo for the help!

                    Comment

                    Working...
                    X