I am performing a Hausman test on panel data to determine whether to choose Random Effects or Fixed Effects for my analysis. After performing the test I get this error:

chi2(2) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                          =    -8.32    chi2<0 ==> model fitted on these
                                        data fails to meet the asymptotic
                                        assumptions of the Hausman test;
                                        see suest for a generalized test

What does this mean? Is this result OK, and it simply means that I should use random effects or something is terribly wrong here? I cannot use suest as the software suggest, because that's not for panel data.

In addition, when I change the order of the analysis, i.e. I estimate re first, and then fe, and do: hausman random fixed, I get a "normal" result, like this:

chi2(17) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                          =      411.18
                Prob>chi2 =      0.0000

However, I read on Statalist that it is not as simple as changing the order, since you get a wrong statistic.

So, the question is, what to do in this case, can I change the order of the estimation? I am pretty sure that FE does not work well with my data, but I need a way to prove it.

Please consider I am not a statistician, so the simpler the answer, the better.

  • $\begingroup$ This can be helpful to choose between Random effect and fixed effect by testing hausman test panel data *Run Fixed effect xtlogit y x1 x2 ,fe estimates store fe *Run Random effect xtlogit y x1 x2,re estimates store re hausman fe re, equations(1:1) $\endgroup$
    – goodluck
    Apr 16, 2018 at 13:41
  • $\begingroup$ For future googlers, a comprehensive explanation of testing on model specification (FE or RE) using the above can be found here kb.iu.edu/d/bcmq $\endgroup$
    – John
    Aug 18, 2018 at 13:39

2 Answers 2


Your first test returns a negative test statistic (-8.32) which should not happen. Usually the reason for this is a too small sample or mis-specification of the model. As it stands the result of your first test cannot be used to infer much more. Certainly it is not advisable to reverse the order of the estimates in the test for the reasons highlighted in the Statalist post you linked.

You may want to try the command xtoverid which gives a positive test statistic and also works with panels (unlike suest). In Stata you can install it by typing
ssc install xtoverid
At the bottom of the help file you will also find an example of how to use the test for deciding between FE or RE models. Run the RE model and then use the xtoverid command after that. The interpretation is the same as with hausman, i.e. a significant test statistic rejects the null hypothesis that RE is consistent.

  • $\begingroup$ Hi @Andy, I have implemented your solution, and I have a couple of questions: 1) My model includes year effects (dummies). When I try to perform xtoverid with the dummies included I get an error: operator invalid. If I remove it, then it works. Is it OK that I test re against fe without including the dummy, which it is actually significant for the model? 2) Just to clarify, I am getting the following result (after removing the year effects): Sargan-Hansen statistic 24.916 Chi-sq(2) P-value = 0.0000 // Does this mean, use FE? Thanks. $\endgroup$ Jul 26, 2013 at 14:57
  • $\begingroup$ 1) The i. operator does not work with xtoverid. You can just generate the dummies by using "qui tab year, gen(dyear)" and include them directly in the model instead of using an operator. 2) Yes, because it implies that RE is not consistent in your case. But try again with the complete model including the dummies. $\endgroup$
    – Andy
    Jul 26, 2013 at 15:35
  • $\begingroup$ I get this error when I use dummies for years instead of year effects: Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS. What to do? $\endgroup$ Jul 26, 2013 at 15:56
  • $\begingroup$ Either you have a very small sample or you are having a collinearity problem in your model. In the first case you can use the small-sample variance estimator by Swamy and Aurora (in Stata: xtreg y x, re sa). In the second case you will have to omit highly collinear variables. Normally Stata should do this automatically in the regression command though. $\endgroup$
    – Andy
    Jul 26, 2013 at 16:22
  • $\begingroup$ Thank you very much @Andy, I'm going through my data now and I have found some mistakes in the raw data. I am going to follow your advise and see if I can solve my problem. $\endgroup$ Jul 26, 2013 at 19:04

The negative sign can arise if different esti­mates of the error variance are used in forming variance of b and variance of B. In that case, you need to use the sigmamore option, which specifies that both covariance matri­ces are based on the (same) estimated disturbance variance from the efficient estimator.

hausman  FE RE , sigmamore

Note: FE and RE are estimates stored from fixed effect and random effect model. The answer is based on Microeconometrics using Stata by Cameron and Trivedi p. 261.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.