Skip to main content

Cookies on Macro by Mark.We use essential cookies for sign-in, locale, and security. With your permission, we also use optional cookies for preferences, for analytics, and for advertising measurement with the Meta (Facebook) Pixel. Read our cookie policy.

Macro by MarkMacro by Mark
  • Home
Loading…
Loading…
← Models
MacroConceptsPolicyModels

Fixed-effects panel Model

Pooled cross-country or cross-region regression with country and time fixed effects to net out unit-level and aggregate variation.

OverviewGraphMathReferences

How do you estimate causal effects across countries or regions while controlling for all time-invariant unobserved heterogeneity?

Background

Cross-country growth regressions (Barro 1991, Mankiw-Romer-Weil 1992) estimate the determinants of GDP growth across 50-150 countries. The problem: countries differ in countless unobserved ways - institutions, culture, geography, colonial history - that are correlated with the regressors. A regression of GDP growth on investment share, education, and population growth will be biased if omitted institutional quality is correlated with investment. OLS attributes the institutional effect to investment, inflating its estimated coefficient. The fixed-effects estimator solves this by including a separate intercept (dummy variable) for each country. These country-specific intercepts absorb all time-invariant unobserved heterogeneity, purging the within-country estimates of omitted-variable bias from permanent cross-country differences.

The estimation works by demeaning. Subtract each country's time-series average from every observation: yit−yˉi=β(xit−xˉi)+(εit−εˉi)y_{it} - \bar{y}_i = \beta (x_{it} - \bar{x}_i) + (\varepsilon_{it} - \bar{\varepsilon}_i)yit​−yˉ​i​=β(xit​−xˉi​)+(εit​−εˉi​). The country fixed effect αi\alpha_iαi​ cancels out. What remains is the within-country variation: how changes in xxx within a given country over time relate to changes in yyy within that same country. This is the 'within estimator.' It identifies β\betaβ from temporal variation only, discarding all cross-sectional information. If xxx does not vary over time within countries (e.g., a time-invariant institutional index), the fixed-effects estimator cannot estimate its effect at all.

Time fixed effects (year dummies) complement entity fixed effects. A two-way fixed-effects model includes both country dummies and year dummies: yit=αi+γt+βxit+εity_{it} = \alpha_i + \gamma_t + \beta x_{it} + \varepsilon_{it}yit​=αi​+γt​+βxit​+εit​. The year dummies absorb global shocks (oil crises, financial contagion, pandemics) that hit all countries simultaneously. After two-way demeaning, β\betaβ is identified from within-country, within-year variation: how a country's deviation from its own average and from the global year average relates to its regressor's deviation from the same double average.

The fixed-effects panel is the default specification in empirical macroeconomics and public economics when panel data is available. The IMF's cross-country fiscal policy studies, the World Bank's growth diagnostics, OECD economic surveys, and the academic growth-institutions literature (Acemoglu, Johnson, Robinson 2001 for instruments; Rodrik, Subramanian, Trebbi 2004 for comparison) all rely on fixed-effects panels as their baseline specification. The Hausman test adjudicates between fixed and random effects; when it rejects random effects (as it almost always does in macro panels), fixed effects is the standard.

Connections to explore

Math ↗The structure and its conditions, step by step.References ↗Academic sources and guidance for using the model.

How the Parts Fit Together

αi\alpha_iαi​

Entity fixed effect

Time-invariant unobserved heterogeneity for entity i. Absorbs all permanent cross-entity differences (institutions, geography, culture). Eliminated by the within transformation.

The data structure is a balanced or unbalanced panel: NNN entities (countries, states, industries) observed over TTT time periods (years, quarters). The dataset has N×TN \times TN×T observations (or fewer if unbalanced). Each observation is indexed by (i,t)(i, t)(i,t). The dependent variable yity_{it}yit​ is the macroeconomic outcome of interest (GDP growth, inflation, unemployment, debt-to-GDP ratio). The regressors xitx_{it}xit​ are the policy or structural variables whose effects we want to estimate (tax rate, trade openness, government spending share, institutional quality index).

The model separates the error term into three components. The entity fixed effect αi\alpha_iαi​ captures all time-invariant unobserved characteristics of entity iii (geography, deep institutions, culture). The time fixed effect γt\gamma_tγt​ captures all entity-invariant shocks at time ttt (global recessions, oil shocks, technology shifts). The idiosyncratic error εit\varepsilon_{it}εit​ is the remaining variation specific to entity iii at time ttt, assumed to satisfy strict exogeneity: E[εit∣xi1,…,xiT,αi,γt]=0E[\varepsilon_{it} | x_{i1}, \ldots, x_{iT}, \alpha_i, \gamma_t] = 0E[εit​∣xi1​,…,xiT​,αi​,γt​]=0.

Estimation by OLS on the demeaned data (within transformation) is algebraically equivalent to LSDV (least squares with dummy variables) but computationally cheaper for large N. Standard errors must be clustered at the entity level to account for serial correlation in the idiosyncratic error within each entity's time series. Failure to cluster produces dramatically understated standard errors and spurious significance. With small N (fewer than 50 clusters), cluster-robust standard errors are themselves unreliable; the wild cluster bootstrap (Cameron, Gelbach, Miller 2008) provides a finite-sample correction.

Assumptions

Testable

Strict exogeneity

E[εit∣xi1,xi2,…,xiT,αi]=0E[\varepsilon_{it} | x_{i1}, x_{i2}, \ldots, x_{iT}, \alpha_i] = 0E[εit​∣xi1​,xi2​,…,xiT​,αi​]=0 for all ttt. Current idiosyncratic error is uncorrelated with past, present, and future regressors within the entity.

If violated:If past y affects current x (reverse causality) or if current shocks affect future x (feedback), the within estimator is inconsistent. Dynamic panels (lagged dependent variable) violate strict exogeneity by construction; the Arellano-Bond GMM estimator is needed instead.

Maintained

No time-varying omitted variables

All time-varying determinants of yity_{it}yit​ correlated with xitx_{it}xit​ are included in the model. The fixed effects absorb time-invariant confounders but not time-varying ones.

If violated:If a time-varying confounder (e.g., policy expectations, political regime change) is omitted and correlated with x, the within estimator is biased. Fixed effects are not a panacea for endogeneity; they only address the time-invariant component.

Testable

Homogeneous slope coefficients

The effect of xxx on yyy is the same across all entities: β\betaβ does not vary with iii. The within estimator pools all entities and estimates a single β\betaβ.

If violated:If βi\beta_iβi​ varies across countries (heterogeneous effects), the one-way FE estimator converges to a convex combination of entity-specific betas, with positive weights proportional to each entity's within variance of xxx. This average overweights high-variance entities and may not represent any individual country's effect, though it cannot reverse sign. Negative weights and possible sign reversal arise in two-way FE with staggered treatment timing (de Chaisemartin and d'Haultfoeuille 2020).

Testable

Sufficient within-entity variation

The regressors xitx_{it}xit​ vary meaningfully over time within each entity. Variables that are constant or nearly constant within entities have no identifying variation after demeaning.

If violated:Time-invariant regressors (distance to equator, colonial origin) are perfectly collinear with entity fixed effects and cannot be estimated. Slowly varying regressors (institutional indices that change once per decade) have very little within-entity variation, producing large standard errors and imprecise estimates.

Testable

No cross-sectional dependence (for standard inference)

εit\varepsilon_{it}εit​ is independent across entities iii for any given ttt, after conditioning on entity and time fixed effects.

If violated:Cross-sectional dependence (spatial spillovers, common unobserved factors beyond time dummies) produces biased standard errors even with entity-level clustering. Driscoll-Kraay standard errors or factor-augmented models are needed.

Testable

Correct functional form

The relationship between y and x is linear in parameters (possibly after transformation). No threshold effects, interactions, or nonlinearities are omitted.

If violated:A linear specification misses diminishing returns (e.g., the effect of education on growth declines at higher education levels), interaction effects (the effect of trade openness depends on institutional quality), and threshold effects (fiscal multipliers differ above and below some debt-to-GDP ratio).

Applications

The IMF's cross-country fiscal policy research uses fixed-effects panels extensively. Fiscal Monitor chapters often estimate how consolidation episodes, spending cuts, tax changes, and debt dynamics relate to GDP growth, unemployment, and inequality after absorbing country and year effects. These estimates inform policy advice, but they are not the same object as a structural fiscal-multiplier estimate from a time-series SVAR.

Growth regressions in the Barro tradition pool 50-100 countries over 30-50 years, with country fixed effects absorbing deep determinants (geography, colonial legacy) and identifying β\betaβ from within-country changes over time (how a country's GDP growth changed when its investment share changed). The World Bank's World Development Report and the OECD's Going for Growth publication rely on panel-FE estimates of the growth effects of structural reforms (product market regulation, labor market flexibility, trade openness).

Monetary policy transmission studies use panel-FE across euro area countries or US states to estimate how interest rate changes affect output and prices while controlling for country-specific structural characteristics. Romer and Romer (2004) inspired a literature using narrative identification of monetary shocks in panel settings. Regional panels (US states, EU NUTS-2 regions) estimate local fiscal multipliers, spatial spillovers, and the effects of place-based policies.

Do not use fixed-effects panels when the variable of interest does not vary over time within entities (e.g., the effect of latitude on growth - FE cannot estimate this), when TTT is very small (T<5)(T < 5)(T<5) so that within-entity variation is minimal, when cross-sectional dependence is strong and standard FE inference fails, or when the true model is dynamic (lagged dependent variable) and strict exogeneity is violated.

Extensions and open questions

Variants

  • One-way FE (entity only): yit=αi+xitβ+εity_{it} = \alpha_i + x_{it} \beta + \varepsilon_{it}yit​=αi​+xit​β+εit​. Absorbs time-invariant confounders only.
  • Two-way FE (entity + time): yit=αi+γt+xitβ+εity_{it} = \alpha_i + \gamma_t + x_{it} \beta + \varepsilon_{it}yit​=αi​+γt​+xit​β+εit​. Absorbs both time-invariant and entity-invariant confounders.
  • Correlated random effects (Mundlak): random effects with entity means of x as additional regressors. Equivalent to FE for the time-varying regressors but also estimates effects of time-invariant variables.
  • Interactive fixed effects (Bai 2009): yit=αi′ft+xitβ+εity_{it} = \alpha_i' f_t + x_{it} \beta + \varepsilon_{it}yit​=αi​′ft​+xit​β+εit​. Replaces additive two-way FE with factor structure αi′ft\alpha_i' f_tαi​′ft​ that captures heterogeneous responses to common shocks.
  • Difference-in-differences (DID): two-way FE applied to policy evaluation with staggered treatment adoption. Under scrutiny since de Chaisemartin and d'Haultfoeuille (2020) and Sun and Abraham (2021) showed negative weighting problems.

Open questions

  • The 'negative weighting' problem in staggered DID: standard two-way FE can assign negative weights to some treatment effects under heterogeneous treatment timing. New estimators (Callaway-Sant'Anna, Sun-Abraham, Borusyak-Jaravel-Spiess) fix this but have not yet been universally adopted.
  • How to handle the Nickell bias in dynamic panels when TTT is moderate (15-30)? Arellano-Bond GMM works for large NNN, small TTT. Bias-corrected LSDV (Kiviet 1995) works for moderate TTT. Neither is ideal for the typical macro panel (N=50,T=30)(N = 50, T = 30)(N=50,T=30).
  • Should researchers report FE estimates alongside correlated random effects estimates to assess sensitivity to the within-variation restriction?

Keep going

Read next

Continue with a related concept, model, or example.

Theory model

IS-LM Model

a well-connected theoretical model two steps from here

New angle: theoretical model →
Macro by Mark
Help
Privacy PolicyTerms of UseEthics and Compliance

© 2026 Mark Jayson Nation LLC