Announcement

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

  • xttest0 test and hausman test

    Hi guys! I tested the presence of fixed invariant effect in my model with the hausman and I obtained a small p-value 0.0143 so I reject the null and consider the fixed effect model. Then I tested the ols against re with the xttest0 and I obtained a pvalue=1.000, so I need to reject the random effect model again. I need to prefer the fixed or the ols? thank you!!

    Code:
    xtreg price age nbh cbd intst rooms area land baths dist,fe
    est store fe
    xtreg price age nbh cbd intst rooms area land baths dist,re
    est store re
    hausman fe re
    Code:
        Test:  Ho:  difference in coefficients not systematic
    
                      chi2(7) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                              =       17.62
                    Prob>chi2 =      0.0138
    Code:
    xtreg price age nbh cbd intst rooms area land baths dist,re vce (cluster id)
    xttest0
    Code:
    price[id,t] = Xb + u[id] + e[id,t]
    
            Estimated results:
                             |       Var     sd = sqrt(Var)
                    ---------+-----------------------------
                       price |   2.05e+09       45318.08
                           e |   1.15e+09       33875.28
                           u |          0              0
    
            Test:   Var(u) = 0
                                 chibar2(01) =     0.00
                              Prob > chibar2 =   1.0000

  • #2
    Enza:
    you're reporting results of different models:
    -those compared via -hausman- have defaulst standard errors;
    -the last one has clustered standard errors.

    That said, sticking with the first comparison, if the F.test at the foot of -xtreg, fe- outcome table does not reach satistical significance, pooled OLS outperforms -xtreg, fe-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I tested the Hausman without robust standard error since the test does not allow to do it. About the second point you are right, I tested the model with clustered standard errors but I also did it without cluster option and the results are the same (maybe it does not affect the result of the test, I'm just mking an hypotesis). So, also if I detected the presence of fixed effect you think that considering the results of the BP test I need to perform an OLS model?

      Comment


      • #4
        Enza:
        not quite.
        My previous suggestion was to look at the F-test at the foot of -xtreg, fe- outcome table does not reach satistical significance, pooled OLS outperforms -xtreg, fe-.
        Put differently, if the null of -re- specification has been rejected by -hausman-, testing BP on -re- seems pointless.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          The results after xtreg fe is the following
          Code:
           
          xtreg price age nbh cbd intst rooms area land baths dist,fe vce (cluster id)
          
          Fixed-effects (within) regression               Number of obs      =       284
          Group variable: id                              Number of groups   =       142
          
          R-sq:  within  = 0.6167                         Obs per group: min =         2
                 between = 0.1052                                        avg =       2.0
                 overall = 0.3563                                        max =         2
          
                                                          F(9,141)           =     30.21
          corr(u_i, Xb)  = -0.4356                        Prob > F           =    0.0000
          
                                             (Std. Err. adjusted for 142 clusters in id)
          ------------------------------------------------------------------------------
                       |               Robust
                 price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
          -------------+----------------------------------------------------------------
                   age |  -344.8193   147.4296    -2.34   0.021    -636.2774   -53.36113
                   nbh |    10712.8    3672.44     2.92   0.004     3452.637    17972.96
                   cbd |   .7035692   3.136893     0.22   0.823    -5.497854    6.904992
                 intst |  -2.795218   2.238024    -1.25   0.214    -7.219638    1.629202
                 rooms |  -6389.045   3925.237    -1.63   0.106    -14148.97    1370.879
                  area |   36.75132   6.139734     5.99   0.000     24.61349    48.88915
                  land |    .130162   .1170249     1.11   0.268    -.1011881    .3615122
                 baths |   19080.05   6318.069     3.02   0.003      6589.66    31570.44
                  dist |   1.726177   1.383375     1.25   0.214    -1.008661    4.461014
                 _cons |  -1464.453   24218.54    -0.06   0.952    -49342.84    46413.93
          -------------+----------------------------------------------------------------
               sigma_u |  31135.824
               sigma_e |   33875.28
                   rho |  .45793642   (fraction of variance due to u_i)
          ------------------------------------------------------------------------------
          Here the F test i significant.

          I tested the with Hausman in order to detect the presence of FE and I rejected the null so I excluded RE. Then i tested with BP ols against RE just because the professor told me to do it but maybe it does not make sense.

          Comment


          • #6
            Enza:
            I referred to the other F-test, that appears at the foot of -xtreg, fe- outcome (which is not calculated if the standrd errors are not in default mode).
            Hence, you have to use your first two codes (I mean -fe- vs -re-).
            See also on this topic any decent panel data econometrics textbook or, just to start off, -xtreg- entry in Stata .pdf manual.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Ok, sorry for not understand but I'm a beginner. I didn't use the default standard, just robust error. If I consider default standard errors I obtain the following
              Code:
              . xtreg price age nbh cbd intst rooms area land baths dist,fe 
              
              Fixed-effects (within) regression               Number of obs      =       284
              Group variable: id                              Number of groups   =       142
              
              R-sq:  within  = 0.6167                         Obs per group: min =         2
                     between = 0.1052                                        avg =       2.0
                     overall = 0.3563                                        max =         2
              
                                                              F(9,133)           =     23.77
              corr(u_i, Xb)  = -0.4356                        Prob > F           =    0.0000
              
              ------------------------------------------------------------------------------
                     price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       age |  -344.8193   105.3651    -3.27   0.001    -553.2273   -136.4112
                       nbh |    10712.8   4897.249     2.19   0.030      1026.23    20399.37
                       cbd |   .7035692   4.421159     0.16   0.874    -8.041313    9.448451
                     intst |  -2.795218   3.110046    -0.90   0.370    -8.946769    3.356332
                     rooms |  -6389.045   4520.193    -1.41   0.160    -15329.81    2551.721
                      area |   36.75132   6.473148     5.68   0.000     23.94768    49.55496
                      land |    .130162   .0872943     1.49   0.138    -.0425028    .3028269
                     baths |   19080.05   6314.962     3.02   0.003       6589.3     31570.8
                      dist |   1.726177   1.824837     0.95   0.346     -1.88328    5.335633
                     _cons |  -1464.453   25664.27    -0.06   0.955    -52227.38    49298.47
              -------------+----------------------------------------------------------------
                   sigma_u |  31135.824
                   sigma_e |   33875.28
                       rho |  .45793642   (fraction of variance due to u_i)
              ------------------------------------------------------------------------------
              F test that all u_i=0:     F(141, 133) =     0.61            Prob > F = 0.9983
              In this case I fail to reject the null, so OLS outperforms fe? I can extend this result also at the case with robust standard errors?

              Comment


              • #8
                Carlo already point it out, in general terms in #2 and #4.

                Specifically related to your question, as rephrased above: yes and yes.
                Best regards,

                Marcos

                Comment


                • #9
                  Thank you Carlo and Marcos!!

                  Comment


                  • #10
                    Enza:
                    Nick Cox in one of his quite old post said something like: "...we are all beginners, some of us are only more experienced...".
                    Back to your query: if you impose cluster/robust standard errors you should compare -fe- and -re- via the user-written programme -xtoverid- (type -search xtoverid- from within Stata to install it).
                    As you did not include -fvvarlist- notation in your code, you will not face problems in running it.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Thanks Carlo!

                      Comment

                      Working...
                      X