Random Effects Panel Model

Econometrics
Introduced by
Baltagi (textbook treatment); Hausman specification test
Year
1978
Type
Panel data regression

What does it do?

The random effects model is a panel data estimator that explains an outcome using both within-unit and between-unit variation.

It treats unobserved unit-specific heterogeneity as a random term with mean zero and estimated variance, rather than as a fixed parameter for each unit. Its validity depends on whether that heterogeneity is uncorrelated with the predictors, which is checked with the Hausman (1978) specification test, and the estimator is developed in standard treatments such as Baltagi's Econometric Analysis of Panel Data.

The intuition behind the method

Imagine many units (people, firms, countries) each observed over several time periods. Each unit carries its own baseline level, but instead of estimating a separate intercept for every unit, the random effects model assumes those baselines are random draws from a common distribution with mean zero around the overall intercept. This lets the estimator pool information across all observations and use both how a unit changes over time and how units differ from one another. Discarding the between-unit information, as fixed effects does, is what makes random effects more efficient when its assumptions hold.

History

The random effects estimator is presented in standard treatments such as Baltagi's Econometric Analysis of Panel Data (2005), which covers the GLS estimator and its variance-component structure. The choice between random and fixed effects is commonly made with Hausman's (1978) specification test, which compares the two estimators.

When to use it

Use the random effects model with panel data, meaning multiple units observed over multiple time periods, and with a reasonably large number of units. It is appropriate when the units are a random, representative sample from a larger population and when the unit-specific effects are uncorrelated with the predictors. Confirm the second condition with a Hausman test (p > 0.05), and prefer it over fixed effects when the condition holds because it is more efficient and can estimate the effect of time-invariant variables. Do not use it when the Hausman test rejects (use fixed effects instead), when there is only one time period (use cross-sectional OLS), when the number of units is small, or when the outcome is binary or count. The linear GLS form shown here applies to a continuous outcome only; binary or count outcomes need a different random effects specification, which this page does not cover.

Limitations and considerations

  • Yields biased and inconsistent estimates if the unit effects are correlated with the predictors; this is exactly what the Hausman test checks.
  • Requires the units to be a random, representative sample from the population, so the random effects are a reasonable description of the units.
  • The GLS weights depend on variance components that are estimated with error. The estimates are consistent only when the number of units, or the number of observations per unit, is large enough, so with a small panel the coefficients and their standard errors can be unreliable and should be interpreted with caution.
  • The default standard errors are not designed for heteroskedastic or serially correlated idiosyncratic errors within units; if these are present, the reported standard errors are unreliable. Robust covariance estimators, such as the White-type estimator or the Arellano estimator clustered by unit, are the usual remedy, and the plm documentation describes them as robust covariance matrices for random and fixed effects panel models.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • More efficient than the fixed effects estimator when the random effects assumption holds, because it uses both within-unit and between-unit variation.
  • Can estimate coefficients on time-invariant predictors, which fixed effects cannot, because it does not difference out unit-level intercepts.
  • Models unobserved heterogeneity parsimoniously as a single variance component instead of one intercept per unit.

Applications

  • Modelling firm-level or country-level outcomes over time when the panel units are sampled from a larger population.
  • Estimating the effect of time-invariant characteristics (such as a fixed regional or demographic attribute) that fixed effects would absorb.
  • Efficiently combining cross-sectional and longitudinal variation in economic, social, and health panel datasets.

How it works

How it works

1

The outcome y for unit i at time t is written as a linear function of the predictors X plus a composite error. That error splits into a unit-specific random effect αᵢ, with mean zero and variance σ²α, and an idiosyncratic disturbance εᵢₜ. The model rests on four assumptions: E(αᵢ) = 0 and Var(αᵢ) = σ²α; the idiosyncratic errors εᵢₜ have mean zero, constant variance σ²ε, and are independent across units and over time; αᵢ and εᵢₜ are independent of each other; and αᵢ is uncorrelated with the predictors. The last assumption is the one the Hausman test examines. The formula as written is linear and so applies to a continuous outcome.

Formula
y_{it} = X_{it}\beta + (\alpha_i + \varepsilon_{it}),\quad \alpha_i \sim (0,\sigma_\alpha^2)
2

The composite error makes observations from the same unit correlated, so ordinary least squares is no longer efficient. The model is instead estimated by feasible generalized least squares (GLS), β̂ = (XᵀΩ⁻¹X)⁻¹XᵀΩ⁻¹y. Ω is the covariance matrix of the full stacked error vector: for N units observed over T periods it equals σ²ε I_NT + σ²α (I_N ⊗ J_T), where J_T is a T×T matrix of ones, so that any two observations from the same unit share covariance σ²α. The variance components σ²ε and σ²α are unknown and are estimated from the sample, typically from the residuals of a preliminary fit, and the estimated Ω is then used in the GLS formula. When the random effects assumption holds, this gives more efficient coefficients than fixed effects.

Formula
\hat{\beta}_{GLS} = (X^{\top}\Omega^{-1}X)^{-1}X^{\top}\Omega^{-1}y

Common pitfalls

  • Reporting random effects results without running a Hausman test; if it rejects (p < 0.05) the estimator is inconsistent and fixed effects should be used.
  • Applying it with a single time period (T = 1), where there is no repeated observation of any unit and cross-sectional OLS is appropriate.
  • Trusting GLS coefficients from a panel with few units or few observations per unit, where the estimated variance components that define the GLS weights are imprecise.
  • Reporting default standard errors without checking whether the idiosyncratic errors are heteroskedastic or serially correlated within units.

Frequently asked questions

How do I choose between random and fixed effects?

Run a Hausman test. If it rejects the null (p < 0.05), the unit effects are correlated with the predictors, the random effects estimator is inconsistent, and you should use fixed effects. If it does not reject (p > 0.05), random effects is valid and preferred because it is more efficient.

Why is random effects more efficient than fixed effects?

Fixed effects discards all between-unit variation by absorbing a separate intercept for each unit. Random effects keeps that information and, via GLS, optimally weights the within-unit and between-unit variation, producing smaller standard errors when the random effects assumption holds.

Can random effects estimate time-invariant variables?

Yes. Because it does not difference out unit-level intercepts, it can identify coefficients on predictors that do not vary over time within a unit — something fixed effects cannot do, since those predictors are collinear with the unit dummies.

What happens with only one time period?

With T = 1 there is no repeated observation of any unit, so the panel structure offers no advantage and the variance components cannot be separated. In that case a cross-sectional OLS regression is the appropriate method.

Related methods

Sources

  1. Hausman, J. A. (1978). Specification Tests in Econometrics. Econometrica, 46(6), 1251-1271.

    Open DOI reference
  2. Baltagi, B. H. (2005). Econometric Analysis of Panel Data. Wiley.

    ISBN: 978-0470014561