- Introduced by
- Bayesian reformulation of Hausman (1978); developed across Bayesian econometrics literature
- Year
- 1978 (classical); Bayesian adaptations 1990s–2000s
- Type
- Specification test / model comparison
- Family
- Econometrics / time series
What does it do?
The Bayesian Hausman test, as described here, is a Bayesian model-comparison approach to the fixed effects (FE) versus random effects (RE) choice in panel data, the question that Hausman's (1978) classical specification test is commonly used to address.
Rather than returning a reject or fail-to-reject decision, it compares the two specifications through marginal likelihoods, producing Bayes factors or posterior model probabilities that depend on the priors placed on each model.
The intuition behind the method
The classical Hausman test contrasts two estimators: one that is consistent under both hypotheses and one that is efficient only under the null. It asks whether their difference is larger than sampling variation would allow. The Bayesian version described on this page does not reproduce that estimator contrast. It treats FE and RE as two competing models, computes how well each explains the observed data after averaging over its parameters, and reports the ratio as a measure of relative support. The output is therefore a degree of evidence for one specification over the other, not a p-value.
History
Jerry A. Hausman introduced the classical specification test in a 1978 paper in Econometrica, which devised tests for several model specifications, including instrumental variable, time series cross section and simultaneous equation settings. The Bayesian version described on this page is a model comparison based on Bayes factors and posterior model probabilities. Bayesian approaches to specification testing more generally appear in the econometrics literature (for example Florens and Mouchart, 1989, a related but distinct treatment). The originator and date of the specific Bayesian FE versus RE comparison are not documented here.
When to use it
Use this approach when the question is whether fixed or random effects better describe a panel dataset, and you want a probability-scaled measure of support for each specification or an explicit role for prior information. Small samples are a practical reason to consider it, because the classical Hausman statistic relies on an asymptotic chi-squared approximation. However, Bayes factors can be strongly prior-dependent in small samples, so a prior sensitivity analysis is required. Do not use it as a drop-in replacement for the classical test without checking how the Bayes factor responds to the chosen priors. Do not apply the FE versus RE comparison to cross-sectional data without unit-level structure, since the two specifications then have no clear meaning; for a general endogeneity question in cross-sectional data, a standard endogeneity test is usually the more direct choice.
Limitations and considerations
- Bayes factors are sensitive to the prior, especially diffuse or improper priors on parameters that appear in only one of the models, so the comparison can be driven by the prior rather than by the data.
- Marginal likelihoods generally require numerical computation, and some commonly used estimators of them are unreliable, so the computational step needs to be checked.
- The model-comparison construction does not carry over the classical test's interpretation as a contrast of two estimators, so Bayes factors are not directly comparable with classical Hausman p-values.
- Results are less familiar to audiences trained in classical econometrics, and reporting them requires explaining the priors and the scale used to interpret the Bayes factor.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Reports a graded measure of evidence, the Bayes factor or posterior odds, rather than a binary decision at a fixed significance level.
- Makes prior beliefs about each specification explicit, so domain knowledge can enter the comparison and be varied in a sensitivity analysis.
- Does not depend on the asymptotic chi-squared distribution of the classical Hausman statistic, so its results are not tied to that approximation.
- Produces posterior model probabilities that can be compared across more than two specifications, not only the FE and RE pair.
Applications
- Choosing between fixed effects and random effects specifications in panel data studies, such as firm-level or labour panels.
- Reporting the FE versus RE comparison within a full Bayesian analysis that uses the same priors throughout.
- Comparing several panel specifications at once using posterior model probabilities.
- Checking how the evidence for FE versus RE changes under alternative priors when the classical Hausman test gives a borderline result.
How it works
How it works
Two competing models are written down for the same panel data. In the fixed effects specification, the unit-specific effects are free parameters that may be correlated with the regressors. In the random effects specification, the unit effects are treated as draws from a common distribution, typically normal with a variance to be estimated, and are assumed uncorrelated with the regressors. Each model has its own likelihood and parameter space, so the comparison is meaningful only when both are defined for the same data.
Priors are placed on the parameters within each model (coefficients, error variances and, for RE, the variance of the unit effects) and on the models themselves (prior model probabilities). Use proper priors, because improper priors leave the marginal likelihood undefined up to an arbitrary constant. These priors express beliefs about each specification before the data are observed, and the results depend on them.
Bayes' theorem combines each model's prior with its likelihood to form posterior distributions. For model comparison, the relevant quantity is the marginal likelihood, p(y | M) = ∫ p(y | θ, M) p(θ | M) dθ: the probability of the observed data averaged over that model's parameters under its prior. Marginal likelihoods are usually not available in closed form outside simple conjugate settings and generally require numerical methods.
Formula
p(y \mid M) = \int p(y \mid \theta, M)\, p(\theta \mid M)\, d\theta
The Bayes factor is the ratio of the two marginal likelihoods, as given in the formula. A value above 1 favours the fixed effects model and a value below 1 favours the random effects model. Multiplied by the prior odds, it gives the posterior odds.
Formula
BF_{FE,RE} = \frac{p(y \mid M_{FE})}{p(y \mid M_{RE})}The researcher either adopts the model with the higher posterior probability or reports the posterior odds as a graded measure of evidence. There is no universal cut-off for the Bayes factor. Before acting on a result, report the Bayes factor together with the prior model odds and the range of values obtained under alternative reasonable priors, and state explicitly the level of evidence you require.
Common pitfalls
- Treating flat priors as uninformative and the resulting Bayes factor as objective. Flat priors on nuisance parameters can distort marginal likelihoods, so the comparison may not reflect the data.
- Reading a Bayes factor as a p-value. The two answer different questions, and a Bayes factor of a given size does not map onto a p-value threshold.
- Omitting sensitivity analysis. Vary the prior hyperparameters across reasonable choices and report how the Bayes factor changes before drawing conclusions.
- Applying the FE versus RE comparison to cross-sectional data that has no unit-level structure, where the two specifications do not correspond to the same question.
Frequently asked questions
How does the Bayesian Hausman test differ from the classical Hausman test?
The classical test computes a chi-squared statistic from the difference between two estimators and returns a p-value. The Bayesian version computes marginal likelihoods for two models and reports a Bayes factor or posterior model probabilities. The two answer different questions in different ways, so their outputs are not directly interchangeable.
What is a Bayes factor and how do I interpret it?
The Bayes factor is the ratio of the marginal likelihoods of two models, BF = p(y|M1) / p(y|M2). Values above 1 favour M1 and values below 1 favour M2. It converts prior odds into posterior odds. Verbal scales for the size of the evidence exist, but the sources for this entry do not establish one, so the strength of evidence should be judged in context and reported together with the priors.
Do I need MCMC to run the Bayesian Hausman test?
Often, yes. Marginal likelihoods integrate over the parameter space, which is rarely tractable in closed form outside simple conjugate models. Numerical methods are needed, and the choice of estimator for the marginal likelihood should be justified, since some simple estimators are known to be unreliable.
Can I use this test to detect endogeneity more broadly, not just for FE vs RE?
Hausman's 1978 paper devised classical tests for settings including instrumental variables and simultaneous equations. Whether Bayesian counterparts exist for those settings is not documented in this entry's sources, so this page treats the Bayesian test only as a comparison of FE and RE models.
How sensitive are the results to my prior choices?
Bayes factors can be sensitive to priors, particularly in small samples. Vary the prior hyperparameters across reasonable choices, report how the Bayes factor changes, and state which conclusions hold across the range considered.
Related methods
Sources
Hausman, J. A. (1978). Specification tests in econometrics. Econometrica, 46(6), 1251–1271.
Open DOI referenceLancaster, T. (2004). An Introduction to Modern Bayesian Econometrics. Blackwell Publishing.
ISBN: 978-1405117203