Why Partial Out the Included Covariates?
In a 2SLS model, included exogenous covariates belong in both the structural equation and the instrument set. They can explain variation in the outcome and the endogenous regressor, while the excluded instrument supplies the variation used to identify the coefficient of interest. The Frisch–Waugh–Lovell theorem gives a useful way to see this separation: remove the linear contribution of the included covariates from the outcome, endogenous regressor, and excluded instrument, then perform the exactly identified IV calculation on what remains.
This is an algebraic equivalence, not a recommendation to ignore covariates. The covariates are accounted for through residualization. Omitting them from the original analysis is generally a different estimator and may change the identifying assumptions or the estimate.
Model, Notation, and Conditions
Let \(y\) be an \(n\)-vector of outcomes, \(d\) an \(n\)-vector containing one endogenous regressor, \(z\) an \(n\)-vector containing one excluded instrument, and \(W\) an \(n\) by \(k\) matrix of included exogenous covariates. An intercept, when appropriate, is a column of \(W\). Write the linear structural equation as
Here \(\beta\) is the coefficient of interest, \(\gamma\) is a \(k\)-vector of covariate coefficients, and \(u\) is the structural error. For the causal or instrumental-variable interpretation, the covariates must be exogenous and the excluded instrument must satisfy the relevant conditional instrument-exogeneity and exclusion assumptions. A population relevance condition is that \(z\) has nonzero partial association with \(d\) after accounting for \(W\). These assumptions support identification and interpretation; the finite-sample algebra below additionally requires the stated matrices to have full rank.
The residualization is an ordinary least-squares projection on the included covariates, not a regression on the excluded instrument. In particular, \(\tilde z\) is the part of the instrument not linearly explained by \(W\). For the exactly identified case considered here, require \(\tilde z'\tilde d\ne 0\). This sample rank condition makes the residualized IV ratio defined. It is distinct from the population relevance assumption needed for reliable identification in a sample.
Deriving the Partialled-Out 2SLS Coefficient
With one endogenous regressor and one excluded instrument, the model is exactly identified. The sample IV moment equations set the sample inner products of the instruments with the structural residual to zero. The instrument set is \([W,z]\), so these equations are
The first equation solves for the covariate coefficients conditional on \(\beta\):
Substitute this expression into the second moment equation. The residual after fitting \(W\) to \(y-d\beta\) is \(M_W(y-d\beta)\), so
Because \(M_W\) is symmetric, \(z'M_W=\tilde z'\). Also \(M_Wy=\tilde y\) and \(M_Wd=\tilde d\). Therefore the equation becomes \(\tilde z'(\tilde y-\beta\tilde d)=0\), which yields the coefficient:
This is precisely the exactly identified IV ratio computed from the three residualized variables. The result is a special case of the Frisch–Waugh–Lovell theorem: the coefficient on \(d\) in the 2SLS model with included covariates is the same as the coefficient obtained after partialling \(W\) out of \(y\), \(d\), and \(z\). The covariate coefficients themselves are recovered from the first moment equation after estimating \(\beta\).
Worked Calculations
Worked Example: Computing the Adjusted IV Ratio
Suppose four hypothetical observations have an intercept and a binary covariate \(x\) in \(W\), with \(x=(0,0,1,1)'\). The observed instrument, endogenous regressor, and outcome are \(z=(5,3,7,5)'\), \(d=(11,9,22,18)'\), and \(y=(20,16,27,21)'\). Residualize each variable by subtracting its mean within the two \(x\) groups.
For \(z\), the group means are \(4\) and \(6\), giving \(\tilde z=(1,-1,1,-1)'\). For \(d\), the group means are \(10\) and \(20\), giving \(\tilde d=(1,-1,2,-2)'\). For \(y\), the group means are \(18\) and \(24\), giving \(\tilde y=(2,-2,3,-3)'\). Each pair of residuals sums to zero, so all three residual vectors are orthogonal to the intercept and to \(x\).
The adjusted numerator and denominator are
Thus \(\hat\beta_{\mathrm{2SLS}}=10/6=1.667\). In this hypothetical example, the estimated outcome difference associated with a one-unit increase in \(d\), under the linear IV model, is 1.667 outcome units. The calculation accounts for the intercept and \(x\) by using only variation left after their linear contributions are removed.
Worked Example: Adding a Covariate Component Does Not Change the Partialled Estimate
Keep \(W,z,d\) as in the previous example, but consider a second hypothetical outcome \(y_2=(19,15,28,22)'\). The outcome means within the \(x=0\) and \(x=1\) groups are \(17\) and \(25\), so the actual projection residual is \(\tilde y_2=(2,-2,3,-3)'\).
The residual is orthogonal to both columns of \(W\): its entries sum to zero, and its entries in each \(x\) group sum to zero. Hence \(W'\tilde y_2=0\), as required for residuals from projection on an intercept and \(x\). Using the same residualized \(z\) and \(d\) as before,
Here \(y_2-y=(-1,-1,1,1)'=-\mathbf{1}+2x\), which is a linear combination of columns of \(W\). Adding that component changes the covariate fit but leaves \(M_Wy\) unchanged, and therefore leaves this partialled-out coefficient unchanged. This invariance is exactly what the residualized calculation should produce.
Worked Example: Detecting an Instrument With No Residual Variation
Suppose the included covariates are an intercept and \(x=(0,0,1,1)'\), and the excluded instrument is \(z=(0,0,1,1)'=x\). Projection of \(z\) on \(W\) reproduces \(z\) exactly, so \(\tilde z=M_Wz=0\).
Consequently, for any residualized outcome and regressor, \(\tilde z'\tilde y=0\) and \(\tilde z'\tilde d=0\). The ratio is \(0/0\), not an estimate of zero: the instrument supplies no variation beyond the included covariates and cannot identify \(\beta\) in this model. This failure is detected directly by checking whether the residualized instrument has nonzero variation and whether \(\tilde z'\tilde d\) is nonzero.
Practical Procedure and Diagnostics
The equality gives a transparent computational route when there is one excluded instrument and one endogenous regressor. Each residualization must use the same included-covariate matrix \(W\); otherwise the resulting ratio does not represent the stated model.
Form \(W\) with every included exogenous variable and an intercept when the model calls for one. Check that its columns are linearly independent.
Compute \(\tilde y=M_Wy\), \(\tilde d=M_Wd\), and \(\tilde z=M_Wz\), using the same \(W\) for each.
Verify that \(W'\tilde y\), \(W'\tilde d\), and \(W'\tilde z\) are zero up to numerical precision, and check that \(\tilde z'\tilde d\ne0\).
Compute \(\tilde z'\tilde y/\tilde z'\tilde d\). Interpret it as the coefficient on \(d\) in the specified IV model, subject to its identifying assumptions.
Diagnostics distinguish algebraic mistakes from substantive problems. If the residuals are not orthogonal to \(W\), a projection was calculated incorrectly or the variables were not residualized on the same controls. If \(\tilde z\) is zero, the excluded instrument is redundant given \(W\). If \(\tilde z'\tilde d\) is close to zero, the sample denominator is small; the ratio can then be highly sensitive to small changes in the data. A nonzero denominator alone does not establish strong relevance, instrument exogeneity, exclusion, or a causal interpretation.
How This Relates to Other Calculations
| Calculation | What it does | Relationship to partialled-out 2SLS |
|---|---|---|
| 2SLS including \(W\) | Uses \(W\) and \(z\) as instruments for the included regressors. | Produces the same coefficient on \(d\) in the exactly identified setup. |
| Residualized IV ratio | Uses \(\tilde y,\tilde d,\tilde z\) after projection on \(W\). | Is the Frisch–Waugh–Lovell form of that coefficient. |
| IV calculation omitting \(W\) | Uses unadjusted variables rather than removing their linear covariate components. | Is generally a different calculation and need not estimate the same coefficient. |
| OLS of \(\tilde y\) on \(\tilde d\) | Regresses the partialled outcome directly on the partialled endogenous regressor. | Does not use the excluded instrument and is not generally the IV estimate. |
The central pitfall is to residualize only the outcome and the endogenous regressor, then treat their regression slope as 2SLS. The excluded instrument must also be residualized on \(W\), and it must still satisfy the IV assumptions. Another error is to include the covariates in the structural equation but omit them from the instrument set; included exogenous regressors serve as their own instruments in the standard 2SLS setup.
The formula here is for one endogenous regressor and one excluded instrument. With multiple excluded instruments, the scalar ratio is not the general 2SLS formula; the residualized variables still clarify the role of \(W\), but the estimator requires a matrix expression. Also, partialling out is a linear-projection result. It does not establish that a chosen functional form for the covariates is adequate, repair a weak instrument, or remove unmeasured confounding by itself.
Check Your Understanding
Try each question, then compare with the brief solutions.
- What matrix removes the linear projection on \(W\), and what orthogonality property should each residualized vector satisfy?
- Why must the excluded instrument be residualized on the included covariates as well as the outcome and endogenous regressor?
- If \(\tilde z'\tilde d=0\), what does this imply for the residualized IV ratio?
- Does partialling out \(W\) make an invalid instrument valid? Explain.
- How does the residualized IV ratio differ from OLS of \(\tilde y\) on \(\tilde d\)?
Solutions. (1) The residual-maker is \(M_W=I-W(W'W)^{-1}W'\); each residual satisfies \(W'\tilde a=0\). (2) The instrument variation used for identification must be the variation beyond \(W\), so the moment equation becomes \(\tilde z'(\tilde y-\beta\tilde d)=0\). (3) The ratio is undefined, and the sample moment equation does not identify the coefficient. (4) No. Residualization establishes an algebraic adjustment for \(W\); instrument validity still requires the substantive IV assumptions. (5) OLS does not use \(\tilde z\) and therefore is generally not the IV estimator when \(d\) is endogenous.