Reducing omitted variable bias with fixed effects regression models

Ceren Altincekic18 Oct 2022

Problem

Analysts often hold data on customers, accounts, patients or countries observed repeatedly over time, with only a few attributes per entity. Such data usually lacks culture, business practices, regulation or customer history. If a missing variable correlates with the features in the model, the coefficients of those features are biased. Stakeholders then get a wrong picture of which features matter.

Example from the article: a real-estate price model has size, bedrooms, bathrooms, view and age, but no floor level. Floor level correlates with both price and view, so the coefficient of view is biased upward.

Solution in brief

Add a dummy variable for every entity (fixed effects) to a linear regression on panel data. The dummies absorb everything that is specific to an entity and constant over time, so the coefficients of time-varying features are less biased without collecting the missing variables. A Hausman test tells whether the cheaper random effects model is acceptable instead.

Questions this case answers
  • How to estimate the effect of time-varying factors on an outcome from repeated observations of the same units when stable unit-level confounders are unobserved
  • How to estimate the effect of features on an outcome from panel data when entity-level variables are missing?
  • How to reduce omitted variable bias in a linear model without collecting more data?
  • How to choose between fixed effects and random effects for panel data?

Tools and methods

  • Fixed effects regression — entity dummies control for unobserved time-invariant entity factors.
  • Random effects regression — alternative that also estimates time-invariant variables, valid only if they are uncorrelated with the other features.
  • Hausman test — chooses between fixed and random effects.
  • linearmodels (PanelOLS) and statsmodels — Python implementation on a pandas dataframe indexed by entity and time.
Continue reading — it's free

Google or a one-time email code. No password.