PANEL Procedure

Tests for Random Effects

Hausman Test

For models that include random effects, the PANEL procedure outputs the results of the Hausman (1978) specification test, which provides guidance of choosing random-effect model or fixed-effect model. This test was also proposed by Wu (1973) and further extended in Hausman and Taylor (1982).

Consider two estimators, ModifyingAbove bold-italic beta With caret Subscript e and ModifyingAbove bold-italic beta With caret Subscript c, which under the null hypothesis are both consistent, but only ModifyingAbove bold-italic beta With caret Subscript e is asymptotically efficient. Under the alternative hypothesis, only ModifyingAbove bold-italic beta With caret Subscript c is consistent. The m statistic is

m equals left-parenthesis ModifyingAbove bold-italic beta With caret Subscript c Baseline minus ModifyingAbove bold-italic beta With caret Subscript e Baseline right-parenthesis Superscript prime Baseline left-parenthesis ModifyingAbove bold upper Sigma With caret Subscript c Baseline minus ModifyingAbove bold upper Sigma With caret Subscript e Baseline right-parenthesis Superscript negative 1 Baseline left-parenthesis ModifyingAbove bold-italic beta With caret Subscript c Baseline minus ModifyingAbove bold-italic beta With caret Subscript e Baseline right-parenthesis

where ModifyingAbove bold upper Sigma With caret Subscript c and ModifyingAbove bold upper Sigma With caret Subscript e are estimates of the asymptotic covariance matrices of ModifyingAbove bold-italic beta With caret Subscript c and ModifyingAbove bold-italic beta With caret Subscript e. The statistic m follows a chi squared distribution with k degrees of freedom, where k is the rank of left-parenthesis ModifyingAbove bold upper Sigma With caret Subscript c Baseline minus ModifyingAbove bold upper Sigma With caret Subscript e Baseline right-parenthesis Superscript negative 1. This rank is normally equal to the dimension of ModifyingAbove bold-italic beta With caret Subscript c Baseline minus ModifyingAbove bold-italic beta With caret Subscript e, but it is reduced when regressors that are constant within cross sections are dropped from the fixed-effects model.

The null hypothesis is that the effects are independent of the regressors. Under the null hypothesis, the fixed-effects estimator is consistent but inefficient, whereas the random-effects estimator is both consistent and efficient. Failure to reject the null hypothesis favors the random-effects specification.

Breusch and Pagan Test for Random Effects

Breusch and Pagan (1980) developed a Lagrange multiplier test for random effects. The null hypothesis of this test is that the variance of the random effect is zero. The test helps you choose between random-effects model regression and pooled OLS regression, and it is based on the pooled OLS estimator. If ModifyingAbove u With caret Subscript i t is the i tth residual from the pooled OLS regression, then the Breusch-Pagan (BP) test for one-way random effects is

upper B upper P equals StartFraction upper N upper T Over 2 italic left-parenthesis upper T minus italic 1 italic right-parenthesis EndFraction left-bracket StartFraction sigma-summation Underscript i italic equals italic 1 Overscript upper N Endscripts left-bracket sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts ModifyingAbove u With caret Subscript i t Baseline right-bracket squared Over sigma-summation Underscript i italic equals italic 1 Overscript upper N Endscripts sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts ModifyingAbove u With caret Subscript i t Superscript 2 Baseline EndFraction minus 1 right-bracket squared

The BP test generalizes to the case of a two-way random-effects model (Greene 2000, p. 589). Specifically,

StartLayout 1st Row 1st Column upper B upper P Baseline 2 2nd Column equals 3rd Column StartFraction upper N upper T Over 2 left-parenthesis upper T minus 1 right-parenthesis EndFraction left-bracket StartFraction sigma-summation Underscript i italic equals italic 1 Overscript n Endscripts left-bracket sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts ModifyingAbove u With caret Subscript i t Baseline right-bracket squared Over sigma-summation Underscript i italic equals italic 1 Overscript upper N Endscripts sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts ModifyingAbove u With caret Subscript i t Superscript 2 Baseline EndFraction minus 1 right-bracket squared 2nd Row 1st Column Blank 2nd Column plus 3rd Column StartFraction upper N upper T Over 2 left-parenthesis upper N minus 1 right-parenthesis EndFraction left-bracket StartFraction sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts left-bracket sigma-summation Underscript i italic equals italic 1 Overscript upper N Endscripts ModifyingAbove u With caret Subscript i t Baseline right-bracket squared Over sigma-summation Underscript i italic equals italic 1 Overscript upper N Endscripts sigma-summation Underscript t italic equals italic 1 Overscript upper T Endscripts ModifyingAbove u With caret Subscript i t Superscript 2 Baseline EndFraction minus 1 right-bracket squared EndLayout

is distributed as a chi squared statistic with two degrees of freedom.

Because a two-way model generalizes a one-way model, failure to reject the null hypothesis of no random effects with BP2 usually implies a failure reject with BP as well. For both the BP and BP2 tests, the residuals are obtained from a pooled regression. There is very little extra cost in selecting both the BP and BP2 tests. Notice that in the case of only groupwise heteroscedasticity, the BP2 test approximates the BP test. In the case of time-based heteroscedasticity, the BP2 test reduces to a BP test of time effects. In the case of unbalanced panels, neither the BP nor BP2 statistics are valid.

Finally, you should be aware that the BP option generates different results, depending on whether the estimation option is FIXONE or FIXONETIME. When you specify the FIXONE option, the BP option requests a test for cross-sectional random effects. When you specify the FIXONETIME option, the BP option requests a test for time random effects.

Although the Hausman test is automatically provided, you can request the Breusch-Pagan tests via the BP and BP2 options in the MODEL statement.

For more information about the Breusch and Pagan tests, see Baltagi (2013, sec. 4.2).

Last updated: June 19, 2025