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.
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\).
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
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\):
At the least-squares minimum, the derivative is zero. Since \(x'M_Zx=\tilde x'\tilde x>0\), solving gives
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\) |
|---|---|---|---|
| 1 | 0 | 1 | -1 |
| 2 | 1 | 3 | -1 |
| 3 | 2 | 4 | 1 |
| 4 | 3 | 8 | 1 |
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
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
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
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
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
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
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
Their inner product and the squared length of \(\tilde x\) are
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
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.
Check Your Understanding
Use the definitions and result above to check your understanding.
- In the theorem, what does \(M_Zy\) represent in terms of a regression on the controls?
- Why must \(x'M_Zx\) be positive for the partial slope to be defined?
- Suppose a control matrix includes a constant. What is the sum of the entries in each residualized vector?
- For the several-controls example, explain why the residualized regressor is \(q\), rather than the original vector \(x\).
- What two variables must be residualized to recover the coefficient on \(x\) in the full regression?