Why Compare Fixed Effects and Random Effects?
Panel data follow the same units across multiple time periods. A unit may have stable unobserved characteristics—such as a firm's management culture or a patient's underlying health—that affect the outcome. Fixed-effects (FE) estimation allows this unit effect to be related to the regressors. Random-effects (RE) estimation gains efficiency when the unit effect is unrelated to the regressors, but that additional assumption matters: if it fails, conventional RE slopes are generally inconsistent.
The Hausman test makes this difference operational. It compares the FE and RE estimates of the same slope parameters, taking account of the covariance of their difference. A large discrepancy relative to its estimated uncertainty is evidence against the RE orthogonality assumption, provided the other model assumptions used by the test are credible.
What the Hausman Test Tests
Let \(\hat{\beta}_{FE}\) and \(\hat{\beta}_{RE}\) denote the FE and RE estimates of the same \(q\) slope coefficients. The comparison excludes coefficients that are not estimated by both methods, such as time-invariant regressors absorbed by unit fixed effects. The null hypothesis is that the RE orthogonality condition holds, so both estimators are consistent and RE is efficient under the maintained model. The alternative is that this condition fails: under the standard assumptions, FE remains consistent while RE does not.
The test statistic is a quadratic form in the difference between the two estimates. Write \(\widehat{V}_{FE}\) and \(\widehat{V}_{RE}\) for their estimated covariance matrices, calculated for the same coefficient vector and data. Under the null, the conventional Hausman statistic is
If the null holds and the regularity conditions for the standard large-sample result are satisfied, \(H\) has an approximate chi-square distribution with \(q\) degrees of freedom. The degrees of freedom are the number of slope restrictions tested, not the number of units or periods in the panel. The p-value is the probability, under \(H_0\) and the reference distribution, of obtaining a statistic at least as large as the observed one.
Why the Covariance Difference Appears
The formula uses the covariance of the difference between estimators, not the sum of their variances. This distinction is important because FE and RE use the same data and their estimates are not independent. Under the null, RE is efficient among the consistent estimators considered, while FE is also consistent. In the standard Hausman setting, the covariance between the two estimators equals the covariance of the efficient RE estimator. This gives the covariance of their difference as follows.
Here the second equality uses the standard null covariance relationship; the covariance matrices are symmetric. Under \(H_0\), the difference is asymptotically centered at zero. Standardizing that difference by its covariance and taking its squared length produces the chi-square statistic. In an application, the population matrices are unknown, so their estimates are substituted. The usual calculation requires the estimated covariance difference to be invertible and to behave as a valid covariance matrix. The coefficient estimates and covariance matrices must refer to the same sample, the same specification, and the same coefficients.
Worked Hausman Calculations
Worked Example: One Slope Coefficient
Suppose a hypothetical balanced panel estimates the effect of training hours on monthly productivity, measured in output units per worker. The shared slope estimates are \(\hat{\beta}_{FE}=0.80\) and \(\hat{\beta}_{RE}=0.62\), in output units per additional training hour. Suppose their estimated variances are \(0.0400\) and \(0.0225\), respectively. Assume both estimates use the same observations and specification, and the standard Hausman assumptions are considered plausible.
There is one tested coefficient, so \(q=1\). The coefficient difference and its estimated variance are
For one coefficient, the quadratic form reduces to the squared difference divided by the variance difference:
The reference distribution is \(\chi^2_1\), giving a p-value of approximately \(0.174\). At a \(5\%\) significance level, this is not sufficient evidence to reject \(H_0\). The data do not show a statistically significant difference between these estimates by this test; that is not proof that the unit effect is uncorrelated with training hours.
Worked Example: Two Correlated Slope Differences
Consider a hypothetical panel study of monthly sales. The two shared regressors are advertising expenditure and price, with slopes measured in sales units per currency unit. Suppose
and the covariance estimates are
The estimated difference is \(d=(0.30,-0.20)'\). Subtracting the covariance matrices gives
Its determinant is \(0.04(0.03)-0.01^2=0.0011\), so it is invertible, with inverse
Now calculate the quadratic form:
There are two tested slopes, so compare this statistic with \(\chi^2_2\). The p-value is approximately \(0.0821\). At the \(5\%\) level, the test does not reject the joint null. The calculation accounts for the estimated covariance between the two slope differences; treating the slopes as separate independent comparisons would not reproduce this joint test.
Worked Example: Strong Evidence Against RE Orthogonality
Suppose a hypothetical panel of clinics compares FE and RE estimates of two shared slopes: the effect of staffing hours and the effect of supply expenditure on a monthly patient-service score. The coefficient differences are \((0.30,-0.15)'\), in score units per additional hour and score units per currency unit, respectively. Suppose the estimated covariance difference is diagonal:
Because the matrix is diagonal, each squared difference is divided by its corresponding variance difference:
With \(q=2\), the \(\chi^2_2\) upper-tail p-value is approximately \(0.00288\). This is strong evidence against the joint null at conventional significance levels. Under the maintained model assumptions, it points to a failure of the RE orthogonality condition, such as correlation between the clinic effect and one or more regressors. It does not identify which slope is responsible, nor does it establish that either estimator has a causal interpretation.
How to Report the Result
A clear report identifies the coefficient vector tested, the statistic, its degrees of freedom, the p-value, and the conclusion relative to a chosen significance level. For example: “The joint Hausman test for the advertising and price slopes gave \(H=5.000\) on 2 degrees of freedom (\(p=0.0821\)). At the \(5\%\) level, we do not reject the RE orthogonality null.” This wording reports the evidence without claiming that the null has been verified.
Rejection is evidence that the FE and RE estimates differ more than expected under the null covariance structure. In the standard setup, the natural interpretation is evidence against the RE assumption that the unit effect is uncorrelated with the regressors. The test does not by itself measure the size of that correlation, prove that FE is correctly specified, or establish a causal effect. Those conclusions also depend on the maintained assumptions, including the error exogeneity condition.
Common Mistakes and Checks
A frequent mistake is to compare the FE and RE coefficients by looking at their individual standard errors, or by running separate tests for each slope and treating the results as the Hausman test. The Hausman statistic is a joint quadratic form: it uses the difference in estimates and the covariance matrix of that difference. Off-diagonal entries can matter, as the two-slope calculation illustrates.
Before interpreting a calculation, check that both estimators use the same observations and estimate exactly the same slope vector. Confirm that the covariance matrices are on the same scale and that their difference is invertible and suitable for the quadratic form. The conventional chi-square reference distribution also relies on the maintained model and large-sample conditions; the numerical statistic alone does not guarantee those conditions.
Check Your Understanding
Work through these questions before moving on.
- In the standard panel model, what additional condition does conventional RE require about the relationship between the unit effect and the regressors?
- Two estimators share three slope coefficients. What degrees of freedom are used for the standard Hausman reference distribution, and why?
- Why does the Hausman statistic use \(\widehat{V}_{FE}-\widehat{V}_{RE}\) rather than simply adding the two covariance estimates?
- A test gives \(H=4.2\) on 2 degrees of freedom and \(p=0.122\). What is the correct conclusion at the \(5\%\) level, and what conclusion would be too strong?
- Why must the FE and RE estimates being compared use the same sample and the same coefficient vector?