Mathwords logoMathwords

Fixed Effects Model — Definition, Formula & Example

A fixed effects model is a regression for data that track the same units (people, stores, states) over time. It gives every unit its own intercept, so anything about a unit that never changes is controlled for automatically, even if you never measured it.

For panel data (xit,yit)(x_{it}, y_{it}) with units i=1,…,Ni = 1, \dots, N and periods t=1,…,Tt = 1, \dots, T, the fixed effects model is yit=αi+βxit+εity_{it} = \alpha_i + \beta x_{it} + \varepsilon_{it}. Each αi\alpha_i is an unknown constant parameter that may be correlated with xitx_{it}. The model assumes strict exogeneity, E[εit∣xi1,…,xiT,αi]=0E[\varepsilon_{it} \mid x_{i1}, \dots, x_{iT}, \alpha_i] = 0. The slope β\beta is estimated by ordinary least squares on within-unit deviations, yit−yˉiy_{it} - \bar{y}_i regressed on xit−xˉix_{it} - \bar{x}_i. This is numerically identical to including one dummy variable per unit (with no separate overall intercept).

Key Formula

yit=αi+βxit+εity_{it} = \alpha_i + \beta x_{it} + \varepsilon_{it}
Where:
  • yity_{it} = Outcome for unit i at time t
  • xitx_{it} = Explanatory variable for unit i at time t
  • αi\alpha_i = Fixed effect: a separate intercept for unit i, constant over time
  • β\beta = Common slope, the same for every unit
  • εit\varepsilon_{it} = Error term

Worked Example

Problem: Two stores are each observed for 2 weeks. Ad spending xx is in hundreds of dollars, and weekly sales yy are in thousands of dollars. Store A: (2,10)(2, 10) and (4,14)(4, 14). Store B: (6,30)(6, 30) and (8,34)(8, 34). Fit a fixed effects model and compare its slope with a pooled regression that ignores which store each observation came from.
Step 1: Find each store's average ad spending and average sales.
xˉA=2+42=3, yˉA=10+142=12, xˉB=6+82=7, yˉB=30+342=32\bar{x}_A = \tfrac{2+4}{2} = 3,\ \bar{y}_A = \tfrac{10+14}{2} = 12,\ \bar{x}_B = \tfrac{6+8}{2} = 7,\ \bar{y}_B = \tfrac{30+34}{2} = 32
Step 2: Subtract each store's own means. The demeaned x-values are −1, 1, −1, 1, and the demeaned y-values are −2, 2, −2, 2. Run least squares on these deviations.
β^=∑x~ity~it∑x~it2=2+2+2+21+1+1+1=84=2\hat{\beta} = \frac{\sum \tilde{x}_{it}\tilde{y}_{it}}{\sum \tilde{x}_{it}^2} = \frac{2+2+2+2}{1+1+1+1} = \frac{8}{4} = 2
Step 3: Recover each store's intercept with the formula below. Then compare with the pooled slope. In the pooled regression, the x-deviations from 5 are −3, −1, 1, 3, and the y-deviations from 22 are −12, −8, 8, 12.
α^A=12−2(3)=6,α^B=32−2(7)=18,β^pooled=8820=4.4\hat{\alpha}_A = 12 - 2(3) = 6,\quad \hat{\alpha}_B = 32 - 2(7) = 18,\quad \hat{\beta}_{\text{pooled}} = \frac{88}{20} = 4.4
Answer: The fixed effects slope is β^=2\hat{\beta} = 2. Within a store, each extra $100 of ad spending goes with $2,000 more weekly sales. The store intercepts are 6 and 18, which captures Store B's higher baseline. The pooled slope of 4.4 is more than twice as large. It is inflated because the bigger store both advertises more and sells more.

Why It Matters

Fixed effects models are a core tool in econometrics and policy evaluation. They control for hidden traits that do not change over time, such as a worker's innate ability or a state's geography. You will meet them in courses on panel data, where the Hausman test is used to choose between fixed effects and random effects.

Common Mistakes

Mistake: Trying to estimate the effect of a variable that never changes within a unit, such as a store's city or a person's birth year.
Correction: Demeaning wipes out any time-invariant variable, because it equals its own mean. Its effect is absorbed into αi\alpha_i and cannot be estimated separately. Use a random effects or pooled model if you need that coefficient.

Related Terms

  • Model — The general idea of simplifying reality that this regression applies
  • Linear Regression — Fitting method applied to the demeaned panel data
  • Regression Equation — Single-intercept equation that fixed effects extends per unit
  • Correlation vs. Causation — Fixed effects remove time-invariant confounders behind spurious correlations
  • Confidence Interval — Used to report uncertainty in the estimated slope beta
  • Residual Plot — Checks whether the within-unit fit leaves systematic patterns
  • Regression — General method that fixed effects models extend to panel data