Within Estimator
Also known as · within estimator · fixed-effects within transformation
The within estimator is the algebraic equivalent of the Fixed Effects estimator. Instead of running OLS with unit dummies, it demeans each variable by subtracting the unit-specific mean: , , then runs OLS on the transformed data. The unit-fixed effect vanishes in the demeaning (it equals its own mean), leaving identified by within-unit variation only.
When to use
In practice you don't compute this by hand — feols(y ~ x | unit, data = df) (fixest) or plm(y ~ x, model = "within", data = df) (plm) do the within-transformation automatically and produce identical to OLS-with-dummies. The within form is faster on huge panels and clarifies the intuition: the coefficient comes from how each unit's own changes in relate to its own changes in .