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 with units and periods , the fixed effects model is . Each is an unknown constant parameter that may be correlated with . The model assumes strict exogeneity, . The slope is estimated by ordinary least squares on within-unit deviations, regressed on . This is numerically identical to including one dummy variable per unit (with no separate overall intercept).
Key Formula
Where:
- = Outcome for unit i at time t
- = Explanatory variable for unit i at time t
- = Fixed effect: a separate intercept for unit i, constant over time
- = Common slope, the same for every unit
- = Error term
Worked Example
Problem: Two stores are each observed for 2 weeks. Ad spending is in hundreds of dollars, and weekly sales are in thousands of dollars. Store A: and . Store B: and . 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.
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.
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.
Answer: The fixed effects slope is . 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 and cannot be estimated separately. Use a random effects or pooled model if you need that coefficient.
