Why Decompose the Endogenous Regressor?
When a regressor is endogenous, part of its variation may be related to unobserved determinants of the outcome. An instrument can provide a source of variation in that regressor that is orthogonal to the structural error. A linear control function makes this distinction explicit: it writes the endogenous regressor as a fitted component driven by observed exogenous variables and instruments, plus a residual component.
Under an additional conditional-mean assumption, the first-stage residual summarizes the part of the structural error associated with the endogenous regressor. Including that residual in the structural equation then leaves the coefficient on the regressor equal to the structural coefficient. The decomposition alone does not guarantee this result; the conditional-mean restriction and instrument assumptions are essential.
Model and Linear First-Stage Decomposition
Let \(y_i\) be an outcome, \(x_i\) a scalar endogenous regressor, \(W_i\) a vector of included exogenous regressors (including an intercept if required), and \(Z_i\) a vector of excluded instruments. Consider the linear structural equation
Here \(\beta\) is the structural coefficient of interest and \(u_i\) is the structural error. The instrument assumptions require that the excluded instruments be relevant for \(x_i\), conditional on \(W_i\), and valid: they have no direct effect on \(y_i\) in this structural equation and are orthogonal to \(u_i\), conditional on \(W_i\). In particular, the validity condition can be written \(E[u_i\mid W_i,Z_i]=0\). These assumptions, together with an appropriate rank condition, identify \(\beta\) by instrumental variables.
For the linear control-function representation, assume the first-stage conditional mean is correctly specified as
Define the first-stage residual \(v_i\) as the difference between \(x_i\) and this conditional mean. Thus the decomposition is \(x_i=W_i'\pi+Z_i'\delta+v_i\), with \(E[v_i\mid W_i,Z_i]=0\). In sample work, the fitted value and residual are estimated by regressing \(x_i\) on \(W_i\) and \(Z_i\). If the conditional mean is not linear, ordinary least squares still creates a linear projection residual, but that residual need not have conditional mean zero given \(W_i,Z_i\).
This restriction is substantive. It does not follow merely from \(x_i\) being endogenous or from the first-stage regression being linear. It specifies how the structural error depends conditionally on the unobserved component of \(x_i\). With it, write \(u_i=\rho v_i+\varepsilon_i\), where \(E[\varepsilon_i\mid W_i,Z_i,v_i]=0\). Substitution into the structural equation gives the control-function representation:
The coefficient on \(v_i\) accounts for the conditional dependence between the structural error and the endogenous regressor. The coefficient on \(x_i\) remains \(\beta\), provided the displayed conditional-mean model is correct and the regressors in the resulting equation have sufficient independent variation to identify their coefficients.
Worked Example: Calculating a First-Stage Residual
Suppose a hypothetical sample has four observations of an endogenous regressor \(x_i\) and instrument \(z_i\), with no additional included regressors beyond the intercept.
| Observation | \(z_i\) | \(x_i\) |
|---|---|---|
| 1 | 0 | 5 |
| 2 | 1 | 5 |
| 3 | 2 | 7 |
| 4 | 3 | 11 |
The sample means are \(\bar z=1.5\) and \(\bar x=7\). The least-squares slope in the first stage is
The intercept is \(\hat\pi=\bar x-\hat\delta\bar z=7-2(1.5)=4\). Therefore the fitted value is \(\hat x_i=4+2z_i\), and the residual is \(\hat v_i=x_i-\hat x_i\).
| Observation | \(\hat x_i=4+2z_i\) | \(\hat v_i=x_i-\hat x_i\) |
|---|---|---|
| 1 | 4 | 1 |
| 2 | 6 | -1 |
| 3 | 8 | -1 |
| 4 | 10 | 1 |
The residuals sum to zero, and their products with the centered instrument sum to \((-1.5)(1)+(-0.5)(-1)+(0.5)(-1)+(1.5)(1)=0\). These are the sample orthogonality properties of least-squares residuals relative to the first-stage regressors. They are not, by themselves, proof that the population conditional-mean or control-function assumptions hold.
Why Residual Inclusion Recovers the Structural Coefficient
Under the stated control-function restriction, the conditional mean of \(y_i\), given \(W_i,Z_i,v_i\), is \(W_i'\gamma+\beta x_i+\rho v_i\). Thus, in the correctly specified linear conditional-mean regression of \(y_i\) on \(W_i,x_i,v_i\), the coefficient on \(x_i\) is \(\beta\). This is a conditional-mean result, not a claim that \(v_i\) is independent of the structural error: in general, the residual is precisely included because it is related to that error.
The relationship to instrumental variables can also be seen through the instrument moment. Let \(\widetilde Z_i\) denote the part of the instrument vector left after linearly projecting it on \(W_i\). The IV exclusion and exogeneity conditions imply \(E[\widetilde Z_i u_i]=0\). Since \(u_i=\rho v_i+\varepsilon_i\), the control-function representation is consistent with that moment: the first-stage conditional-mean assumption gives \(E[\widetilde Z_i v_i]=0\), and the conditional-mean restriction gives \(E[\widetilde Z_i\varepsilon_i]=0\). Hence
in the just-identified scalar case when the denominator is nonzero. With multiple instruments, the corresponding population moment conditions identify the scalar coefficient when the rank condition holds. The linear control-function regression and IV identification are connected, but they rest on distinct statements: IV uses instrument moments, while residual inclusion additionally imposes a model for the conditional mean of \(u_i\) given \(v_i\).
Finite-Sample Algebra and the 2SLS Coefficient
There is a useful finite-sample identity in the standard linear model with one endogenous regressor. Let \(Q\) be the matrix containing the included exogenous regressors and all instruments. Let \(\hat x=P_Qx\) be the first-stage fitted-value vector, where \(P_Q\) is the projection matrix onto the columns of \(Q\), and let \(\hat v=x-\hat x\). Least-squares geometry gives \(Q'\hat v=0\), so \(\hat v\) is orthogonal to the included regressors and to \(\hat x\).
Because \(x=\hat x+\hat v\), the regressor sets \((W,x,\hat v)\) and \((W,\hat x,\hat v)\) span the same space. Replacing \(x\) with \(\hat x+\hat v\) in a regression that already includes \(\hat v\) leaves the coefficient on \(x\) equal to the coefficient on \(\hat x\). Moreover, since \(\hat v\) is orthogonal to \(W\) and \(\hat x\), adding it to a regression of \(y\) on \(W,\hat x\) does not change the coefficient on \(\hat x\). The latter coefficient is the standard 2SLS coefficient for one endogenous regressor. Consequently, the coefficient on \(x\) in the regression of \(y\) on \(W,x,\hat v\) equals the 2SLS coefficient, when the same sample and first-stage instruments are used and the required design matrices have full rank.
Worked Example: Verifying the Coefficient Algebraically
Consider a hypothetical sample with an intercept and instrument values \(z=(-1,-1,1,1)\). Suppose the first-stage fitted values are \(\hat x=(2,2,4,4)\), so that \(\hat x=3+z\), and the first-stage residuals are \(\hat v=(1,-1,1,-1)\). The observed endogenous regressor is \(x=\hat x+\hat v=(3,1,5,3)\). Let the outcome values be generated by \(y_i=2+3x_i+1.5\hat v_i+e_i\), with \(e=(1,-1,-1,1)\). Substitution gives \(y=(13.5,2.5,17.5,10.5)\).
The residual vector is orthogonal to the intercept and instrument: its entries sum to zero and its inner product with \(z\) is \(-1+1+1-1=0\). It is also orthogonal to the fitted values, whose centered vector is \((-1,-1,1,1)\). The specified \(e\) is orthogonal to the intercept, \(\hat x\), and \(\hat v\), so the regression of \(y\) on an intercept, \(x\), and \(\hat v\) has the exact representation \(y=2+3x+1.5\hat v+e\). Its coefficient on \(x\) is therefore \(3\).
The corresponding 2SLS coefficient can be calculated by regressing \(y\) on the intercept and \(\hat x\). Here \(\bar{\hat x}=3\), \(\bar y=11\), and the centered fitted values are \((-1,-1,1,1)\). Thus the slope is
Both calculations give \(3\), as the finite-sample identity predicts. This equality is an algebraic feature of the linear setup; it does not establish that the instruments are valid or that the control-function conditional-mean restriction is true.
Worked Population Illustration
The assumptions behind the result can be made concrete with a simple population example. Suppose there is an intercept but no other controls, \(E[Z_i]=0\), and the data satisfy \(x_i=2+0.8Z_i+v_i\), with \(E[v_i\mid Z_i]=0\). Let \(E[Z_i^2]=1\), and suppose the structural equation is \(y_i=1+2.5x_i+u_i\), where \(u_i=1.5v_i+\varepsilon_i\) and \(E[\varepsilon_i\mid Z_i,v_i]=0\). This example assumes both a valid instrument and the linear control-function restriction.
The first-stage residual is \(v_i\). Instrument relevance holds because \(E[Z_ix_i]=0.8E[Z_i^2]=0.8\), which is nonzero. For the IV ratio, \(E[Z_iu_i]=1.5E[Z_iv_i]+E[Z_i\varepsilon_i]=0\), using the stated conditional-mean assumptions. Therefore
Residual inclusion reaches the same structural coefficient from the conditional-mean equation:
The coefficient \(1.5\) on the residual represents the conditional relationship between the structural error and the endogenous component of \(x_i\). It does not replace the instrument assumptions: without instrument relevance, the variation in \(x_i\) attributable to \(Z_i\) would not identify the structural coefficient by IV.
Assumptions, Scope, and Common Pitfalls
The linear control-function representation is useful because it explains, in a compact form, why a first-stage residual can control for endogeneity in a linear structural equation. Its validity depends on several conditions working together:
- Correct first-stage conditional mean. The fitted component must represent \(E[x_i\mid W_i,Z_i]\), not merely an arbitrary linear approximation when the conditional mean is nonlinear.
- A valid control-function restriction. The conditional mean of \(u_i\), given \(W_i,Z_i,v_i\), must be representable by \(\rho v_i\) in the stated model. A more complicated dependence may require a different specification.
- Instrument validity and relevance. The excluded instruments must satisfy the relevant exogeneity and exclusion conditions, and must predict \(x_i\) after accounting for \(W_i\).
- Identification in the included regression. The regressors \(W_i,x_i,v_i\) must not be perfectly collinear. Otherwise their separate coefficients cannot be determined.
A frequent mistake is to argue that adding any first-stage residual automatically removes endogeneity. The residual from an ordinary least-squares projection is orthogonal in sample to the regressors used in that projection, but sample orthogonality is not a proof of instrument validity, a correct conditional mean, or the required structural-error decomposition. The correction is to state those assumptions first and then use the residual-inclusion result only under them.
Another mistake is to interpret the algebraic equality with 2SLS as meaning that every aspect of the two analyses is interchangeable. The coefficient identity applies to the specified linear setup. It does not establish the assumptions, and it does not make conventional OLS standard errors from the residual-inclusion regression automatically appropriate for inference about the IV procedure. Nor does this scalar linear result establish a control-function representation for nonlinear outcomes or for multiple endogenous regressors; those settings require additional modeling.
Check Your Understanding
Answer each question by referring to the assumptions and algebra in the tutorial.
- Why does a linear projection residual not necessarily have conditional mean zero given the instruments?
- State the conditional-mean restriction on the structural error that justifies including one first-stage residual.
- In a just-identified model, which instrument moment ensures that the IV ratio has no contribution from the structural error?
- Why does the coefficient identity between residual inclusion and 2SLS require using the same first-stage regressors?
- Does the algebraic equality of the two coefficients demonstrate that the instruments are valid? Explain.