Specialisation B: Data Analytics for Economics

Online MA · Sem 4

Lesson 1 of 4Economics

Panel Data Models: Fixed and Random Effects

Specialisation B: Data Analytics for Economics

About the video

Panel Data Models

econometricsacademy

Study notes

Panel data follow the same individuals or firms over time, so each variable can vary both between individuals and within individuals over time. The estimators covered are pooled OLS, between, first-difference, fixed effects (within or dummy-variable) and random effects. They differ in how they treat the unobserved individual-specific effect a_i, and the Hausman test is used to choose between fixed and random effects.

Types of variables and variation

  • Time-varying regressors x_it change across both individuals and time (e.g. annual income, monthly food spending).
  • Time-invariant regressors have x_it = x_i for every t (e.g. gender, race).
  • Individual-invariant regressors have x_it = x_t for every i (e.g. a time trend, the national unemployment rate).
  • Overall variation is x_it - x̄. Between variation is x̄_i - x̄. Within variation is x_it - x̄_i, which removes each individual's level.

Pooled OLS, between and first-difference estimators

  • Pooled OLS: y_it = b0 + b1 x1_it + b2 x2_it + u_it is estimated on all n*T observations and ignores the panel structure.
  • Between estimator: regresses the individual means ȳ_i on x̄_i, uses only n observations and is rarely used.
  • Model with an individual effect: y_it = b0 + b1 x_it + a_i + u_it, where a_i captures unobserved factors specific to each individual.
  • a_i may be correlated with the regressors (e.g. ability and education). Leaving it in the error term then biases the estimates.
  • First difference: regress Δy_it on Δx_it with n(T-1) observations. a_i cancels out, but time-invariant variables drop out as well.

Fixed effects

  • Within transformation: subtract each individual's time mean from every variable (time-demeaning), so a_i drops out. Then estimate by OLS.
  • The individual effects can be recovered afterwards: a_i = ȳ_i - b·x̄_i.
  • The dummy-variable regression includes a dummy for each individual (dropping one as the reference). It gives the same slope coefficients as the within estimator.
  • Time-invariant variables cannot be included because they are perfectly collinear with the fixed effects.
  • The within R-squared explains only within variation, while the dummy-variable R-squared is much higher because the dummies absorb between variation.
  • With T = 2, fixed effects and first differences give identical estimates. With T > 2, first differences can be better if the errors are serially correlated.

Random effects and model choice

  • Random effects assume a_i is uncorrelated with the regressors. The composite error a_i + u_it is then serially correlated within each individual.
  • Pooled OLS is still consistent in this case but inefficient. Random effects uses a quasi-demeaning transformation: y_it - θ ȳ_i.
  • θ = 1 - sqrt(σu² / (σu² + T σa²)).
  • θ close to 0 gives roughly pooled OLS (a_i unimportant). θ close to 1 gives roughly fixed effects (a_i important).
  • Random effects can include time-invariant variables.
  • Hausman test: use it to choose between fixed effects and random effects.

Key terms

Panel data
Repeated observations on the same units over several time periods.
Individual-specific effect a_i
An unobserved, time-constant factor that shifts an individual's outcome.
Within transformation
Subtracting each individual's time average from every variable.
First-difference estimator
OLS on period-to-period changes, which removes a_i.
Random effects
An estimator that assumes a_i is uncorrelated with the regressors and uses quasi-demeaning by θ.
Hausman test
A test used to choose between the fixed effects and random effects estimators.

Takeaways

  • Fixed effects and first differences remove a_i, which handles its correlation with the regressors.
  • Time-invariant regressors cannot be estimated with fixed effects or first differences.
  • Random effects are more efficient but require a_i to be uncorrelated with the regressors.
  • θ near 1 makes random effects resemble fixed effects, and θ near 0 makes them resemble pooled OLS.
Contribute

Was this lesson helpful?

We read every rating and fix the weakest lessons first.