---
tag: 6C67F22FTD
kind: statement
role: theorem
name: Frisch–Waugh–Lovell theorem
msc: [62J05, 62P20]
uses: [YM708KHV2W, 0B8KZRT28M, 0KCE8CG86P, 0ZC9YTXZRY]
about: [YM708KHV2W]
sources:
  - url: https://en.wikipedia.org/wiki/Frisch–Waugh–Lovell_theorem
same_as:
  wikidata: Q1059151
  wikipedia: Frisch–Waugh–Lovell theorem
---

## Statement

Let $y \in \R^n$, let $X_1$ be a real $n \times p_1$ matrix and let $X_2$ be a real $n \times p_2$ matrix.
Assume that the block matrix $X = [X_1 \; X_2]$ has [[rank|0ZC9YTXZRY]] $p_1 + p_2$.
Let $\hat\beta_1, \hat\beta_2$ be the [[ordinary least squares|YM708KHV2W]] coefficients of the regression of $y$ on $X$, and let $e = y - X_1 \hat\beta_1 - X_2 \hat\beta_2$ be its residual vector.
Let $M_1 = I_n - X_1 (X_1^T X_1)^{-1} X_1^T$, the [[orthogonal projection|0B8KZRT28M]] onto the orthogonal complement of the column space of $X_1$.
Then:

1. $\hat\beta_2 = (X_2^T M_1 X_2)^{-1} X_2^T M_1 y$, that is, $\hat\beta_2$ is the least squares coefficient of the regression of $M_1 y$ on $M_1 X_2$.
2. The residual vector of that regression equals $e$.

## Remarks

Multiply $y = X_1 \hat\beta_1 + X_2 \hat\beta_2 + e$ by $M_1$.
Since $M_1 X_1 = 0$ and $X_1^T e = 0$, this gives $M_1 y = M_1 X_2 \hat\beta_2 + e$.
Since $X_2^T e = 0$ and $M_1 e = e$, the vector $e$ is orthogonal to the columns of $M_1 X_2$.
So the last equation is the least squares decomposition of $M_1 y$ on $M_1 X_2$.
The matrix $X_2^T M_1 X_2$ is invertible because $M_1$ is symmetric and [[idempotent|0KCE8CG86P]] and $M_1 X_2$ has rank $p_2$ by the rank hypothesis.

Example: take $X_1$ the column of ones.
Then $M_1$ subtracts the mean.
The theorem says that the slopes of a regression with intercept equal the slopes of the regression of the centred response on the centred regressors.

## Explanations

### L1 human

In a regression with many variables, the coefficient of one group of variables can be found in two steps.
First remove from the response and from that group everything that the other variables explain.
Then regress what is left of the response on what is left of the group.
The answer is the same coefficient as in the full regression.

### L2 human

The theorem explains the phrase "the effect of $X_2$ holding $X_1$ fixed": a coefficient in a multiple regression is the slope after partialling out the other regressors.
It justifies centring data before a fit with intercept.
In econometrics it justifies removing fixed effects or trends before estimating the coefficients of interest.
It is a purely algebraic fact about projections, so it holds whatever the distribution of the errors.
