Friday, July 29, 2011

Hausman Test on Stata for RE vs. FE

To test whether the fixed effects (FE) or random effects (RE) model is more appropriate for a panel data regression (using xtreg here), do the following:

xtreg y x1 x2 x3, fe
estimates store FE
xtreg y x1 x2 x3, re
estimates store RE
hausman FE RE

If p < 0.05, use the FE model.

This is taken from the discussion here. Note the discussion and the use of xtoverid in some situations.

Another test for FE vs RE using xtgls and lrtest is discussed here and described here.

Reference: Hausman test (fe vs. re), use robust SE or not? [Statalist], 
     Stata 12 help for hausman [Stata]


  1. Don't you use the FE model if your Hausman statistic is greater than .05?

    1. Coleman,

      I don't think so. But the internet does have a way of propagating mis-information; can you provide any justification on why you think it is the other way?

      My understanding is that - if you look at the second reference link in the post to Stata 12 help:

      "hausman name-consistent name-efficient [, options]"

      The RE model is the estimator that "is efficient (and consistent) under the null hypothesis that you are testing, but inconsistent otherwise."

      If you reject that null, then you should use FE.


      page 29: "If [Prob>chi2] is < 0.05 (i.e. significant) use fixed effects."

  2. I added more comments about this at