Hausman Test Calculator
Inputs
- Inputs: efficient-estimator coefficient 0.42 (variance 0.0040), consistent-estimator coefficient 0.55 (variance 0.0110).
- The coefficient gap is 0.55 - 0.42 = 0.13, and under the null the variance of that gap is 0.0110 - 0.0040 = 0.0070.
- Hausman H = 0.13^2 / 0.0070 = 2.41 on 1 degree of freedom.
- The p-value is 0.1202: a small value says the two estimators disagree by more than sampling noise, so the efficient estimator's extra assumption is rejected.
Jerry Hausman's 1978 specification test answers a question that runs through all of applied econometrics: you have two estimators of the same quantity, one efficient but fragile and one robust but imprecise - do they actually disagree? Enter the coefficient and variance from each estimator and the calculator returns the Hausman H statistic, the coefficient difference and its standard error, and the p-value.
The classic pairings are fixed effects (efficient if individual effects are uncorrelated with the regressors) against random effects (consistent regardless), and instrumental variables against ordinary least squares. The logic is identical in every pairing, and for a single coefficient it reduces to one squared standardised difference.
Worked examples
Estimators agree
(0.42 · 0.55 · 0.004 · 0.011)
| Hausman H statistic | 2.41 |
| P-value | 0.1202 |
| Coefficient difference | 0.13 |
| Standard error of the difference | 0.0837 |
Efficient estimator rejected
(1.2 · 1.85 · 0.02 · 0.055)
| Hausman H statistic | 12.07 |
| P-value | 0.0005 |
| Coefficient difference | 0.65 |
| Standard error of the difference | 0.1871 |
Near-identical estimates
(-0.3 · -0.34 · 0.0025 · 0.006)
| Hausman H statistic | 0.46 |
| P-value | 0.4990 |
| Coefficient difference | -0.04 |
| Standard error of the difference | 0.0592 |
The logic of the comparison
Under the null hypothesis, the extra assumption that makes the efficient estimator efficient is true. Both estimators are then consistent, so they estimate the same quantity and their difference is pure sampling noise, centred on zero. The efficient estimator is also the more precise of the two, which pins down the variance of the difference.
Under the alternative, the assumption fails: the efficient estimator becomes inconsistent and drifts to a different value, while the consistent estimator stays on target. The difference between them then grows beyond what sampling noise can explain, and the test rejects. A rejection is therefore an indictment of the assumption, not of either estimator's arithmetic.
- Efficient estimator: smaller variance, consistent only under the null (random effects, OLS).
- Consistent estimator: larger variance, consistent under both hypotheses (fixed effects, IV).
- Under the null, the variance of the difference is the difference of the variances.
Why the variances subtract
The step that surprises newcomers is the denominator: the variance of the difference is the consistent estimator's variance minus the efficient estimator's variance, not the sum. Under the null the two estimates are correlated - the efficient estimator is, loosely, contained in the consistent one - and Hausman's result is that the covariance between them equals the efficient estimator's variance, which turns the sum into a subtraction.
In the first worked example the efficient coefficient is 0.42 with variance 0.004 and the consistent coefficient is 0.55 with variance 0.011. The difference is 0.13, the variance of the difference is 0.011 - 0.004 = 0.007, its standard error is 0.0837, and H = 2.41 on 1 degree of freedom, giving a p-value of 0.1202.
| Example | Difference | SE of difference | H | P-value |
|---|---|---|---|---|
| First | 0.13 | 0.0837 | 2.41 | 0.1202 |
| Second | 0.65 | 0.1871 | 12.07 | 0.0005 |
| Third | -0.04 | 0.0592 | 0.46 | 0.4990 |
Worked examples
Example 1: Coefficient - efficient estimator 0.42; Coefficient - consistent estimator 0.55; Variance - efficient estimator 0.004; Variance - consistent estimator 0.011. Hausman H statistic = 2.41. Supporting values: P-value 0.1202; Coefficient difference 0.13; Standard error of the difference 0.0837. Inputs: efficient-estimator coefficient 0.42 (variance 0.0040), consistent-estimator coefficient 0.55 (variance 0.0110). The coefficient gap is 0.55 - 0.42 = 0.13, and under the null the variance of that gap is 0.0110 - 0.0040 = 0.0070. Hausman H = 0.13^2 / 0.0070 = 2.41 on 1 degree of freedom. The p-value is 0.1202: a small value says the two estimators disagree by more than sampling noise, so the efficient estimator's extra assumption is rejected.
Example 2: Coefficient - efficient estimator 1.2; Coefficient - consistent estimator 1.85; Variance - efficient estimator 0.02; Variance - consistent estimator 0.055. Hausman H statistic = 12.07. Supporting values: P-value 0.0005; Coefficient difference 0.65; Standard error of the difference 0.1871. Inputs: efficient-estimator coefficient 1.20 (variance 0.0200), consistent-estimator coefficient 1.85 (variance 0.0550). The coefficient gap is 1.85 - 1.20 = 0.65, and under the null the variance of that gap is 0.0550 - 0.0200 = 0.0350. Hausman H = 0.65^2 / 0.0350 = 12.07 on 1 degree of freedom. The p-value is 0.0005: a small value says the two estimators disagree by more than sampling noise, so the efficient estimator's extra assumption is rejected.
Example 3: Coefficient - efficient estimator -0.3; Coefficient - consistent estimator -0.34; Variance - efficient estimator 0.0025; Variance - consistent estimator 0.006. Hausman H statistic = 0.46. Supporting values: P-value 0.4990; Coefficient difference -0.04; Standard error of the difference 0.0592. Inputs: efficient-estimator coefficient -0.30 (variance 0.0025), consistent-estimator coefficient -0.34 (variance 0.0060). The coefficient gap is -0.34 - -0.30 = -0.04, and under the null the variance of that gap is 0.0060 - 0.0025 = 0.0035. Hausman H = -0.04^2 / 0.0035 = 0.46 on 1 degree of freedom. The p-value is 0.4990: a small value says the two estimators disagree by more than sampling noise, so the efficient estimator's extra assumption is rejected.
Reading the three regimes
The second worked example is a clear rejection: coefficients of 1.2 and 1.85 differ by 0.65 against a standard error of 0.1871, so H = 12.07 and the p-value is 0.0005. The efficient estimator's assumption is not tenable, and the analysis should proceed with the consistent estimator despite its wider confidence intervals.
The third example is the comfortable null case: coefficients of -0.3 and -0.34 differ by -0.04 with a standard error of 0.0592, giving H = 0.46 and a p-value of 0.4990. The estimators agree as closely as sampling noise predicts, and the efficient estimator's precision can be used with a clear conscience.
The fixed-versus-random effects pairing
The test's most common habitat is panel data. Random effects estimation assumes the unobserved individual effects are uncorrelated with the regressors; if that holds it is efficient, using both within- and between-unit variation. Fixed effects estimation makes no such assumption and stays consistent either way, at the cost of discarding the between variation.
Applied coefficient by coefficient, as this calculator does, the test shows which regressors drive any disagreement - often more useful than the single joint verdict, because a specification can fail for one variable and hold for the rest. The joint, multi-coefficient version uses the full covariance matrices and follows the same principle.
Practical pitfalls
The variance subtraction can go wrong in finite samples: if the estimated variance of the consistent estimator comes out smaller than the efficient one's, the difference of variances is negative and the statistic is undefined. Software handles this with generalised inverses or by falling back on a regression-based version of the test, and a negative variance difference is itself a signal that the two estimates are too close to distinguish.
Robust and clustered standard errors also disturb the classical construction, because with them the efficient estimator is no longer efficient in the required sense. In that setting the regression-based (Wooldridge) form of the test is the standard substitute, and it answers the same question.
The single-coefficient form computed here is the building block of the joint test, and it has a diagnostic virtue the joint version lacks: it localises disagreement. A panel specification can pass for most coefficients and fail for one - often the variable whose correlation with the individual effects is the whole economic question, such as a policy variable assigned non-randomly across units. Running the comparison coefficient by coefficient, as the three examples do for a generic coefficient, turns a global verdict into a map of where the assumption breaks.
Power deserves the last word. The test can only detect disagreement as large as the consistent estimator's precision allows it to see, and when that estimator is imprecise - instrumental variables with weak instruments are the classic case - the standard error of the difference balloons and almost nothing rejects. The third example's comfortable 0.4990 and a hypothetical failure to reject with a standard error three times the difference are different epistemic situations wearing the same p-value costume; the reported standard error, 0.0592 here, is what distinguishes them.
The test's inventor framed it as a general principle rather than a single formula, and the principle is worth stating once plainly: whenever an estimator gains efficiency from an assumption, comparing it against an estimator that does not need the assumption is a test of the assumption itself. That is why the same construction recurs across econometrics under different names, and why the arithmetic on this page - a squared difference over a difference of variances - is the template for all of them. Learn it here, on one coefficient, and the joint versions are bookkeeping.
FAQs
What Hausman statistic does the first example give?
The first example gives a Hausman statistic of 2.41: the squared coefficient difference of 0.13 divided by the variance difference of 0.007. On 1 degree of freedom the p-value is 0.1202, so the estimators do not significantly disagree.
What p-value does the first example give?
The first example gives a p-value of 0.1202. The gap between the efficient estimate of 0.42 and the consistent estimate of 0.55 is within what sampling noise predicts, so the efficient estimator's assumption survives.
What coefficient difference does the first example use?
The first example uses a coefficient difference of 0.13, from 0.55 minus 0.42. Measured against its standard error of 0.0837, that gap is about one and a half standard errors - noticeable, but not decisive.
What Hausman statistic does the second example give?
The second example gives a Hausman statistic of 12.07. A coefficient difference of 0.65 against a standard error of 0.1871 is far beyond sampling noise, and the efficient estimator's extra assumption is rejected.
What p-value does the second example give?
The second example gives a p-value of 0.0005. The two estimators disagree decisively, so the analysis should rely on the consistent estimator even though its variance of 0.055 is the larger of the two.
What Hausman statistic does the third example give?
The third example gives a Hausman statistic of 0.46, from a coefficient difference of -0.04 and a standard error of 0.0592. The p-value of 0.4990 reflects two estimators in close agreement.