Solved – Hausman test after xtregar negative chi2

fixed-effects-modelhausmanpanel datarandom-effects-modelstata

I'm performing a Hausman test on panel data to determine whether to choose Random Effects or Fixed Effects for my analysis with AR(1). After performing the test I get a negative $\chi^2$ statistic such as:

hausman fixed random

Note: the rank of the differenced variance matrix (11) does not equal the number of coefficients being tested
(13); 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))
| fixed random Difference S.E.
-------------+----------------------------------------------------------------

....deleted
------------------------------------------------------------------------------
b = consistent under Ho and Ha; obtained from xtregar
B = inconsistent under Ha, efficient under Ho; obtained from xtregar

Test: Ho: difference in coefficients not systematic

chi2(11) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= -13.34 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 have tried to invert the order, but I guess that it is not make sense.

hausman random fixed 

Note: the rank of the differenced variance matrix (11) does not equal the number of coefficients being tested
(13); 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))
| random fixed Difference S.E.
-------------+----------------------------------------------------------------
...deleted
------------------------------------------------------------------------------
b = consistent under Ho and Ha; obtained from xtregar
B = inconsistent under Ha, efficient under Ho; obtained from xtregar

Test: Ho: difference in coefficients not systematic

chi2(11) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 13.34
Prob>chi2 = 0.2719
(V_b-V_B is not positive definite)

For the xtregar it is not possible to use sigmamore option or the xtoverid routine but they work only for the xtreg

Should I reject the null hypothesis and use the random effects estimator?

Best Answer

If you want to correct for serial correlation it is sufficient to use the cluster option in the fixed effects version of xtreg. This takes care of both serial correlation and heteroscedasticity without the need of specifying the lag order. Then the command xtoverid lets you compute a robust version of the Hausman test that can deal with the clustered errors.

You definitely cannot just swap the fixed and random effects models in your test because the idea behind the Hausman test is that you can rank the variances between the consistent and the efficient model and then look at their differences in the test statistic.

As an example on how to apply this:

// Use a toy data set
webuse nlswork

// set the panel variables
xtset idcode year

// run the fixed effects regression
xtreg ln_wage age, cluster(idcode)

// Hausman test using xtoverid
xtoverid

This is the safer approach given that your Hausman test for xtregar indicates that something is fundamentally wrong. The message model fitted on these data fails to meet the asymptotic assumptions of the Hausman test is something that I personally would not just ignore. Usually Stata produces error messages for good reasons and unless you are very confident with the method it is the safer choice to resort to something you can handle more easily.