Tutorials › Econometrics (Graduate) › The Frisch–Waugh–Lovell Theorem

Linear Projection and OLS · Tutorial 83 of 952

The Frisch–Waugh–Lovell Theorem

Learn to residualize an outcome and regressor against controls, then use their regression to recover the corresponding multiple-regression coefficient.

Beginner 10 min read

What You'll Learn

  • State the Frisch–Waugh–Lovell theorem for one target regressor and a set of controls.
  • Derive the theorem from the least-squares objective and normal equations.
  • Calculate residualized outcomes and regressors in concrete examples.
  • Identify the rank condition that makes the partial slope well-defined.
  • Recognize why residualizing only one variable does not recover the multiple-regression coefficient.

Why Partialling Out Works

In a multiple regression, a coefficient on one regressor describes its relationship with the outcome after accounting for the other included regressors. The Frisch–Waugh–Lovell theorem gives this statement an exact computational form: first remove the controls from both the outcome and the regressor of interest, then regress one set of residuals on the other.

This is more than a useful calculation shortcut. It shows precisely which variation identifies a coefficient in a linear regression: the variation in the target regressor that cannot be linearly explained by the controls, paired with the corresponding unexplained variation in the outcome. The result is an algebraic identity for ordinary least squares (OLS); it does not require a probability model or a causal interpretation.

Definition: Let \(y\) be an \(n\)-vector of outcomes, \(x\) an \(n\)-vector for the regressor of interest, and \(Z\) an \(n\times k\) matrix of controls. The full OLS regression is \(y\) on \(Z\) and \(x\). Assume \(Z\) has full column rank and \(x\) is not in the column space of \(Z\), so the full design matrix \([Z\ x]\) has full column rank. Define \(P_Z=Z(Z'Z)^{-1}Z'\), the projection matrix onto the columns of \(Z\), and \(M_Z=I-P_Z\). The residualized variables are \(\tilde y=M_Zy\) and \(\tilde x=M_Zx\).

Here, \(P_Zy\) is the fitted value vector from regressing \(y\) on the controls alone, and \(M_Zy=y-P_Zy\) is the residual vector from that regression. The same operation applied to \(x\) gives \(M_Zx\). The full-rank condition ensures that \(Z'Z\) is invertible; the additional condition that \(x\) is not explained exactly by the controls ensures that \(\tilde x'\tilde x>0\).

Theorem: In the full OLS regression of \(y\) on the controls \(Z\) and the target regressor \(x\), the coefficient on \(x\) is $$ \hat\beta=\frac{x'M_Zy}{x'M_Zx} =\frac{\tilde x'\tilde y}{\tilde x'\tilde x}. $$ Thus, \(\hat\beta\) is exactly the OLS slope from regressing the residualized outcome \(\tilde y\) on the residualized regressor \(\tilde x\), with no intercept needed.

If the controls include a constant column, both residual vectors sum to zero. In that case, including an intercept in the regression of \(\tilde y\) on \(\tilde x\) would give an intercept of zero and leave the slope unchanged. The theorem’s central instruction remains: residualize both variables against the same controls.

Deriving the Theorem

Write the full regression as \(y=Z\gamma+x\beta+u\), where \(\gamma\) contains the control coefficients and \(\beta\) is the coefficient of interest. OLS chooses \(\gamma\) and \(\beta\) to minimize the sum of squared residuals. For any fixed value of \(\beta\), fitting the controls to \(y-x\beta\) leaves residual vector \(M_Z(y-x\beta)\). Therefore, after minimizing over the control coefficients, the least-squares objective as a function of \(\beta\) is

$$ Q(\beta)=\{M_Z(y-x\beta)\}'\{M_Z(y-x\beta)\}. $$

The matrix \(M_Z\) is symmetric and idempotent: \(M_Z'=M_Z\) and \(M_Z^2=M_Z\). Using these properties, expand the objective and differentiate with respect to the scalar \(\beta\):

$$ Q(\beta)=(y-x\beta)'M_Z(y-x\beta), \qquad \frac{dQ(\beta)}{d\beta}=-2x'M_Zy+2\beta x'M_Zx. $$

At the least-squares minimum, the derivative is zero. Since \(x'M_Zx=\tilde x'\tilde x>0\), solving gives

$$ \hat\beta=\frac{x'M_Zy}{x'M_Zx} =\frac{(M_Zx)'(M_Zy)}{(M_Zx)'(M_Zx)} =\frac{\tilde x'\tilde y}{\tilde x'\tilde x}. $$

The second equality follows from symmetry and idempotence of \(M_Z\). The final expression is the ordinary least-squares slope through the origin for the residualized outcome and residualized regressor. This completes the derivation and also shows why the rank condition matters: if \(\tilde x=0\), the denominator is zero and the data contain no variation in \(x\) beyond what the controls already explain.

Worked Calculations

Worked Example: One Control and a Different Partial Slope

Hypothetical data. Suppose four observations have a target regressor \(x\), an outcome \(y\), and a control \(z\) as shown. The regression includes a constant as well as \(z\).

Observation\(x\)\(y\)\(z\)
101-1
213-1
3241
4381

First regress \(x\) on the constant and \(z\). The mean of \(x\) is \(1.5\), and \(z'z=4\). Its fitted coefficient on \(z\) is

$$ \frac{z'x}{z'z} =\frac{(-1)(0)+(-1)(1)+(1)(2)+(1)(3)}{4} =\frac{4}{4}=1. $$

Thus the fitted values are \(1.5+z\), and the residualized regressor is \(\tilde x=(-0.5,\,0.5,\,-0.5,\,0.5)'\). Next, the mean of \(y\) is \(4\), and

$$ \frac{z'y}{z'z} =\frac{(-1)(1)+(-1)(3)+(1)(4)+(1)(8)}{4} =\frac{8}{4}=2. $$

The fitted values from regressing \(y\) on the constant and \(z\) are \(4+2z\), so \(\tilde y=(-1,\,1,\,-2,\,2)'\). The partial slope is therefore

$$ \hat\beta =\frac{(-0.5)(-1)+(0.5)(1)+(-0.5)(-2)+(0.5)(2)} {(-0.5)^2+(0.5)^2+(-0.5)^2+(0.5)^2} =\frac{3}{1}=3. $$

By the theorem, \(3\) is the coefficient on \(x\) in the full regression containing the constant and \(z\). It is the slope between the parts of \(x\) and \(y\) not linearly explained by those controls. For comparison, regressing the raw \(y\) values on raw \(x\) values gives slope \(11/5=2.2\), not \(3\); that raw regression does not account for \(z\).

Worked Example: Partialling Out Several Controls

Hypothetical construction. Consider four observations and three control columns: a constant \(\mathbf{1}\), \(z=(1,1,-1,-1)'\), and \(w=(1,-1,1,-1)'\). Let \(q=(1,-1,-1,1)'\), and suppose the data vectors are

$$ x=2\mathbf{1}+z+3w+q=(7,-1,3,-1)', \qquad y=5\mathbf{1}-2z+w+4q=(8,-2,4,10)'. $$

The control vectors are mutually orthogonal: \(\mathbf{1}'z=\mathbf{1}'w=\mathbf{1}'q=0\), \(z'w=0\), \(z'q=0\), and \(w'q=0\). For example, \(z'q=1-1+1-1=0\), while each vector has squared length \(4\). Consequently, projecting \(x\) onto the controls removes \(2\mathbf{1}+z+3w\) and leaves \(\tilde x=q\). Projecting \(y\) onto the same controls removes \(5\mathbf{1}-2z+w\) and leaves \(\tilde y=4q\).

Since \(q'q=4\), the residual regression gives

$$ \hat\beta=\frac{\tilde x'\tilde y}{\tilde x'\tilde x} =\frac{q'(4q)}{q'q} =\frac{4(4)}{4}=4. $$

Therefore, the coefficient on \(x\) in the full regression on \(x\), \(\mathbf{1}\), \(z\), and \(w\) is \(4\). This example also illustrates the rank condition: \(x\) has a nonzero component \(q\) outside the span of the controls, so its coefficient can be estimated.

Worked Example: Residualizing with a Non-Orthogonal Control

Hypothetical data. Suppose \(z=(-2,-1,1,2)'\), \(x=(1,0,2,3)'\), and \(y=(2,1,5,8)'\). Regressing on the controls means including both a constant and \(z\). Here \(z'z=10\). The means are \(\bar{x}=1.5\) and \(\bar{y}=4\), while

$$ z'x=(-2)(1)+(-1)(0)+(1)(2)+(2)(3)=6, \qquad z'y=(-2)(2)+(-1)(1)+(1)(5)+(2)(8)=16. $$

The fitted coefficient on \(z\) is \(6/10=0.6\) for \(x\) and \(16/10=1.6\) for \(y\). Subtracting each control-based fitted value gives

$$ \tilde x=x-1.5\mathbf{1}-0.6z=(0.7,-0.9,-0.1,0.3)', \qquad \tilde y=y-4\mathbf{1}-1.6z=(1.2,-1.4,-0.6,0.8)'. $$

Their inner product and the squared length of \(\tilde x\) are

$$ \tilde x'\tilde y =(0.7)(1.2)+(-0.9)(-1.4)+(-0.1)(-0.6)+(0.3)(0.8)=2.4, $$ $$ \tilde x'\tilde x =(0.7)^2+(-0.9)^2+(-0.1)^2+(0.3)^2=1.4. $$

Thus the coefficient on \(x\) in the full regression is \(2.4/1.4=1.714\) (to four significant figures). The residuals are orthogonal to the constant and \(z\): for example, the entries of \(\tilde x\) sum to zero and \(z'\tilde x=(-2)(0.7)+(-1)(-0.9)+(1)(-0.1)+(2)(0.3)=0\). This verifies directly that the residualization has removed the linear component associated with the controls.

What the Theorem Does—and Does Not—Say

The theorem provides a useful way to understand and compute a coefficient, but its scope is precise. The controls must be the same in both residualizing regressions, and the regressor of interest must have some variation left after the controls are removed. When these conditions hold, the residual regression and the corresponding full-regression coefficient are identical, not merely close.

The same idea extends to a block of target regressors. If \(X\) is an \(n\times r\) matrix and \([Z\ X]\) has full column rank, the full OLS coefficient vector on \(X\) is

$$ \hat\beta=(X'M_ZX)^{-1}X'M_Zy. $$

This is the multivariate counterpart: residualize every column of \(X\) and the outcome against \(Z\), then regress the residualized outcome on the residualized target columns. Invertibility of \(X'M_ZX\) requires that no nonzero linear combination of the target columns is fully explained by the controls.

Finally, FWL is an algebraic statement about OLS, not a claim that the coefficient measures a causal effect. Whether a regression coefficient has a causal interpretation depends on additional design and identification assumptions. The theorem only establishes how the fitted coefficient relates to residualized variables.

Common pitfall: Regressing the raw outcome on a residualized regressor, or residualizing the outcome but not the target regressor, does not in general recover the full-regression coefficient. The correction is to residualize both \(y\) and \(x\) against the same control matrix \(Z\), then use \(\tilde x'\tilde y/\tilde x'\tilde x\).

Check Your Understanding

Use the definitions and result above to check your understanding.

  1. In the theorem, what does \(M_Zy\) represent in terms of a regression on the controls?
  2. Why must \(x'M_Zx\) be positive for the partial slope to be defined?
  3. Suppose a control matrix includes a constant. What is the sum of the entries in each residualized vector?
  4. For the several-controls example, explain why the residualized regressor is \(q\), rather than the original vector \(x\).
  5. What two variables must be residualized to recover the coefficient on \(x\) in the full regression?
Clinical Biostats