Fixed Effects Panel Model

Econometrics
Introduced by
Baltagi (textbook treatment); Hausman test for FE vs RE choice
Year
2005
Type
Panel data regression

What does it do?

The fixed effects panel model estimates relationships in panel data (many units observed over time) using only within-unit variation, which removes unobserved time-invariant heterogeneity across units.

The estimator is the within transformation, a standard treatment of which appears in Baltagi's Econometric Analysis of Panel Data (2005). Whether to use it instead of the random effects model is usually decided with the Hausman (1978) specification test, which is one diagnostic among several.

The intuition behind the method

Each unit — a person, firm, or country — carries its own fixed baseline that never changes over the observation window, such as an innate trait or a stable institution. Instead of comparing one unit to another, the fixed effects model compares each unit only to itself across time: it subtracts every unit's own average from its observations, wiping out whatever is constant for that unit. The slope then reflects how the outcome moves when a predictor changes within the same unit, free of any fixed difference between units.

History

The within estimator is treated at length in Baltagi's Econometric Analysis of Panel Data (2005), which is a standard reference for the method rather than its origin. The sources cited here do not establish who first proposed the within estimator. The formal basis for choosing between fixed and random effects comes from Hausman's 1978 specification test, which checks whether the unit effects are correlated with the regressors.

When to use it

Use the fixed effects model with panel data: several units, each observed over more than one time period. Choose it when the question concerns predictors that vary within units and when unobserved unit characteristics may be correlated with the regressors. A Hausman test that favours fixed over random effects (p < 0.05) supports this choice. The model assumes strict exogeneity, meaning the regressors are uncorrelated with the idiosyncratic errors. Because the within transformation relies only on variation over time within each unit, the estimates are only as precise as that variation allows, so the number of units matters (see limitations). Do not use it with a single time period, when the key predictors are time-invariant, or when endogeneity remains after controlling for unit effects; in that case an instrumental-variable or GMM approach is needed. Dynamic specifications that include a lagged dependent variable need separate treatment (see limitations).

Limitations and considerations

  • Time-invariant predictors cannot be estimated, because the within transformation subtracts them out along with the unit effect.
  • With a single time period (T = 1) the within transformation is undefined: each unit's time-average equals its only observation, so the demeaned data are all zero and the model cannot be estimated this way.
  • With few units the within estimates are imprecise, because identification rests entirely on within-unit variation. Precision falls as the number of units shrinks.
  • Strict exogeneity is required. If a regressor remains correlated with the idiosyncratic error after the unit effects are removed, the fixed effects estimates are biased and an instrumental-variable or GMM approach is needed.
  • Dynamic models are a special case. Including a lagged dependent variable in a fixed effects model with a short time dimension produces biased coefficients, because demeaning makes the transformed lag correlated with the transformed error. Dynamic panels call for GMM-type estimators such as system GMM, which are designed for this problem.

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

Strengths

  • Controls for all unobserved time-invariant heterogeneity across units without needing to measure it.
  • Consistent even when the unit effects are correlated with the regressors, unlike the random effects estimator.
  • Yields directly interpretable within-unit slopes that describe how the outcome changes as a predictor changes inside the same unit.

Applications

  • Estimating policy or treatment effects from panels of countries, firms, or individuals while netting out stable unit differences.
  • Wage and labour studies that follow the same individuals over time to remove unobserved ability.
  • Firm-level analyses of investment, productivity, or finance that control for fixed firm characteristics.

How it works

How it works

1

The outcome y for unit i at time t is written as a unit-specific intercept αᵢ plus the predictors Xᵢₜ times β plus an idiosyncratic error εᵢₜ. The αᵢ absorbs everything about a unit that does not change over time, whether observed or not.

Formula
y_{it} = \alpha_i + X_{it}\beta + \varepsilon_{it}
2

The within transformation subtracts each unit's own time-average (z̈ᵢₜ = zᵢₜ − z̄ᵢ) from both the outcome and the predictors, eliminating the fixed effect αᵢ entirely. Ordinary least squares is then applied to the demeaned data to obtain β̂. Because errors are typically correlated within a unit, cluster-robust (clustered by entity) standard errors are reported.

Formula
\hat{\beta} = \left(\sum_{i,t}\ddot{X}_{it}^{\top}\ddot{X}_{it}\right)^{-1}\sum_{i,t}\ddot{X}_{it}^{\top}\ddot{y}_{it}, \quad \ddot{z}_{it}=z_{it}-\bar{z}_i

Common pitfalls

  • Reporting default standard errors when errors are correlated within units. Use cluster-robust (entity-clustered) standard errors instead, and note that they can be biased when there are few clusters, as in a small panel; interpret the inference with caution in that case.
  • Choosing fixed effects without running a Hausman test against random effects.
  • Trying to interpret time-invariant variables, which the within transformation has already absorbed into the unit effect.
  • Ignoring time effects. Check whether year dummies are jointly significant before trusting the within estimates.
  • Running OLS on the demeaned data and taking the software's standard errors without adjustment. The coefficients are correct, but the degrees of freedom must reflect the absorbed unit effects, so standard errors computed naively will be wrong.

Frequently asked questions

How do I choose between fixed and random effects?

Run a Hausman test. If it rejects the null (p < 0.05), the unit effects are correlated with the regressors and the random effects estimator is inconsistent, so fixed effects should be preferred. If it does not reject, random effects is the more efficient choice.

Why can't fixed effects estimate time-invariant variables?

The within transformation subtracts each unit's own time-average, which removes anything constant for that unit — including the fixed effect and any time-invariant predictor. Their coefficients are therefore not identified. If such variables are central, consider the random effects model instead.

What standard errors should I report?

Errors are usually correlated within a unit across time, so cluster-robust standard errors clustered by entity are recommended; default standard errors would understate the true uncertainty. Cluster-robust errors can themselves be biased when there are only a few clusters, so with a small number of units the inference should be treated with caution.

What if endogeneity remains after fixed effects?

Fixed effects only removes time-invariant unobserved heterogeneity. If a regressor is still correlated with the idiosyncratic error, the estimates are biased and an instrumental-variable or system-GMM approach is required.

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 (3rd ed.). Wiley.

    ISBN: 978-0470014561