- Introduced by
- Jerry A. Hausman
- Year
- 1978
- Type
- Specification test
- Family
- Econometrics / time series
What does it do?
The Hausman specification test for panel data checks whether individual-specific effects are correlated with the time-varying regressors, a correlation that would make the random effects estimator inconsistent.
The null hypothesis is that these effects are uncorrelated with the regressors. Under the null, both the fixed effects and random effects estimators are consistent and random effects is efficient; under the alternative, only fixed effects remains consistent. A statistically significant result favours the fixed effects model, while a non-significant result is consistent with the more efficient random effects model.
The intuition behind the method
Random effects estimation is more efficient than fixed effects because it uses variation both within and between individuals, but it is consistent only if the unobserved individual traits are uncorrelated with the regressors. Fixed effects estimation stays consistent under strict exogeneity conditional on the individual effects, even when those effects are correlated with the regressors, because it removes individual heterogeneity entirely. The Hausman test checks whether the two estimators give systematically different answers. If they do, the random effects estimates are likely contaminated by correlation between the effects and the regressors, and fixed effects is the safer choice. Both estimators require the time-varying regressors to be strictly exogenous conditional on the individual effects. The efficiency of random effects under the null, on which the test relies, also requires the idiosyncratic errors to be homoskedastic and serially uncorrelated. When these conditions fail, the classical covariance difference is unreliable, and a robust or Mundlak-type version of the test should be used.
History
Hausman (1978), in Econometrica, introduced the test as a general way to compare an estimator that is efficient under the null hypothesis with one that is consistent in all cases but less efficient. The same paper develops tests for a time series cross-section model and for the simultaneous equation model. The comparison of fixed and random effects in panel data is one of the standard applications of the test.
When to use it
Apply the Hausman test after estimating a panel model when you are uncertain whether to use fixed or random effects. It is appropriate when the panel contains enough within-unit variation to estimate fixed effects reliably and the number of time periods is not too small. Do not use it when all regressors are time-invariant (fixed effects cannot identify them) or when the panel is very short (T = 2 or 3). Use a heteroscedasticity- and cluster-robust variant, such as the Mundlak regression test, when errors are heteroscedastic or clustered. The study design can make random effects more or less plausible, but that judgement should be made alongside the test rather than replaced by it. When theoretical reasoning already strongly settles the specification, the test serves as a check rather than the deciding criterion.
Limitations and considerations
- The classical version of the test is invalid when errors are heteroscedastic or clustered; a robust Hausman test or a regression-based Mundlak test is required in those cases.
- The test has low power in short panels (small T) or when within-unit variation is limited, so it may fail to detect endogeneity that is present.
- A rejection does not identify which specific regressor is endogenous, so further investigation is needed.
- The test cannot be applied to time-invariant regressors, which drop out under fixed effects.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- It turns the choice between fixed and random effects into a test of one stated null hypothesis: that the individual effects are uncorrelated with the regressors. This orthogonality is the assumption on which the consistency of the random effects estimator depends.
- The test rests on the property that an estimator efficient under the null has zero asymptotic covariance with its difference from a consistent but less efficient estimator. This is what produces the statistic H and its chi-squared distribution with k degrees of freedom.
- Once both panel models are fitted, the statistic needs only the two coefficient vectors and their covariance matrices, so it adds little computational work.
- The asymptotic chi-squared null distribution allows a standard p-value to be reported and compared with a chosen significance level.
Applications
- Selecting between fixed effects and random effects in microeconometric panel studies of wages, health, or firm performance.
- Checking whether random effects estimates are consistent in growth panel regressions with country or industry effects.
- Validating the consistency of random effects estimators in finance panel datasets with firm-level data.
- Model specification checks in environmental economics panels linking pollution to income (EKC hypothesis).
- Assessing whether individual heterogeneity in education panels is correlated with schooling inputs.
How it works
How it works
Estimate the panel model twice: once with the fixed effects (within) estimator and once with the random effects (GLS) estimator. Both produce coefficient vectors for the time-varying regressors.
Form the vector of differences q-hat between the fixed effects and random effects coefficient estimates. Under the null hypothesis that the individual effects are uncorrelated with the regressors, both estimators are consistent and this difference should be close to zero.
Formula
\hat{q} = \hat{\beta}_{FE} - \hat{\beta}_{RE}Compute the Hausman chi-squared statistic H from the difference vector and the difference of the two covariance matrices. Under the null hypothesis H follows a chi-squared distribution with k degrees of freedom, where k is the number of time-varying regressors tested.
Formula
H = \hat{q}^{\top}\left[\mathrm{Var}(\hat{\beta}_{FE}) - \mathrm{Var}(\hat{\beta}_{RE})\right]^{-1}\hat{q} \sim \chi^2(k)Compare H with the chi-squared critical value at the chosen significance level. A p-value below the threshold (typically 0.05) rejects the null, implying that the individual effects are correlated with the regressors and fixed effects should be preferred. Failure to reject gives no evidence against the random effects specification, which is then usually retained for its efficiency.
Common pitfalls
- Running the classical (non-robust) Hausman test when panel-robust standard errors are needed. The difference of the covariance matrices may fail to be positive semi-definite, which can produce a negative test statistic; a Mundlak auxiliary regression or a bootstrap version is the usual alternative.
- Interpreting a failure to reject as confirmation that random effects is correct. It may simply reflect insufficient power in a short or narrow panel.
- Forgetting that the test applies only to time-varying regressors. Coefficients on time-invariant variables cannot be recovered under fixed effects and are excluded from the test.
- Treating the Hausman result as the sole criterion when subject-matter theory already settles which specification is appropriate.
- Confusing this test with the regression-based Hausman endogeneity test (also called the Wu-Hausman test). That procedure checks whether a specific regressor is correlated with the error in an instrumental-variables setting, as in the test of the endogeneity of schooling. It has a different null and is not the fixed-versus-random effects comparison described on this page.
Frequently asked questions
What does rejecting the Hausman test mean?
A rejection (small p-value) indicates that the fixed effects and random effects estimates differ systematically. This implies that the unobserved individual-specific effects are correlated with at least one regressor, making the random effects estimator inconsistent. You should use the fixed effects model.
What should I do if the Hausman test statistic is negative?
A negative test statistic signals that the estimated difference between the covariance matrices is not positive semi-definite. This can occur whenever the efficiency condition under the null fails, for example when errors are heteroscedastic. Use the robust regression-based version of the test (Mundlak approach) or a bootstrap Hausman test instead of the classical form.
Can I run the Hausman test if my panel has time-invariant variables?
Not directly, because fixed effects sweeps out time-invariant variables. The test can only be applied to the subset of time-varying regressors. For time-invariant variables consider the Hausman-Taylor estimator or a correlated random effects approach.
Is the Hausman test the only way to choose between FE and RE?
No. The Mundlak (1978) auxiliary regression test is a flexible alternative that is robust to heteroscedasticity. Correlated random effects models (Chamberlain 1982) also test the same hypothesis. Theoretical reasoning about whether individual effects are a random draw from a population or fixed parameters is equally important.
How many degrees of freedom does the Hausman statistic have?
The degrees of freedom equal the number of time-varying regressors included in the test — typically all regressors except the constant and time-invariant variables.
Related methods
Sources
Hausman, J. A. (1978). Specification tests in econometrics. Econometrica, 46(6), 1251–1271.
Open DOI referenceWooldridge, J. M. (2010). Econometric Analysis of Cross Section and Panel Data (2nd ed.). MIT Press.
ISBN: 978-0262232586Econometrics by Example, 2nd ed., Table 19.9 (Hausman test of endogeneity of schooling), p. 380