Frisch-Waugh-Lovell theorem
Consider the linear regression model:
[ \begin{aligned} Y &= X B + U
&= [X_1 \quad X_2] \begin{bmatrix} \beta_1 \ \beta_2 \end{bmatrix} + U
&= X_1 \beta_1 + X_2 \beta_2 + U \end{aligned} ]
where:
Our objective is to estimate only ( \beta_2 ).
To isolate the effect of ( X_2 ), we remove (project out) the variation explained by ( X_1 ).
Let:
[ M_{X_1} = I - X_1 (X_1’X_1)^{-1} X_1’ ]
be the orthogonal projection matrix onto the orthogonal complement of the column space of ( X_1 ).
Key property:
[ M_{X_1} X_1 = 0 ]
Pre-multiply the model by ( M_{X_1} ):
[ \begin{aligned} M_{X_1} Y &= M_{X_1} X_1 \beta_1
Thus,
[ M_{X_1} Y = M_{X_1} X_2 \beta_2 + M_{X_1} U ]
After projection, the effect of ( X_1 ) disappears.
Now run OLS of ( M_{X_1} Y ) on ( M_{X_1} X_2 ):
[ \hat{\beta}2 = \left[ (M{X_1} X_2)’ (M_{X_1} X_2) \right]^{-1} (M_{X_1} X_2)’ M_{X_1} Y ]
Using properties of projection matrices:
So,
[ \begin{aligned} \hat{\beta}2 &= \left[ X_2’ M{X_1}’ M_{X_1} X_2 \right]^{-1} X_2’ M_{X_1}’ M_{X_1} Y
&= \left[ X_2’ M_{X_1} X_2 \right]^{-1} X_2’ M_{X_1} Y \end{aligned} ]
This result shows that:
This is the Frisch–Waugh–Lovell (FWL) Theorem.
To estimate a subset of coefficients:
[ \boxed{ \hat{\beta}2 = (X_2’ M{X_1} X_2)^{-1} X_2’ M_{X_1} Y } ]
You can obtain ( \hat{\beta}_2 ) by partialling out the effect of ( X_1 ) before running OLS.