Tutorials › Propensity Score Matching and Instrumental Variables › 2SLS Normal Equations and Moment Conditions

Two-Stage Least Squares · Tutorial 483 of 699

2SLS Normal Equations and Moment Conditions

Learn how the number of instruments determines whether 2SLS solves every sample instrument-moment equation or only the projected-residual normal equations.

Advanced 10 min read

What You'll Learn

  • State the 2SLS normal equations using the instrument projection matrix.
  • Derive when those equations are equivalent to zero sample instrument-residual moments.
  • Explain why overidentified 2SLS generally does not set every sample moment to zero.
  • Check the rank conditions needed for a unique 2SLS estimate.
  • Diagnose the difference between exact identification and a failure of instrument relevance.

Why the 2SLS Equations Matter

Two-stage least squares (2SLS) is often introduced through a projection: project the regressors onto the space spanned by the instruments, then use those projected regressors in the estimator. That formula also tells us which sample equations the estimate satisfies. The distinction matters because in an exactly identified model those equations can be written as zero instrument-residual moments, whereas in an overidentified model 2SLS generally sets only particular combinations of those moments to zero.

The statements here are algebraic properties of the 2SLS estimator. They do not establish that an instrument is valid for causal interpretation. Instrument validity and the causal assumptions of instrumental-variable analyses are separate from whether a sample estimator exists and solves its defining equations.

Setup and 2SLS Normal Equations

Let \(y\) be an \(n\times 1\) outcome vector, \(X\) an \(n\times k\) matrix of regressors, and \(Z\) an \(n\times L\) matrix of instruments. The structural linear model is \(y=X\beta+u\), where \(\beta\) is a \(k\times 1\) coefficient vector and \(u\) is the residual vector at a proposed coefficient value. Assume the columns of \(Z\) are linearly independent, so \(Z'Z\) is invertible. Define the projection onto the column space of \(Z\) by \(P_Z=Z(Z'Z)^{-1}Z'\). The estimator discussed here requires \(X'P_ZX\) to be invertible.

When an intercept is part of the structural regression, it is included as a column of \(X\), and the instrument set must include that column as an instrument. Examples below that omit an intercept say so explicitly. The number of instruments is \(L\), while the number of structural regressors is \(k\). Exact identification means \(L=k\); overidentification means \(L>k\).

Definition: The 2SLS estimator is \(\hat{\beta}_{2SLS}=(X'P_ZX)^{-1}X'P_Zy\), when \(X'P_ZX\) is invertible. Its projected-regressor normal equations are \(X'P_Z(y-X\hat{\beta}_{2SLS})=0\). A sample instrument-residual moment is a component of \(Z'(y-X\hat{\beta}_{2SLS})\); dividing this vector by \(n\) gives the corresponding vector of sample moments.

The normal equations follow directly by multiplying the estimator formula by \(X'P_ZX\). Equivalently, 2SLS minimizes the projected-residual quadratic \((y-X\beta)'P_Z(y-X\beta)\). Since \(P_Z\) is symmetric, differentiating this expression with respect to \(\beta\) gives \(-2X'P_Z(y-X\beta)\); setting the derivative to zero yields the stated equations. In the earlier material on the projection-matrix formula for 2SLS, the same projection defines the estimator; here the focus is what its normal equations imply about sample moments.

Exactly Identified Models: All Instrument Moments Are Zero

When \(L=k\), suppose additionally that \(X'Z\) is nonsingular. This is the rank condition that ensures the instruments provide enough independent information about the regressors in this exactly identified setup. The normal equations can be factored as

$$ X'P_Z(y-X\hat{\beta}_{2SLS}) = X'Z(Z'Z)^{-1}Z'(y-X\hat{\beta}_{2SLS}) = 0. $$

Here \(X'Z(Z'Z)^{-1}\) is a square, nonsingular matrix: each factor is square and nonsingular under the stated conditions. Therefore the product can equal zero only if \(Z'(y-X\hat{\beta}_{2SLS})=0\). Thus every sample instrument-residual moment is zero. Conversely, solving these moment equations gives \((Z'X)\hat{\beta}=Z'y\), so \(\hat{\beta}=(Z'X)^{-1}Z'y\). Under the same rank conditions, this solution is the 2SLS estimator.

Worked Example: Solving One Exact-Identification Moment

Consider a hypothetical model with no intercept, one regressor \(x=(1,2,3)'\), one instrument \(z=(1,0,2)'\), and outcome \(y=(2,1,5)'\). There are \(n=3\) observations and one regressor and instrument, so the model is exactly identified. The instrument has nonzero sample association with the regressor: \(z'x=1(1)+0(2)+2(3)=7\).

The scalar moment equation is \(z'(y-x\beta)=0\). Substituting the data gives

$$ z'y-\beta z'x=12-7\beta=0, \qquad \hat{\beta}=\frac{z'y}{z'x}=\frac{12}{7}\approx 1.714. $$

Check the residuals using this estimate: \(y-x\hat{\beta}=(2/7,-17/7,-1/7)'\). The instrument moment is \(z'(y-x\hat{\beta})=1(2/7)+0(-17/7)+2(-1/7)=0\), as required.

The projection formula gives the same answer. Since \(z'z=5\), \(P_Z=zz'/5\), and \(x'P_Zy=(x'z)(z'y)/(z'z)=7(12)/5\), while \(x'P_Zx=(x'z)^2/(z'z)=49/5\). Their ratio is \((84/5)/(49/5)=12/7\). The estimate solves the sample equation; this calculation alone does not establish that the instrument is causally valid.

Overidentified Models: Projected Residuals, Not Every Moment

If \(L>k\), there are more instrument-residual moments than coefficient equations. The 2SLS normal equations remain

$$ X'Z(Z'Z)^{-1}Z'(y-X\hat{\beta}_{2SLS})=0. $$

The left side has \(k\) components, while \(Z'(y-X\hat{\beta}_{2SLS})\) has \(L\) components. In general, 2SLS makes the specified \(k\) combinations zero, not all \(L\) moments individually. The fitted regressors \(P_ZX\) are the columns of \(X\) projected onto the instrument space, and the normal equations say these fitted regressors are orthogonal to the 2SLS residual vector. They do not say that the residual vector is orthogonal to every instrument separately.

A useful equivalent characterization is minimization: 2SLS chooses \(\beta\) to minimize \((y-X\beta)'P_Z(y-X\beta)\). This objective measures the squared length of the residual after projection onto the instrument space. Its first-order conditions are the projected-residual normal equations above. Because there are more instruments than coefficients in an overidentified model, setting every instrument moment to zero would impose more equations than unknown coefficients and usually has no exact solution.

Worked Example: Two Instruments and One Regressor

Take a hypothetical model with no intercept, one regressor \(x=(1,2,1)'\), outcome \(y=(2,1,4)'\), and two instruments \(z_1=(1,0,0)'\) and \(z_2=(0,1,0)'\). The columns of \(Z=(z_1,z_2)\) are linearly independent, and \(L=2>k=1\). Here \(P_Z\) is the diagonal matrix with entries \(1,1,0\), so \(P_Zx=(1,2,0)'\) and \(P_Zy=(2,1,0)'\).

The 2SLS estimate is

$$ \hat{\beta}_{2SLS} = \frac{x'P_Zy}{x'P_Zx} = \frac{1(2)+2(1)+1(0)}{1^2+2^2+1(0)} = \frac{4}{5} = 0.8. $$

The residual is \(y-0.8x=(1.2,-0.6,3.2)'\). Its two instrument moments are \(z_1'u=1.2\) and \(z_2'u=-0.6\), neither of which is zero. But the projected-residual normal equation holds: \(x'P_Zu=1(1.2)+2(-0.6)+1(0)=0\). Equivalently, \(x'Z=(1,2)\) and \(Z'Z\) is the two-dimensional identity matrix, so the required combination of moments is \(1(1.2)+2(-0.6)=0\). This is precisely what 2SLS requires here.

The projected objective at this estimate is \(u'P_Zu=1.2^2+(-0.6)^2=1.8\); the third residual component does not enter because it is outside the instrument space. That does not mean the third observation is discarded from the model. It means the objective evaluates the residual through the stated instrument projection.

Rank Failure and What the Equations Cannot Guarantee

The equation \(X'P_ZX\hat{\beta}=X'P_Zy\) defines a unique estimate only if \(X'P_ZX\) is nonsingular. In an exactly identified model this requires the instruments to be sufficiently related to the regressors. If the rank condition fails, there may be no unique solution even if the instrument columns themselves are linearly independent. Overidentification does not automatically prevent this failure: there still must be enough projected variation in \(X\) to identify all \(k\) coefficients.

Worked Example: A Full-Rank Instrument That Does Not Identify the Regressor

Consider a hypothetical no-intercept model with one regressor \(x=(1,2,3)'\), instrument \(z=(2,-1,0)'\), and outcome \(y=(1,0,2)'\). The instrument is nonzero, but \(z'x=2(1)-1(2)+0(3)=0\); it has no projected variation in common with this regressor.

The exact-identification moment equation would be \(z'(y-x\beta)=z'y-\beta z'x=2-\beta(0)=0\). It has no solution because it reduces to \(2=0\). The projection denominator confirms the problem: \(x'P_Zx=(x'z)^2/(z'z)=0^2/5=0\), so the 2SLS ratio is undefined. This is a rank failure, not evidence that 2SLS has chosen an estimate with a nonzero moment. An instrument being nonzero, or the instrument matrix having full column rank, is not enough; the projected regressors must also have full column rank.

Diagnostics, Comparisons, and a Common Mistake

A practical algebraic check is to calculate the rank of \(Z\), inspect whether \(X'P_ZX\) is nonsingular, and then verify the equations appropriate to the identification status. In exact identification, calculate the full vector \(Z'(y-X\hat{\beta})\); it should be zero apart from numerical rounding. In overidentification, check \(X'P_Z(y-X\hat{\beta})\), or equivalently \((P_ZX)'(y-X\hat{\beta})\); individual entries of \(Z'(y-X\hat{\beta})\) need not vanish.

Ordinary least squares uses the normal equations \(X'(y-X\hat{\beta}_{OLS})=0\). The 2SLS equations instead use \(X'P_Z(y-X\hat{\beta}_{2SLS})=0\). Confusing these equations can lead to incorrect checks or interpretations. In particular, orthogonality to the fitted regressors \(P_ZX\) is not the same as orthogonality to every instrument when there are more instruments than regressors.

Common mistake: “There are several instruments, so 2SLS must make every sample instrument-residual moment zero.” That conclusion incorrectly treats an overidentified system as if it had one independent coefficient equation per instrument. The correction is to check the \(k\) projected-residual normal equations. All \(L\) moments are forced to zero by 2SLS in the exactly identified case under the rank conditions; in the overidentified case, generally only the stated combinations are zero.

These equations describe the sample estimator, not a test of instrument validity. A small or zero sample moment does not by itself prove the assumptions needed for a causal interpretation. Likewise, when the instrument matrix or projected regressors fail the rank conditions, the algebra cannot deliver a unique 2SLS coefficient vector. Diagnostics for weak instruments and statistical inference require additional results beyond these normal equations.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. In an exactly identified model with \(L=k\), which rank condition lets the projected-residual equations imply that all sample instrument-residual moments are zero?
  2. In an overidentified model with \(L>k\), what equations does 2SLS set to zero?
  3. For one regressor \(x=(1,1)'\), outcome \(y=(2,0)'\), and one instrument \(z=(1,2)'\), calculate the exact-identification estimate and verify its instrument moment.
  4. Does a zero sample instrument-residual moment establish that the instrument is valid for causal interpretation? Explain.

Solutions. 1. With full-column-rank \(Z\), the required exact-identification condition is that \(X'Z\) is nonsingular. It makes \(X'Z(Z'Z)^{-1}\) nonsingular, so \(X'P_Zu=0\) implies \(Z'u=0\). 2. It sets \(X'P_Z(y-X\hat{\beta}_{2SLS})=0\), a set of \(k\) equations; generally it does not set all \(L\) components of \(Z'(y-X\hat{\beta}_{2SLS})\) to zero. 3. Here \(z'y=2\), \(z'x=3\), so \(\hat{\beta}=2/3\). The residual is \((4/3,-2/3)'\), and \(z'u=1(4/3)+2(-2/3)=0\). 4. No. The equation is an algebraic property of the sample estimator; it does not prove the causal assumptions required for a valid instrument.

Clinical Biostats