Announcement

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

  • Time fixed effects in a Hausman test

    Hi! I have a question regarding the inclusion of time fixed effects when performing a Hausman test to check if the FE and RE estimates are different. The thing is when I include time fixed effects (this would be a different intercept depending on the year) in both regressions (FE and RE) and then perform a Hausman test, the results are different. With time effects, the test says that there is no systematic difference, and with no time effects, it says that there is. Does anyone know why this happens? Here are the results from both test, i have a Panel with few T ( 5 years) and large N.



    ---- Coefficients ----
    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | FE RE Difference Std. err.
    -------------+----------------------------------------------------------------
    year |
    82 | -.0000241 -.0001338 .0001097 .
    83 | -.0022864 -.0023981 .0001117 .
    84 | -.0043382 -.0045598 .0002216 .
    85 | -.0044366 -.0047974 .0003608 .0001238
    86 | -.0017159 -.0021748 .000459 .0002205
    87 | -.000194 -.0006824 .0004884 .0003118
    prbarr | -.0036857 -.0076683 .0039826 .0005447
    prbpris | .0015037 .0008469 .0006567 .
    avgsen | .0000501 7.93e-06 .0000422 3.77e-06
    polpc | 1.807551 1.793522 .0140289 .0367312
    density | .0019644 .0086072 -.0066429 .0046628
    taxpc | .0000601 .0000429 .0000172 .0000191
    ------------------------------------------------------------------------------
    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(12) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = 2.51
    Prob > chi2 = 0.9981
    (V_b-V_B is not positive definite)



    ---- Coefficients ----
    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | FE RE Difference Std. err.
    -------------+----------------------------------------------------------------
    prbarr | -.0043323 -.0084376 .0041053 .0005853
    prbpris | -.0008256 -.0012595 .0004338 .
    avgsen | .0002318 .0001913 .0000405 3.67e-06
    polpc | 1.719693 1.717041 .0026518 .0397228
    density | -.0001926 .0085742 -.0087667 .0046433
    taxpc | .0000463 7.29e-06 .000039 .0000221
    ------------------------------------------------------------------------------
    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(6) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = 13.27
    Prob > chi2 = 0.0389
    (V_b-V_B is not positive definite)

    Last edited by Nicolas Trujillo; 01 Nov 2023, 13:06.

  • #2
    The fixed effects model essentially controls for all of the cross-sectional time invariant variation. That is why time invariant variables are omitted from the model. The Hausman test is telling you that when you include your fixed effects variables, the RE model doesn't systematically diverge from the fixed effects model. That's a great property to have, because it suggests that while the FE model controls for the important fixed effects, your random effects model explains that variation by explicitly modeling it with the time-invariant variables. In this case, I would prefer the RE model over the FE model.

    Comment


    • #3
      Originally posted by Daniel Schaefer View Post
      The fixed effects model essentially controls for all of the cross-sectional time invariant variation. That is why time invariant variables are omitted from the model. The Hausman test is telling you that when you include your fixed effects variables, the RE model doesn't systematically diverge from the fixed effects model. That's a great property to have, because it suggests that while the FE model controls for the important fixed effects, your random effects model explains that variation by explicitly modeling it with the time-invariant variables. In this case, I would prefer the RE model over the FE model.
      Thanks for the clarification, Daniel! But my question was more oriented towards the inclusion of period-specific effects of a particular year, which do vary over time. I was wondering if these effects should be included when performing a Hausman test due to the different results.

      Comment


      • #4
        Nicolas: Do you have a balanced panel? The answer actually depends on the answer. Looks like 7 years of data, right?

        If it's a balanced panel, then the inclusion of the time dummies means that the degrees-of-freedom reported by Stata are wrong. You can only compare the coefficients on the variables that aren't time dummies. A second problem is that the test is not robust. And, given the degrees-of-freedom problem, I'd be uneasy about the value of the test statistic, too.

        You should show the original FE and RE output, too. But the first issue is about balanced or not.

        Comment


        • #5
          Ah, I see. So they vary across time, but not cross-sectionally? Maybe someone here will correct me, but I see no reason why you shouldn't include those variables in your model.

          As to why this might be happening: The simple answer is that the model is probably underspecified without those variables, so you are violating the assumptions of both the FE and RE models. It's not surprising that they will diverge under those conditions. I assume you have good theoretical and empirical reasons to include them, so you should probably include them.

          The complicated answer is that your fixed-effects model assumes the size of the effect of the time-invariant features of your subjects on your outcome are constant over time. But now, suppose there is actually some kind of nonlinearity, such that the size of the effect of the time-invariant cross-sectional features interacts with a time-dependent feature of your data. That might manifest as cross-sectional differences in the size of cycles over time, or in differences in the slope of a trend line across subjects in your outcome. In that case, the non-linearity could (and probably would) present as a violation of the IID assumption in the residuals of the RE model, which is exactly what the Hausman test would ideally detect. At worst, it might also constitute a violation of the assumptions of the FE model, meaning that the Hausman test might not be giving you meaningful results under those conditions. Remember, the Hausman test assumes the FE model will be consistent in order to test the (hopefully more efficient) RE model against it as a benchmark. If your violating the FE assumptions, the Hausman test is of limited value to you.

          Edit: crossed with #4, but you should listen to Jeff here. Jeff is an expert in this very topic, and if his advice or explanation differs from mine, you should take his advice.
          Last edited by Daniel Schaefer; 01 Nov 2023, 14:26.

          Comment


          • #6
            Oh, wait. I recognize this data set. It's crime4.dta that comes with my introductory econometrics text. Nicolas, is this a homework question?

            Comment


            • #7
              Originally posted by Jeff Wooldridge View Post
              Oh, wait. I recognize this data set. It's crime4.dta that comes with my introductory econometrics text. Nicolas, is this a homework question?

              Hello, Mr. Wooldridge. The dataset does come from "crime4.dta". Regarding the question, I don't believe it's a homework question. I was just asking due to the different results of the Hausman test, which are quite intriguing. The question was more oriented towards whether both tests could tell me something about the sources of heterogeneity depending on the specification of the model (time-specific effects or not) and why, when these time-specific effects are included, the test indicates that both estimators do not exhibit significant differences compared to when they are not included.

              Comment


              • #8
                So if I'm understanding correctly, including time dummies in both the fixed and random effects regressions would invalidate the canned Hausman test when using a balanced panel?
                Presumably, the Hasman test would also be invalid if including individual (i.e., firm) dummies in the random effects regression (for one thing, they'd drop out of the fixed effects regression)?

                Can either (time or individual dummies be justified)? Including them greatly improves R square in my analysis.
                For instance, if I run the analysis without any dummies, and the Hausman test indicates random effects, is it improper to include the individual dummies that would drop out in a fixed effects regression?

                I see xttest3 tests for heteroskedasticity following fixed effects, but am having difficulty finding an equivalent test following random effects.

                Comment


                • #9
                  It's not generally heteroskedasticity that's the issue. It's usually serial correlation, although both can be present. The point about the time effects is that you should include them in both FE and RE estimation. But you can't test their coefficients. You can only test on coefficients of variables that have some variation across i and t. I recommend the Mundlak regression. Others prefer xtoverid after xtreg, re vce(cluster id). If the degrees-of-freedom are properly computed, they should lead to similar answers.

                  Comment


                  • #10
                    Thanks for the response Dr. Wooldridge. I'm saddled with an older version of STATA not allowing the Mundlak regression, so I'll try xtoverid then. Thanks again.

                    Comment


                    • #11
                      Jason:
                      see https://blog.stata.com/2015/10/29/fi...dlak-approach/
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment


                      • #12
                        You can code Mundlak regression. It's not difficult.

                        Comment

                        Working...
                        X