- Introduced by
- Balestra & Nerlove (1966); Mundlak (1978); Hausman (1978)
- Year
- 1966–1978
- Type
- Panel regression framework
- Family
- Econometrics / time series
What does it do?
Panel data analysis models data that track multiple units — countries, firms, individuals — over time, enabling researchers to control for unobserved unit-level heterogeneity that would otherwise bias cross-sectional or time-series estimates.
The two core specifications are fixed effects and random effects, selected via the Hausman test.
The intuition behind the method
Suppose you want to know whether education raises wages, but smarter people both get more education and earn more for reasons unrelated to schooling. A cross-section cannot separate these stories. Panel data lets you compare each person to themselves over time, effectively holding constant everything about a person that does not change — intelligence, family background, personality — and isolating the education effect on wage changes within the same individual.
History
Panel data methods developed as economists began combining cross-section and time-series data, using an error-components structure that separates a unit-specific component from an idiosyncratic shock. Hausman (1978) proposed specification tests, and the comparison of fixed- and random-effects estimators based on that work remains the standard decision rule for choosing between them.
When to use it
Use panel data methods when the same units (individuals, firms, countries) are observed at several time points and unobserved unit-level differences could bias a pooled cross-section or a single time series. Prefer fixed effects when unit-specific traits may correlate with your regressors, since FE does not require those traits to be uncorrelated with X. Prefer random effects only when you have a credible reason to think the unit effects are uncorrelated with the regressors, and you need coefficients on time-invariant covariates such as sex or country geography, which FE cannot estimate. Avoid pooled OLS when unit effects are correlated with the regressors, because it is then biased and inconsistent. If the model includes a lagged dependent variable, standard FE and RE are not appropriate; the Arellano-Bond or System GMM estimator is the relevant alternative. The estimators rest on explicit assumptions. FE requires the regressors to be strictly exogenous conditional on the unit effect. RE additionally requires the unit effect to be uncorrelated with the regressors. Classical standard errors assume a homoskedastic, serially uncorrelated idiosyncratic error, so robust or clustered inference is needed when these conditions fail.
Limitations and considerations
- Fixed effects cannot estimate coefficients on time-invariant regressors (for example sex or country), because the unit-specific intercepts absorb them.
- In short panels (small T) with a lagged dependent variable, the within transformation correlates the lagged regressor with the demeaned error, producing Nickell bias in FE estimates.
- Random effects consistency requires the unit effects to be uncorrelated with the regressors; a Hausman test that does not reject this is supporting evidence, not proof.
- Attrition produces unbalanced panels; if units leave the panel for reasons related to the outcome, within-unit estimates can be selection-biased.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Controls for unit-level unobserved heterogeneity that is constant over time, which a single cross-section cannot separate from the effects of regressors.
- The fixed effects (within) estimator remains consistent when unit effects are correlated with the regressors, because demeaning by unit removes those effects.
- The random effects estimator combines between-unit and within-unit variation through GLS, so it is more efficient than FE when its assumption holds and can estimate time-invariant covariates.
- Repeated observations of the same units allow direct analysis of within-unit change over time, which pure cross-sections cannot show.
Applications
- Estimating the return to schooling using individual wage and education data tracked over many years.
- Analysing the effect of corporate governance policies on firm performance across firms and years.
- Assessing how trade openness affects economic growth across countries over decades.
- Studying the impact of environmental regulations on industrial pollution levels across states or provinces.
- Evaluating the effect of health interventions on patient outcomes tracked across multiple clinic visits.
- Modelling the determinants of bank lending using annual balance-sheet data for many banks.
How it works
How it works
Start with the pooled model: the outcome y for unit i at time t is a linear function of regressors X plus a composite error. Pooled OLS ignores unit heterogeneity. It is biased and inconsistent when the unobserved unit effect is correlated with the explanatory variables. If the effect is present but uncorrelated with X, pooled OLS remains consistent but is inefficient, and its standard errors must allow for within-unit correlation.
Formula
y_{it} = \alpha + X_{it}\beta + \varepsilon_{it}The composite error splits into a unit-specific component μᵢ (capturing permanent but unobserved differences across units) and an idiosyncratic shock νᵢₜ. How μᵢ relates to X determines the choice of estimator.
Formula
\varepsilon_{it} = \mu_i + \nu_{it}The fixed effects (within) estimator demeans data by unit means, eliminating μᵢ entirely. This allows μᵢ to be arbitrarily correlated with X — the central advantage of FE — at the cost of not identifying time-invariant regressors.
Formula
(y_{it} - \bar{y}_i) = (X_{it} - \bar{X}_i)\beta + (\nu_{it} - \bar{\nu}_i)The random effects estimator treats μᵢ as a random draw uncorrelated with X and applies GLS, weighting between-unit and within-unit variation. RE is more efficient than FE when its stronger assumption holds, and it can identify time-invariant regressors.
Formula
\hat{\beta}_{RE} = \text{GLS with } \text{Var}(\varepsilon_{it}) = \sigma^2_\mu + \sigma^2_\nuThe Hausman statistic tests whether FE and RE coefficients differ significantly. A significant H (p < 0.05) rejects the RE assumption, favouring FE. The statistic follows a chi-squared distribution under the null.
Formula
H = (\hat{\beta}_{FE} - \hat{\beta}_{RE})^\top [\text{Var}(\hat{\beta}_{FE}) - \text{Var}(\hat{\beta}_{RE})]^{-1} (\hat{\beta}_{FE} - \hat{\beta}_{RE})Common pitfalls
- Estimating pooled OLS without testing for unit effects (for example with the Breusch-Pagan LM test). If unit effects are correlated with the regressors, pooled OLS is biased and inconsistent; even when they are uncorrelated, it is inefficient and requires cluster-robust inference.
- Choosing random effects without running the Hausman test; if the unit effects correlate with the regressors, RE is biased. The classical Hausman statistic is also invalid under heteroskedasticity or serial correlation.
- Fitting fixed effects to a dynamic model with a lagged dependent variable in a short panel without recognising Nickell bias; a GMM estimator is then needed.
- Treating an unbalanced panel as balanced, or dropping units with missing observations, without checking whether the missingness is systematic.
- Ignoring cross-sectional dependence in panels with large N and large T. Clustering by unit corrects only within-unit correlation and does not address dependence across units, for which Driscoll-Kraay standard errors are the usual remedy.
Frequently asked questions
What is the difference between fixed effects and random effects?
Fixed effects (FE) treats unit-specific unobserved heterogeneity as a set of parameters to estimate (or removes them by demeaning), allowing them to correlate freely with the regressors. Random effects (RE) treats heterogeneity as a random variable uncorrelated with the regressors and estimates the model by GLS. FE is consistent under weaker assumptions; RE is more efficient and can identify time-invariant covariates. The Hausman test helps guide the choice.
How do I decide between FE and RE in practice?
Run both estimators and apply the Hausman test. If the test statistic is significant (p < 0.05), the FE and RE estimates differ systematically, which indicates that the unit effects correlate with the regressors, and FE is preferred. If the test does not reject, RE is usually preferred for its efficiency, but the non-rejection does not prove that the RE assumption holds.
Can I estimate the effect of gender or other time-invariant variables with fixed effects?
No. Fixed effects absorbs all time-invariant variation through unit-specific intercepts, so a coefficient on a time-invariant variable cannot be identified. Use random effects when you need those estimates. Alternatively, a correlated random effects (Mundlak-type) approach adds the unit means of the time-varying regressors to a random-effects model; this allows within effects to be estimated and time-invariant covariates to be identified under the RE structure.
What is Nickell bias and when does it matter?
When a lagged dependent variable is included as a regressor in a fixed-effects model with a short panel (small T), the within-group demeaning induces a correlation between the lagged regressor and the demeaned error, which biases the estimates. The usual remedy is the Arellano-Bond GMM estimator, which instruments the lagged dependent variable with deeper lags.
What should I do if my panel is unbalanced?
An unbalanced panel (different numbers of observations per unit) is common and can be handled by most estimation software. The key concern is whether missingness is random or systematic. If units with certain characteristics are more likely to drop out, estimates may be selection-biased. Test for non-random attrition and consider inverse probability weighting or selection models as corrections.
Related methods
Sources
Baltagi, B. H. (2021). Econometric Analysis of Panel Data (6th ed.). Springer.
ISBN: 978-3030539528Hausman, J. A. (1978). Specification tests in econometrics. Econometrica, 46(6), 1251–1271.
Open DOI reference