# Within transformation in fixed effect regression model

I am dealing with panel data model and in particular with the case of fixed effect (or Least Squares Dummy Variables, LSDV) model.

I have studied that $b_{LSDV}$ can be computed by appling OLS method to the usual equation $y=X\beta+D\alpha+\epsilon$, where D is a NTxN matrix of dummies and $\alpha$ represent an NTx1 vector of individual effects.

Now, I have found that another way to compute $b_{LSDV}$ is to apply the so called within transformation to the usual model in order to obtain a demeaned version of it, i.e. $M_{[D]}y=M_{[D]}X\beta+M_{[D]}\epsilon$.

My question is which is the difference between the two models? I've read that the second one is the most used by econometric softwares; is it true? Why?

The second version uses the Frisch-Waugh-Lovell theorem which says that you can compute a subset of regression coefficients of a regression (here, $\hat\beta$) by (1) regressing $y$ on the other regressors (here, $D$), saving the residuals (here, the time-demeaned $y$ or $M_{[D]}y$, because regression on a constant just demeans the variables), then (2) regressing the $X$ on $D$ and saving the residuals $M_{[D]}X$, and (3) regress the residuals onto each other, $M_{[D]}y$ on $M_{[D]}X$.
• The two approaches only concern algebraic computation of the coefficient estimate and are hence not related to the underlying assumptions you may entertain about the model. What my answer is to say is that either approach will give you numerically identical answers regarding $\hat\beta$. Whether or not the regressors in $X$ are exogenous or not or whether the error terms are heteroskedastic will have to be decided differently. Mar 7 '16 at 15:04