Announcement

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

  • Need help to interpret the result of Hausman test

    Dear Statalist Member,

    I hope everything is fine.

    I am doing a project with 12 variables (data panel which consist of 3 years and 33 provinces dataset). I just perform the Hausman test in order to see if I have to proceed with FE or RE models. Regarding the Hausman test result. This is the result of my Hausman test.

    .xtset id year

    panel variable: id (strongly balanced)
    time variable: year, 2009 to 2014, but with gaps
    delta: 1 unit

    .xtreg realgdp consumption, fe

    Fixed-effects (within) regression Number of obs = 99
    Group variable: id Number of groups = 33

    R-sq: Obs per group:
    within = 0.9623 min = 3
    between = 0.9556 avg = 3.0
    overall = 0.9135 max = 3

    F(1,65) = 1658.24
    corr(u_i, Xb) = -0.8232 Prob > F = 0.0000

    ------------------------------------------------------------------------------
    realgdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    consumption | 1.962263 .0481874 40.72 0.000 1.866026 2.0585
    _cons | -7.01e+07 7494447 -9.35 0.000 -8.50e+07 -5.51e+07
    -------------+----------------------------------------------------------------
    sigma_u | 1.421e+08
    sigma_e | 47540049
    rho | .89938957 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(32, 65) = 8.64 Prob > F = 0.0000

    .estimates store fe_panel

    .xtreg realgdp consumption, re

    Random-effects GLS regression Number of obs = 99
    Group variable: id Number of groups = 33

    R-sq: Obs per group:
    within = 0.9623 min = 3
    between = 0.9556 avg = 3.0
    overall = 0.9135 max = 3

    Wald chi2(1) = 1002.79
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

    ------------------------------------------------------------------------------
    realgdp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    consumption | 1.590491 .0502257 31.67 0.000 1.492051 1.688932
    _cons | -2.55e+07 1.40e+07 -1.82 0.069 -5.30e+07 1953742
    -------------+----------------------------------------------------------------
    sigma_u | 40605907
    sigma_e | 47540049
    rho | .42181724 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    .estimates store re_panel

    hausman fe_panel re_panel

    ---- Coefficients ----
    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | fe_panel re_panel Difference S.E.
    -------------+----------------------------------------------------------------
    consumption | 1.962263 1.590491 .3717717 .
    ------------------------------------------------------------------------------
    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(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = -689.00 chi2<0 ==> model fitted on these
    data fails to meet the asymptotic
    assumptions of the Hausman test;
    see suest for a generalized test

    Regarding hausman test result above, I have a question:

    1. Please comment about my dataset availbility, is it good enough to run a panel data?
    2. What informations we get from this Hausman test result?
    3. How to interpret my Hausman test result?
    4. Which one should I choose, RE or FE?

    However, i will really appreciate it if my few question can be attended in an easy explanation.

    Thanks in Advance

    Ariyo DP Irhamna
    Thanks in Advance,

    Ariyo DP Irhamna
    (Stata 15 SE)

  • #2
    Dear Statalist Member,

    I hope everything is fine.

    I am doing a project with 12 variables (data panel which consist of 3 years and 33 provinces dataset). I just perform the Hausman test in order to see if I have to proceed with FE or RE models. Regarding the Hausman test result. This is the result of my Hausman test.

    .xtset id year

    panel variable: id (strongly balanced)
    time variable: year, 2009 to 2014, but with gaps
    delta: 1 unit

    .xtreg realgdp consumption, fe

    Fixed-effects (within) regression Number of obs = 99
    Group variable: id Number of groups = 33

    R-sq: Obs per group:
    within = 0.9623 min = 3
    between = 0.9556 avg = 3.0
    overall = 0.9135 max = 3

    F(1,65) = 1658.24
    corr(u_i, Xb) = -0.8232 Prob > F = 0.0000

    ------------------------------------------------------------------------------
    realgdp | Coef. Std. Err. t P>|t| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    consumption | 1.962263 .0481874 40.72 0.000 1.866026 2.0585
    _cons | -7.01e+07 7494447 -9.35 0.000 -8.50e+07 -5.51e+07
    -------------+----------------------------------------------------------------
    sigma_u | 1.421e+08
    sigma_e | 47540049
    rho | .89938957 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------
    F test that all u_i=0: F(32, 65) = 8.64 Prob > F = 0.0000

    .estimates store fe_panel

    .xtreg realgdp consumption, re

    Random-effects GLS regression Number of obs = 99
    Group variable: id Number of groups = 33

    R-sq: Obs per group:
    within = 0.9623 min = 3
    between = 0.9556 avg = 3.0
    overall = 0.9135 max = 3

    Wald chi2(1) = 1002.79
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

    ------------------------------------------------------------------------------
    realgdp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    consumption | 1.590491 .0502257 31.67 0.000 1.492051 1.688932
    _cons | -2.55e+07 1.40e+07 -1.82 0.069 -5.30e+07 1953742
    -------------+----------------------------------------------------------------
    sigma_u | 40605907
    sigma_e | 47540049
    rho | .42181724 (fraction of variance due to u_i)
    ------------------------------------------------------------------------------

    .estimates store re_panel

    hausman fe_panel re_panel

    ---- Coefficients ----
    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | fe_panel re_panel Difference S.E.
    -------------+----------------------------------------------------------------
    consumption | 1.962263 1.590491 .3717717 .
    ------------------------------------------------------------------------------
    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(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = -689.00 chi2<0 ==> model fitted on these
    data fails to meet the asymptotic
    assumptions of the Hausman test;
    see suest for a generalized test

    Regarding hausman test result above, I have a question:

    1. Please comment about my dataset availbility, is it good enough to run a panel data?
    2. What informations we get from this Hausman test result?
    3. How to interpret my Hausman test result?
    4. Which one should I choose, RE or FE?

    However, i will really appreciate it if my few question can be attended in an easy explanation.

    Thanks in Advance

    Ariyo DP Irhamna
    Thanks in Advance,

    Ariyo DP Irhamna
    (Stata 15 SE)

    Comment


    • #3
      Ariyo:
      I would try to re-run -hausman- with the -sigmamore- option.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Dear Carlo,

        Thank you for your prompt reply. I have tried the hausman with -sigmamore- option and here the result.

        . hausman fe_panel re_panel, sigmamore

        * * * * * * * * *---- Coefficients ----
        * * * * * * *| * * *(b) * * * * *(B) * * * * * *(b-B) * * sqrt(diag(V_b-V_B))
        * * * * * * *| * *fe_panel * * re_panel * * *Difference * * * * *S.E.
        -------------+----------------------------------------------------------------
        *consumption | * *1.962263 * * 1.590491 * * * *.3717717 * * * *.0508803
        ------------------------------------------------------------------------------
        * * * * * * * * * * * * * *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(1) = (b-B)'[(V_b-V_B)^(-1)](b-B)
        * * * * * * * * * * * * * = * * * 53.39
        * * * * * * * * Prob>chi2 = * * *0.0000

        So back to my first post questions:
        1. Please comment about my dataset availbility, is it good enough to run a panel data?
        2. What informations we get from this Hausman test result?
        3. How to interpret my Hausman test result?
        4. Which one should I choose, RE or FE?


        Thank you
        Ariyo
        (Stata 15 SE)
        Thanks in Advance,

        Ariyo DP Irhamna
        (Stata 15 SE)

        Comment


        • #5
          Ariyo:
          all your questions boil down to an unique answer: go -xtreg, fe-.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            I just wish to add that the output is barely readable. In the forthcoming queries, and according to the FAQ, I recommend to use CODE delimiters so as to make it fully readable.

            That said, with regards to "data availability" being "good enough" for panel data analysis, it seems you have a small sample size (groups = 33) and only 3 measures. What is more, there seems to be only one predictor in the model.

            Finally, the theme is out of my field. However, if I got it right, the model seems to imply that the predicted values of realgdp would increase according to an increase in consumption, and I wonder whether this is the correct direction, theoretically speaking, or the opposite, I mean, an increase in realgdp leading to an increase in consumption. Who knows...
            Last edited by Marcos Almeida; 11 Jul 2017, 09:20.
            Best regards,

            Marcos

            Comment


            • #7
              Ariyo:
              Marcos highlights an important issue, that I ovelooked in my last reply, since I interpreted your example your code lines as an example for getting advice on a possible outcome of -hausman-.
              However, if what I figured out is not the case, how can it be that you have 12 variables but one predictor only is included in the right-hand side of your regression model?
              Hence, the main question is not whether -hausman. test tells you something substantive about your dataset and points you to the right specification, but whether a simple panel data regression is meaningful at all for your research purposes.
              As an aside, Marcos' recommendation about using CODE delimiters is highly commendable.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thank you Marcos and Carlo for your reply, I just realised that my output is unreadable.

                I have modified my model however I am still not sure about the result. so back to my first post questions:

                1. How about my current model, is it good enough to run a panel data with small dataset (which noted by Marcos above)?
                2. What informations we get from this Hausman test result?
                3. How to interpret my Hausman test result?
                4. Which one should I choose, RE or FE? and how to interpret if RE or FE?

                Many Thanks,
                Ariyo DP Irhamna
                (Stata 15 SE)


                Code:
                 xtset id year
                       panel variable:  id (strongly balanced)
                        time variable:  year, 2009 to 2014, but with gaps
                                delta:  1 unit
                
                . xtreg y x1 x2 x3 x4 x7 x10, fe
                
                Fixed-effects (within) regression               Number of obs     =         99
                Group variable: id                              Number of groups  =         33
                
                R-sq:                                           Obs per group:
                     within  = 0.9815                                         min =          3
                     between = 0.8265                                         avg =        3.0
                     overall = 0.6453                                         max =          3
                
                                                                F(6,60)           =     529.46
                corr(u_i, Xb)  = -0.9701                        Prob > F          =     0.0000
                
                ------------------------------------------------------------------------------
                           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                          x1 |    2361.13   472.2413     5.00   0.000     1416.507    3305.753
                          x2 |   1.543548   .3088674     5.00   0.000      .925721    2.161375
                          x3 |   .1362727   .5374563     0.25   0.801    -.9387999    1.211345
                          x4 |    4030816    1480719     2.72   0.008      1068936     6992695
                          x7 |   64866.19   22187.25     2.92   0.005     20485.08    109247.3
                         x10 |   -3422031    2744474    -1.25   0.217     -8911796     2067734
                       _cons |  -5.47e+08   2.13e+08    -2.57   0.013    -9.72e+08   -1.22e+08
                -------------+----------------------------------------------------------------
                     sigma_u |  7.396e+08
                     sigma_e |   34687884
                         rho |  .99780542   (fraction of variance due to u_i)
                ------------------------------------------------------------------------------
                F test that all u_i=0: F(32, 60) = 9.55                      Prob > F = 0.0000
                
                . estimates store fe_panel
                
                . xtreg y x1 x2 x3 x4 x7 x10, re
                
                Random-effects GLS regression                   Number of obs     =         99
                Group variable: id                              Number of groups  =         33
                
                R-sq:                                           Obs per group:
                     within  = 0.9734                                         min =          3
                     between = 0.9591                                         avg =        3.0
                     overall = 0.9503                                         max =          3
                
                                                                Wald chi2(6)      =    1771.80
                corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                
                ------------------------------------------------------------------------------
                           y |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                -------------+----------------------------------------------------------------
                          x1 |   3470.561   580.6697     5.98   0.000     2332.469    4608.653
                          x2 |   2.376159   .2812441     8.45   0.000     1.824931    2.927387
                          x3 |  -1.820384   .5207132    -3.50   0.000    -2.840963    -.799805
                          x4 |    1924600    1669823     1.15   0.249     -1348193     5197393
                          x7 |  -6409.437   1667.307    -3.84   0.000    -9677.299   -3141.576
                         x10 |   -2085484    2364562    -0.88   0.378     -6719941     2548972
                       _cons |  -1.38e+07   1.37e+08    -0.10   0.920    -2.82e+08    2.55e+08
                -------------+----------------------------------------------------------------
                     sigma_u |   12201677
                     sigma_e |   34687884
                         rho |  .11010841   (fraction of variance due to u_i)
                ------------------------------------------------------------------------------
                
                . estimates store re_panel
                
                . hausman fe_panel re_panel
                
                Note: the rank of the differenced variance matrix (4) does not equal the number of coefficients being tested
                        (6); 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_panel     re_panel      Difference          S.E.
                -------------+----------------------------------------------------------------
                          x1 |     2361.13     3470.561       -1109.431               .
                          x2 |    1.543548     2.376159       -.8326111        .1276747
                          x3 |    .1362727    -1.820384        1.956657         .133105
                          x4 |     4030816      1924600         2106216               .
                          x7 |    64866.19    -6409.437        71275.62        22124.51
                         x10 |    -3422031     -2085484        -1336547         1393192
                ------------------------------------------------------------------------------
                                           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(4) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                          =        4.70
                                Prob>chi2 =      0.3200
                                (V_b-V_B is not positive definite)
                
                . estimates table fe_panel re_panel
                
                ----------------------------------------
                    Variable |  fe_panel     re_panel   
                -------------+--------------------------
                          x1 |  2361.1301    3470.5611  
                          x2 |  1.5435478    2.3761589  
                          x3 |   .1362727   -1.8203843  
                          x4 |  4030815.5    1924599.9  
                          x7 |  64866.185   -6409.4375  
                         x10 | -3422031.2   -2085484.1  
                       _cons | -5.468e+08    -13760948  
                ----------------------------------------
                Thanks in Advance,

                Ariyo DP Irhamna
                (Stata 15 SE)

                Comment


                • #9
                  Well, I gather some if your questions are already answered, at least up to the point of the information given so far.

                  That said, you may also reflect about the large SEs as well as the quite different coefficients from both models.
                  Best regards,

                  Marcos

                  Comment


                  • #10
                    Ariyo:
                    the missing values in the first column to te right of the -hausman- outcome tables mirrors the evidfence that you have a limited dataset.
                    You may want to follow -hausman- recommendation and go -xtreg, re-, but consider that the limited sample size probably causes the lack of statistical significance of the -hausman- p-value.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Carlo Lazzaro, I have a similar problem. As you can see below, I tried to perform Hausman test. The null hypothesis is that difference in coefficients is not systematic and the result is Prob > chi2 = 0.0000. Does that mean I have to reject the null and use FE method instead? However, if I use FE model, then my R squared is significantly lower and most coefficients are insignificant. Hence another question - how can I justify the use of RE if I failed the Hausman test?

                      Thank you very much in advance!


                      Code:
                      xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector, fe 
                      
                      Fixed-effects (within) regression               Number of obs     =     81,014
                      Group variable: id                              Number of groups  =     45,174
                      
                      R-squared:                                      Obs per group:
                           Within  = 0.0136                                         min =          1
                           Between = 0.0765                                         avg =        1.8
                           Overall = 0.0675                                         max =          4
                      
                                                                      F(43,35797)       =      11.45
                      corr(u_i, Xb) = -0.0383                         Prob > F          =     0.0000
                      
                      ----------------------------------------------------------------------------------------------------
                                                   wages | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                      -----------------------------------+----------------------------------------------------------------
                                               high_qual |
                                    Other higher degree  |  -.0928267   .4884575    -0.19   0.849    -1.050218    .8645648
                                            A-level etc  |   .0182819   .3901527     0.05   0.963    -.7464291    .7829929
                                               GCSE etc  |  -.3006534    .506201    -0.59   0.553    -1.292823    .6915159
                                    Other qualification  |  -.9605771   .7118253    -1.35   0.177    -2.355776     .434622
                                       No qualification  |  -2.879779   .8422607    -3.42   0.001    -4.530635   -1.228922
                                                         |
                                            training_hrs |  -.0000712    .000388    -0.18   0.854    -.0008318    .0006893
                                                         |
                                      illness_disability |
                                                     no  |  -.0778907   .0936522    -0.83   0.406    -.2614519    .1056704
                                                         |
                                                     sex |
                                                 female  |   .4485456   2.485943     0.18   0.857    -4.423979     5.32107
                                                         |
                                                children |
                                                      1  |   .1282714   .1836384     0.70   0.485    -.2316655    .4882083
                                                      2  |   .4622015   .2649987     1.74   0.081    -.0572041     .981607
                                                      3  |   .0442143   .4279878     0.10   0.918    -.7946546    .8830833
                                                      4  |  -.2602339   .8243079    -0.32   0.752    -1.875902    1.355435
                                                      5  |  -1.442031   2.088447    -0.69   0.490     -5.53545    2.651389
                                                      6  |  -5.016402   3.488116    -1.44   0.150    -11.85322    1.820412
                                                         |
                                          general_health |
                                              very good  |  -.0055532   .0923854    -0.06   0.952    -.1866313     .175525
                                               or Poor?  |  -.2084222   .2762525    -0.75   0.451    -.7498855    .3330411
                                                         |
                                                  region |
                                             North West  |  -.5530689    1.45959    -0.38   0.705    -3.413909    2.307771
                               Yorkshire and the Humber  |  -2.145961   1.441226    -1.49   0.137    -4.970808    .6788853
                                          East Midlands  |   2.999986   1.523444     1.97   0.049     .0139899    5.985983
                                          West Midlands  |   4.373938   1.612606     2.71   0.007     1.213181    7.534694
                                        East of England  |   1.498337   1.479719     1.01   0.311    -1.401957    4.398631
                                                 London  |   1.065125    1.44671     0.74   0.462     -1.77047     3.90072
                                             South East  |   1.369021   1.404179     0.97   0.330    -1.383212    4.121254
                                             South West  |    .552194   1.506342     0.37   0.714    -2.400282     3.50467
                                                  Wales  |    1.09009   1.705773     0.64   0.523    -2.253277    4.433457
                                               Scotland  |    .915629   1.623863     0.56   0.573    -2.267192     4.09845
                                       Northern Ireland  |  -3.344014   3.238417    -1.03   0.302     -9.69141    3.003382
                                                         |
                                                     age |
                                        18-19 years old  |   .6114318   .4055764     1.51   0.132    -.1835102    1.406374
                                        20-24 years old  |    1.74053   .4566186     3.81   0.000      .845544    2.635517
                                        25-29 years old  |   2.709425   .5220407     5.19   0.000      1.68621    3.732641
                                        30-34 years old  |   3.427654    .562677     6.09   0.000      2.32479    4.530518
                                        35-39 years old  |   4.251303   .5949165     7.15   0.000     3.085249    5.417358
                                        40-44 years old  |   4.816463   .6195774     7.77   0.000     3.602072    6.030853
                                        45-49 years old  |   5.164924   .6400082     8.07   0.000     3.910488    6.419359
                                        50-54 years old  |   5.225232   .6620268     7.89   0.000      3.92764    6.522825
                                        55-59 years old  |   5.330005   .6887239     7.74   0.000     3.980085    6.679925
                                        60-64 years old  |   5.379775   .7261224     7.41   0.000     3.956553    6.802997
                                      65 years or older  |   4.311408    .813306     5.30   0.000     2.717303    5.905512
                                                         |
                                                  sector |
                      managerial & technical occupation  |   1.615665   .3315755     4.87   0.000     .9657667    2.265563
                                     skilled non-manual  |   .8074404   .3549795     2.27   0.023     .1116698    1.503211
                                         skilled manual  |  -2.100734   .3713009    -5.66   0.000    -2.828495   -1.372973
                              partly skilled occupation  |   .1310732   .3762136     0.35   0.728    -.6063168    .8684632
                                   unskilled occupation  |   .0818114   .4849397     0.17   0.866    -.8686851    1.032308
                                                         |
                                                   _cons |   6.510054   1.986823     3.28   0.001     2.615821    10.40429
                      -----------------------------------+----------------------------------------------------------------
                                                 sigma_u |  8.5185288
                                                 sigma_e |  5.1619774
                                                     rho |  .73142173   (fraction of variance due to u_i)
                      ----------------------------------------------------------------------------------------------------
                      F test that all u_i=0: F(45173, 35797) = 3.85                Prob > F = 0.0000
                      
                      
                      
                      . estimates store fe
                      
                      xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector, re
                      
                      Random-effects GLS regression                   Number of obs     =     81,014
                      Group variable: id                              Number of groups  =     45,174
                      
                      R-squared:                                      Obs per group:
                           Within  = 0.0093                                         min =          1
                           Between = 0.2259                                         avg =        1.8
                           Overall = 0.2153                                         max =          4
                      
                                                                      Wald chi2(43)     =   13494.78
                      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                      
                      ----------------------------------------------------------------------------------------------------
                                                   wages | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
                      -----------------------------------+----------------------------------------------------------------
                                               high_qual |
                                    Other higher degree  |  -2.226562   .1213105   -18.35   0.000    -2.464326   -1.988797
                                            A-level etc  |  -2.750473   .1055585   -26.06   0.000    -2.957363   -2.543582
                                               GCSE etc  |  -3.690913   .1114786   -33.11   0.000    -3.909407   -3.472419
                                    Other qualification  |  -4.429453   .1577683   -28.08   0.000    -4.738673   -4.120232
                                       No qualification  |  -5.281472   .1854816   -28.47   0.000     -5.64501   -4.917935
                                                         |
                                            training_hrs |   .0006149   .0003174     1.94   0.053    -7.30e-06    .0012371
                                                         |
                                      illness_disability |
                                                     no  |   .1494179   .0684527     2.18   0.029     .0152532    .2835826
                                                         |
                                                     sex |
                                                 female  |  -1.712939   .0848684   -20.18   0.000    -1.879278     -1.5466
                                                         |
                                                children |
                                                      1  |  -.3398704   .1087729    -3.12   0.002    -.5530613   -.1266795
                                                      2  |  -.2720838   .1282247    -2.12   0.034    -.5233996   -.0207681
                                                      3  |  -1.174362   .2151139    -5.46   0.000    -1.595978   -.7527469
                                                      4  |  -1.975734   .4807552    -4.11   0.000    -2.917997   -1.033471
                                                      5  |  -2.071639   1.181146    -1.75   0.079    -4.386643    .2433645
                                                      6  |  -4.674262    2.33589    -2.00   0.045    -9.252522   -.0960014
                                                         |
                                          general_health |
                                              very good  |   -.378106   .0689673    -5.48   0.000    -.5132795   -.2429325
                                               or Poor?  |  -.9154749   .2117265    -4.32   0.000    -1.330451   -.5004986
                                                         |
                                                  region |
                                             North West  |   .2585602   .2247362     1.15   0.250    -.1819145     .699035
                               Yorkshire and the Humber  |  -.2284908   .2328341    -0.98   0.326    -.6848373    .2278557
                                          East Midlands  |   .0518488   .2331266     0.22   0.824    -.4050709    .5087686
                                          West Midlands  |   .5359982   .2331594     2.30   0.022     .0790141    .9929822
                                        East of England  |   .9415514   .2282001     4.13   0.000     .4942875    1.388815
                                                 London  |   1.394893   .2199591     6.34   0.000     .9637811    1.826005
                                             South East  |   1.466192   .2183471     6.71   0.000     1.038239    1.894144
                                             South West  |  -.0282937   .2312368    -0.12   0.903    -.4815096    .4249222
                                                  Wales  |  -.2318236   .2358603    -0.98   0.326    -.6941013     .230454
                                               Scotland  |   .5588212   .2261004     2.47   0.013     .1156726     1.00197
                                       Northern Ireland  |  -.1259098   .2391234    -0.53   0.599    -.5945829    .3427634
                                                         |
                                                     age |
                                        18-19 years old  |   .3611545   .2740854     1.32   0.188    -.1760431     .898352
                                        20-24 years old  |   .9872718   .2612305     3.78   0.000     .4752694    1.499274
                                        25-29 years old  |   2.151108   .2647774     8.12   0.000     1.632154    2.670062
                                        30-34 years old  |   3.617456   .2642491    13.69   0.000     3.099537    4.135375
                                        35-39 years old  |   4.557396   .2642927    17.24   0.000     4.039391      5.0754
                                        40-44 years old  |   4.976156   .2619728    18.99   0.000     4.462698    5.489613
                                        45-49 years old  |   5.086969   .2606707    19.51   0.000     4.576063    5.597874
                                        50-54 years old  |   4.821479    .261474    18.44   0.000     4.308999    5.333959
                                        55-59 years old  |   4.646858   .2659043    17.48   0.000     4.125695    5.168021
                                        60-64 years old  |   3.821465   .2773119    13.78   0.000     3.277944    4.364986
                                      65 years or older  |   1.444498   .3071334     4.70   0.000     .8425278    2.046468
                                                         |
                                                  sector |
                      managerial & technical occupation  |  -.3820282    .149493    -2.56   0.011     -.675029   -.0890273
                                     skilled non-manual  |   -2.93446   .1628875   -18.02   0.000    -3.253714   -2.615206
                                         skilled manual  |  -6.914072   .1672881   -41.33   0.000    -7.241951   -6.586194
                              partly skilled occupation  |  -4.267661     .17175   -24.85   0.000    -4.604285   -3.931038
                                   unskilled occupation  |  -4.637669   .2287794   -20.27   0.000    -5.086069    -4.18927
                                                         |
                                                   _cons |   13.46299   .3555006    37.87   0.000     12.76622    14.15976
                      -----------------------------------+----------------------------------------------------------------
                                                 sigma_u |  6.4843857
                                                 sigma_e |  5.1619774
                                                     rho |  .61210157   (fraction of variance due to u_i)
                      ----------------------------------------------------------------------------------------------------
                      
                      .  estimates store re
                      
                      hausman fe re, sigmamore
                      
                      Note: the rank of the differenced variance matrix (42) does not equal the number of coefficients being tested (43); 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       Std. err.
                      -------------+----------------------------------------------------------------
                         high_qual |
                                2  |   -.0928267    -2.226562        2.133735        .4754323
                                3  |    .0182819    -2.750473        2.768754        .3774327
                                4  |   -.3006534    -3.690913         3.39026        .4961182
                                5  |   -.9605771    -4.429453        3.468875          .69742
                                9  |   -2.879779    -5.281472        2.401693        .8254855
                      training_hrs |   -.0000712     .0006149       -.0006861        .0002262
                      2.illness_~y |   -.0778907     .1494179       -.2273086        .0645323
                             2.sex |    .4485456    -1.712939        2.161484        2.495736
                          children |
                                1  |    .1282714    -.3398704        .4681418        .1489867
                                2  |    .4622015    -.2720838        .7342853        .2332787
                                3  |    .0442143    -1.174362        1.218577        .3722351
                                4  |   -.2602339    -1.975734          1.7155        .6741761
                                5  |   -1.442031    -2.071639        .6296089        1.733787
                                6  |   -5.016402    -4.674262       -.3421401        2.611666
                      general_he~h |
                                2  |   -.0055532     -.378106        .3725528        .0620958
                                5  |   -.2084222    -.9154749        .7070527        .1793842
                            region |
                                2  |   -.5530689     .2585602       -.8116291         1.44886
                                3  |   -2.145961    -.2284908        -1.91747        1.428894
                                4  |    2.999986     .0518488        2.948138        1.512468
                                5  |    4.373938     .5359982         3.83794        1.603026
                                6  |    1.498337     .9415514        .5567855        1.468785
                                7  |    1.065125     1.394893        -.329768        1.436505
                                8  |    1.369021     1.466192       -.0971707        1.393522
                                9  |     .552194    -.0282937        .5804877        1.495377
                               10  |     1.09009    -.2318236        1.321914        1.697171
                               11  |     .915629     .5588212        .3568077        1.615456
                               12  |   -3.344014    -.1259098       -3.218104        3.244252
                               age |
                                3  |    .6114318     .3611545        .2502773        .3014292
                                4  |     1.74053     .9872718        .7532585        .3770252
                                5  |    2.709425     2.151108        .5583171        .4526458
                                6  |    3.427654     3.617456        -.189802        .4996459
                                7  |    4.251303     4.557396       -.3060922        .5359862
                                8  |    4.816463     4.976156       -.1596928        .5645565
                                9  |    5.164924     5.086969         .077955        .5876835
                               10  |    5.225232     4.821479         .403753        .6114583
                               11  |    5.330005     4.646858        .6831471         .638696
                               12  |    5.379775     3.821465         1.55831        .6746319
                               13  |    4.311408     1.444498        2.866909        .7570522
                            sector |
                                2  |    1.615665    -.3820282        1.997693         .297641
                                3  |    .8074404     -2.93446          3.7419         .317206
                                4  |   -2.100734    -6.914072        4.813338        .3333586
                                5  |    .1310732    -4.267661        4.398735        .3366316
                                6  |    .0818114    -4.637669        4.719481        .4300662
                      ------------------------------------------------------------------------------
                                                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(42) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                                  = 612.65
                      Prob > chi2 = 0.0000

                      Comment


                      • #12
                        Guest:
                        I think that there are at last three issues before concerning with -hausman- results:
                        1) with such a sky-rocketing number of panels, the -vce(cluster panelid)- standard errors are mandatory (BTW: with -xtreg-, unlike -regress-, you can invoke -robust- to have the very same cluster-robust standard errors that you get from -vece(cluster panelid)-. If you go (as I recommend) that way, plese note the you should switch from -hausman- to the community-contributed module -xtoverid-;
                        2) are you sure that all te relevant predictors and/or interactions were included in the right-hand side of your regression equation?
                        3) have you checked that the functional form of the regressand is correctly specified?

                        In addition:
                        1) when it comes to -fe- we take a look at within R_Sq (that seems low in your case); when it comes to -re-, it's the turn of between R-sq (that seems acceptable);
                        2) it's good ahabit to include -timevar- among the predictors when we go -fe-;
                        3) the issue with using -re- when you should go -fe- is a matter of consistency of the estimator.
                        Last edited by sladmin; 25 Apr 2022, 07:30. Reason: anonymize original poster
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Thank you for such a prompt response Carlo Lazzaro! I did as you suggested, but I am encountering "1b: operator invalid r(198)" error. I am not sure where I have gone wrong - have I followed your suggestions correctly?

                          Code:
                          xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector, re vce(cluster id)
                          
                          Random-effects GLS regression                   Number of obs     =     81,014
                          Group variable: id                              Number of groups  =     45,174
                          
                          R-squared:                                      Obs per group:
                               Within  = 0.0093                                         min =          1
                               Between = 0.2259                                         avg =        1.8
                               Overall = 0.2153                                         max =          4
                          
                                                                          Wald chi2(43)     =   11825.03
                          corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                          
                                                                                (Std. err. adjusted for 45,174 clusters in id)
                          ----------------------------------------------------------------------------------------------------
                                                             |               Robust
                                                       wages | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                          -----------------------------------+----------------------------------------------------------------
                                                   high_qual |
                                        Other higher degree  |  -2.226562   .1291234   -17.24   0.000    -2.479639   -1.973484
                                                A-level etc  |  -2.750473   .1155294   -23.81   0.000    -2.976906   -2.524039
                                                   GCSE etc  |  -3.690913   .1140873   -32.35   0.000     -3.91452   -3.467306
                                        Other qualification  |  -4.429453   .1463206   -30.27   0.000    -4.716236    -4.14267
                                           No qualification  |  -5.281472   .1727665   -30.57   0.000    -5.620089   -4.942856
                                                             |
                                                training_hrs |   .0006149   .0002984     2.06   0.039       .00003    .0011998
                                                             |
                                          illness_disability |
                                                         no  |   .1494179   .0708485     2.11   0.035     .0105575    .2882783
                                                             |
                                                         sex |
                                                     female  |  -1.712939   .0851025   -20.13   0.000    -1.879737   -1.546141
                                                             |
                                                    children |
                                                          1  |  -.3398704    .097535    -3.48   0.000    -.5310355   -.1487054
                                                          2  |  -.2720838   .1301761    -2.09   0.037    -.5272243   -.0169434
                                                          3  |  -1.174362   .1976833    -5.94   0.000    -1.561814   -.7869101
                                                          4  |  -1.975734   .3193612    -6.19   0.000    -2.601671   -1.349797
                                                          5  |  -2.071639   .7868031    -2.63   0.008    -3.613745   -.5295336
                                                          6  |  -4.674262   1.116908    -4.19   0.000    -6.863361   -2.485162
                                                             |
                                              general_health |
                                                  very good  |   -.378106   .0746783    -5.06   0.000    -.5244728   -.2317392
                                                   or Poor?  |  -.9154749   .1839044    -4.98   0.000    -1.275921   -.5550288
                                                             |
                                                      region |
                                                 North West  |   .2585602    .177916     1.45   0.146    -.0901486    .6072691
                                   Yorkshire and the Humber  |  -.2284908   .1794094    -1.27   0.203    -.5801268    .1231452
                                              East Midlands  |   .0518488    .189648     0.27   0.785    -.3198545    .4235521
                                              West Midlands  |   .5359982   .1955516     2.74   0.006     .1527241    .9192723
                                            East of England  |   .9415514   .1921035     4.90   0.000     .5650355    1.318067
                                                     London  |   1.394893   .1875851     7.44   0.000     1.027233    1.762553
                                                 South East  |   1.466192   .1884479     7.78   0.000     1.096841    1.835543
                                                 South West  |  -.0282937   .1922539    -0.15   0.883    -.4051044     .348517
                                                      Wales  |  -.2318236   .1853624    -1.25   0.211    -.5951273      .13148
                                                   Scotland  |   .5588212   .1774352     3.15   0.002     .2110545    .9065879
                                           Northern Ireland  |  -.1259098   .1794076    -0.70   0.483    -.4775421    .2257226
                                                             |
                                                         age |
                                            18-19 years old  |   .3611545   .2141934     1.69   0.092    -.0586569    .7809658
                                            20-24 years old  |   .9872718   .2102286     4.70   0.000     .5752312    1.399312
                                            25-29 years old  |   2.151108    .201974    10.65   0.000     1.755246     2.54697
                                            30-34 years old  |   3.617456   .2031097    17.81   0.000     3.219368    4.015543
                                            35-39 years old  |   4.557396   .2068166    22.04   0.000     4.152042    4.962749
                                            40-44 years old  |   4.976156   .2035847    24.44   0.000     4.577137    5.375174
                                            45-49 years old  |   5.086969   .2029659    25.06   0.000     4.689163    5.484774
                                            50-54 years old  |   4.821479   .2027201    23.78   0.000     4.424155    5.218803
                                            55-59 years old  |   4.646858   .2161296    21.50   0.000     4.223251    5.070464
                                            60-64 years old  |   3.821465   .2433556    15.70   0.000     3.344497    4.298433
                                          65 years or older  |   1.444498   .3181577     4.54   0.000     .8209206    2.068076
                                                             |
                                                      sector |
                          managerial & technical occupation  |  -.3820282   .2324561    -1.64   0.100    -.8376337    .0735774
                                         skilled non-manual  |   -2.93446   .2312363   -12.69   0.000    -3.387675   -2.481245
                                             skilled manual  |  -6.914072   .2401358   -28.79   0.000     -7.38473   -6.443415
                                  partly skilled occupation  |  -4.267661     .23468   -18.19   0.000    -4.727626   -3.807697
                                       unskilled occupation  |  -4.637669   .2569436   -18.05   0.000     -5.14127   -4.134069
                                                             |
                                                       _cons |   13.46299   .3379914    39.83   0.000     12.80054    14.12544
                          -----------------------------------+----------------------------------------------------------------
                                                     sigma_u |  6.4843857
                                                     sigma_e |  5.1619774
                                                         rho |  .61210157   (fraction of variance due to u_i)
                          ----------------------------------------------------------------------------------------------------
                          
                          . xtoverid
                          1b:  operator invalid
                          r(198);

                          Comment


                          • #14
                            Guest:
                            my bad indeed. In my previous post I forgot to mention that, being glorious but a bit old-fashioned, the community-contributed module -xtoverid- does not support -fvvarlist- notation.
                            The usual fix is to prefix your code with -xi:-:
                            Code:
                             xi: xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector, re vce(cluster id)
                            Last edited by sladmin; 25 Apr 2022, 07:30. Reason: anonymize original poster
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Thank you for your help Carlo Lazzaro. However I am encountering another type of error - why could that be the case?

                              Code:
                              xi: xtreg wages i.high_qual training_hrs i.illness_disability i.sex i.children i.general_health i.region i.age i.sector, re vce(cluster id)
                              i.high_qual       _Ihigh_qual_1-9     (naturally coded; _Ihigh_qual_1 omitted)
                              i.illness_dis~y   _Iillness_d_1-2     (naturally coded; _Iillness_d_1 omitted)
                              i.sex             _Isex_1-2           (naturally coded; _Isex_1 omitted)
                              i.children        _Ichildren_0-9      (naturally coded; _Ichildren_0 omitted)
                              i.general_hea~h   _Igeneral_h_1-5     (naturally coded; _Igeneral_h_1 omitted)
                              i.region          _Iregion_1-12       (naturally coded; _Iregion_1 omitted)
                              i.age             _Iage_1-13          (naturally coded; _Iage_1 omitted)
                              i.sector          _Isector_1-6        (naturally coded; _Isector_1 omitted)
                              note: _Ichildren_7 omitted because of collinearity.
                              note: _Ichildren_8 omitted because of collinearity.
                              note: _Ichildren_9 omitted because of collinearity.
                              note: _Iage_13 omitted because of collinearity.
                              
                              Random-effects GLS regression                   Number of obs     =     81,014
                              Group variable: id                              Number of groups  =     45,174
                              
                              R-squared:                                      Obs per group:
                                   Within  = 0.0093                                         min =          1
                                   Between = 0.2259                                         avg =        1.8
                                   Overall = 0.2153                                         max =          4
                              
                                                                              Wald chi2(43)     =   11825.03
                              corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
                              
                                                               (Std. err. adjusted for 45,174 clusters in id)
                              -------------------------------------------------------------------------------
                                            |               Robust
                                      wages | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
                              --------------+----------------------------------------------------------------
                              _Ihigh_qual_2 |  -2.226562   .1291234   -17.24   0.000    -2.479639   -1.973484
                              _Ihigh_qual_3 |  -2.750473   .1155294   -23.81   0.000    -2.976906   -2.524039
                              _Ihigh_qual_4 |  -3.690913   .1140873   -32.35   0.000     -3.91452   -3.467306
                              _Ihigh_qual_5 |  -4.429453   .1463206   -30.27   0.000    -4.716236    -4.14267
                              _Ihigh_qual_9 |  -5.281472   .1727665   -30.57   0.000    -5.620089   -4.942856
                               training_hrs |   .0006149   .0002984     2.06   0.039       .00003    .0011998
                              _Iillness_d_2 |   .1494179   .0708485     2.11   0.035     .0105575    .2882783
                                    _Isex_2 |  -1.712939   .0851025   -20.13   0.000    -1.879737   -1.546141
                               _Ichildren_1 |  -.3398704    .097535    -3.48   0.000    -.5310355   -.1487054
                               _Ichildren_2 |  -.2720838   .1301761    -2.09   0.037    -.5272243   -.0169434
                               _Ichildren_3 |  -1.174362   .1976833    -5.94   0.000    -1.561814   -.7869101
                               _Ichildren_4 |  -1.975734   .3193612    -6.19   0.000    -2.601671   -1.349797
                               _Ichildren_5 |  -2.071639   .7868031    -2.63   0.008    -3.613745   -.5295336
                               _Ichildren_6 |  -4.674262   1.116908    -4.19   0.000    -6.863361   -2.485162
                               _Ichildren_7 |          0  (omitted)
                               _Ichildren_8 |          0  (omitted)
                               _Ichildren_9 |          0  (omitted)
                              _Igeneral_h_2 |   -.378106   .0746783    -5.06   0.000    -.5244728   -.2317392
                              _Igeneral_h_5 |  -.9154749   .1839044    -4.98   0.000    -1.275921   -.5550288
                                 _Iregion_2 |   .2585602    .177916     1.45   0.146    -.0901486    .6072691
                                 _Iregion_3 |  -.2284908   .1794094    -1.27   0.203    -.5801268    .1231452
                                 _Iregion_4 |   .0518488    .189648     0.27   0.785    -.3198545    .4235521
                                 _Iregion_5 |   .5359982   .1955516     2.74   0.006     .1527241    .9192723
                                 _Iregion_6 |   .9415514   .1921035     4.90   0.000     .5650355    1.318067
                                 _Iregion_7 |   1.394893   .1875851     7.44   0.000     1.027233    1.762553
                                 _Iregion_8 |   1.466192   .1884479     7.78   0.000     1.096841    1.835543
                                 _Iregion_9 |  -.0282937   .1922539    -0.15   0.883    -.4051044     .348517
                                _Iregion_10 |  -.2318236   .1853624    -1.25   0.211    -.5951273      .13148
                                _Iregion_11 |   .5588212   .1774352     3.15   0.002     .2110545    .9065879
                                _Iregion_12 |  -.1259098   .1794076    -0.70   0.483    -.4775421    .2257226
                                    _Iage_2 |  -1.444498   .3181577    -4.54   0.000    -2.068076   -.8209206
                                    _Iage_3 |  -1.083344   .2938119    -3.69   0.000    -1.659204   -.5074829
                                    _Iage_4 |  -.4572263   .2795858    -1.64   0.102    -1.005204    .0907518
                                    _Iage_5 |   .7066099   .2763311     2.56   0.011     .1650109    1.248209
                                    _Iage_6 |   2.172958   .2788041     7.79   0.000     1.626512    2.719404
                                    _Iage_7 |   3.112897   .2813211    11.07   0.000     2.561518    3.664277
                                    _Iage_8 |   3.531657   .2780079    12.70   0.000     2.986772    4.076543
                                    _Iage_9 |    3.64247   .2767357    13.16   0.000     3.100078    4.184862
                                   _Iage_10 |   3.376981   .2751978    12.27   0.000     2.837603    3.916359
                                   _Iage_11 |    3.20236   .2804129    11.42   0.000     2.652761    3.751959
                                   _Iage_12 |   2.376967   .2801664     8.48   0.000     1.827851    2.926083
                                   _Iage_13 |          0  (omitted)
                                 _Isector_2 |  -.3820282   .2324561    -1.64   0.100    -.8376337    .0735774
                                 _Isector_3 |   -2.93446   .2312363   -12.69   0.000    -3.387675   -2.481245
                                 _Isector_4 |  -6.914072   .2401358   -28.79   0.000     -7.38473   -6.443415
                                 _Isector_5 |  -4.267661     .23468   -18.19   0.000    -4.727626   -3.807697
                                 _Isector_6 |  -4.637669   .2569436   -18.05   0.000     -5.14127   -4.134069
                                      _cons |   14.90749     .39036    38.19   0.000     14.14239    15.67258
                              --------------+----------------------------------------------------------------
                                    sigma_u |  6.4843857
                                    sigma_e |  5.1619774
                                        rho |  .61210157   (fraction of variance due to u_i)
                              -------------------------------------------------------------------------------
                              
                              . xtoverid
                              o. operator not allowed
                              r(101);
                              
                              .

                              Comment

                              Working...
                              X