# The Frisch-Waugh-Lovell Theorem and a Regression Coefficient

## I am wondering how the following statement holds.

There is a two-way fixed effects model: $$y_{it}=\alpha_i + \gamma_t + \beta D_{it}+e_{it}$$ where $$\alpha_i$$: individual-fixed effects, $$\gamma_t$$: time-fixed effects $$D_{it}$$: a dummy variable, and $$e_{it}$$: the error term.

In this situation, the least square estimator is as follows by the Frisch-Waugh-Lovell theorem:

$$\hat{\beta}_{lse}=\frac{\frac{1}{NT}\sum_{i=1}^N\sum_{t=1}^T y_{it}\tilde{D}_{it}}{\frac{1}{NT}\sum_{i=1}^N\sum_{t=1}^T \tilde{D}_{it}}$$

where $$\tilde{D}_{it}=(D_{it}-\frac{1}{T}\sum_{t=1}^TD_{it})-(\frac{1}{N}\sum_{i=1}^ND_{it}-\frac{1}{NT}\sum_{i=1}^N\sum_{t=1}^TD_{it})$$.