Tutorials › Propensity Score Matching and Instrumental Variables › Scale and Coding Invariance in 2SLS

Two-Stage Least Squares · Tutorial 503 of 699

Scale and Coding Invariance in 2SLS

You will use projection matrices to establish 2SLS invariance under equivalent instrument codings, and identify when a recoding instead changes the model.

Advanced 10 min read

What You'll Learn

  • Express 2SLS estimates and first-stage fitted values using the instrument-space projection matrix.
  • Prove invariance under any nonsingular linear transformation of the instrument columns.
  • Check why reversing a binary instrument’s coding preserves results when an intercept is included.
  • Identify recodings, omitted regressors, and unit changes that alter the model or coefficient scale.
  • Diagnose apparent failures of invariance caused by rank problems, numerical precision, or inconsistent specifications.
  • Distinguish changes in instrument coordinates from changes in the instrument span.

Why Instrument Coding Can Matter Less Than It Looks

An instrument may be recorded in different units or represented by a different set of columns without changing the information it supplies to two-stage least squares (2SLS). For example, measuring an instrument in tens rather than single units changes its numerical values, but need not change the linear combinations of observations that the instruments can generate. The key object is therefore not the particular columns used to write the instruments, but their column space.

This invariance is exact algebra, not an approximation or a large-sample result. It holds when the transformation preserves the instrument space and the 2SLS estimator is defined. It does not mean that every recoding is harmless: centering an instrument, dropping a constant, or changing which variables are included can change that space and hence the fitted values and estimates.

2SLS as Projection onto the Instrument Space

Let \(y\) be an \(n\)-vector of outcomes, \(X\) an \(n \times k\) matrix of regressors in the structural equation, and \(Z\) an \(n \times L\) matrix of instruments. The columns of \(X\) include the regressors whose coefficients are estimated; the columns of \(Z\) include the instruments, including included exogenous regressors where appropriate. Write the structural model as \(y=X\beta+u\).

For the usual full-column-rank formula, assume \(Z\) has full column rank and \(X'P_ZX\) is nonsingular, where \(P_Z\) projects onto the column space of \(Z\). The population interpretation also requires instrument exogeneity, such as \(E[Z_i u_i]=0\), and a relevance or rank condition sufficient to identify \(\beta\). These conditions support the IV interpretation; the finite-sample invariance result below follows from the matrix formula itself.

Definition: The instrument projection matrix and the 2SLS estimator are $$ P_Z=Z(Z'Z)^{-1}Z', \qquad \hat{X}=P_ZX, \qquad \hat{\beta}_{2SLS}=(X'P_ZX)^{-1}X'P_Zy. $$ The columns of \(\hat{X}\) are the first-stage fitted values for the columns of \(X\), obtained by projecting each regressor onto the instrument space.

The expression for the estimator also equals \((\hat{X}'\hat{X})^{-1}\hat{X}'y\), provided the required inverse exists. This is because \(P_Z\) is symmetric and idempotent, so \(P_Z'=P_Z\) and \(P_ZP_Z=P_Z\). Thus, both the fitted regressors and the projection that defines them are central to the invariance question.

The Invariance Result

Suppose a new instrument matrix is formed by taking nonsingular linear combinations of the old instrument columns: \(Z^*=ZA\), where \(A\) is an \(L \times L\) nonsingular matrix. This includes multiplying an instrument by a nonzero constant, changing its sign, reordering columns, and adding multiples of one instrument column to another.

Theorem: If \(Z^*=ZA\) for a nonsingular matrix \(A\), then \(P_{Z^*}=P_Z\). Consequently, \(\hat{X}\) and \(\hat{\beta}_{2SLS}\) are unchanged, provided \(X\) and \(y\) are unchanged and the 2SLS estimator exists.

To verify the result, substitute \(Z^*=ZA\) into its projection matrix. Since \(A\) is nonsingular, the inverse of \(A'Z'ZA\) is \(A^{-1}(Z'Z)^{-1}(A')^{-1}\). Therefore:

$$ \begin{aligned} P_{Z^*} &=ZA\left(A'Z'ZA\right)^{-1}A'Z'\\ &=ZA\left[A^{-1}(Z'Z)^{-1}(A')^{-1}\right]A'Z'\\ &=Z(Z'Z)^{-1}Z'\\ &=P_Z. \end{aligned} $$

It follows directly that \(\hat{X}^*=P_{Z^*}X=P_ZX=\hat{X}\), and substituting the same projection into the 2SLS formula gives \(\hat{\beta}_{2SLS}^*=\hat{\beta}_{2SLS}\). More generally, two full-rank instrument matrices with the same column space have the same projection, even if they are not written as the same number of columns. A change in column labels or coordinates is harmless precisely when the space is unchanged.

Worked Example: Rescaling and Shifting an Instrument with an Intercept

Consider a hypothetical sample with one structural regressor \(x=(1,2,2)'\), outcome \(y=(2,1,4)'\), and instruments consisting of an intercept and \(z=(0,1,2)'\). Compare these instruments with an intercept and \(z^*=10z+5\). The second instrument is measured on a different scale and shifted.

The original instrument space is spanned by \(\mathbf{1}=(1,1,1)'\) and \(z\). The recoded columns are \(\mathbf{1}\) and \(5\mathbf{1}+10z\). Since the coefficient of \(z\) is nonzero, these two pairs span the same space. In matrix form, \(Z^*=ZA\) for a nonsingular \(A\), so the projection and 2SLS estimate must be unchanged.

The projection can also be calculated directly. A vector orthogonal to both \(\mathbf{1}\) and \(z\) is \(q=(1,-2,1)'\). Here \(q'q=6\), so the projection of any vector \(v\) onto the instrument space is \(v-q(q'v)/6\). For \(x\), \(q'x=1-4+2=-1\), giving \( \hat{x}=x-q(-1/6)=(7/6,5/3,13/6)' \). For \(y\), \(q'y=2-2+4=4\), giving \( \hat{y}=y-q(4/6)=(4/3,7/3,10/3)' \).

The just-identified 2SLS coefficient is \( \hat{\beta}_{2SLS}=\hat{x}'y/(\hat{x}'x) \). Substitution gives \( \hat{x}'y=7/3+5/3+26/3=38/3 \) and \( \hat{x}'x=7/6+20/6+26/6=53/6 \). Thus \( \hat{\beta}_{2SLS}=(38/3)/(53/6)=76/53\approx1.434 \). Using \(z^*\) gives the same fitted values and coefficient because its instrument space is unchanged.

Binary Recoding and the Role of an Intercept

A common coding change replaces a binary instrument recorded as 0 and 1 with a reversed code recorded as 1 and 0. Algebraically, the new column is \(z^*=\mathbf{1}-z\). If an intercept is included among the instruments, then both \(z\) and \(\mathbf{1}-z\) lie in the span of the intercept and the other coding; the two instrument spaces are equal. Without an intercept, that conclusion does not generally follow.

Worked Example: Reversing a Binary Instrument

In a hypothetical four-observation sample, let \(z=(0,0,1,1)'\), \(x=(1,2,4,5)'\), and \(y=(2,3,6,7)'\). Use an intercept and \(z\) as instruments for the single structural regressor \(x\). Reverse the coding to \(z^*=(1,1,0,0)'\), retaining the intercept.

The original projection replaces each observation with the mean of its instrument group. The fitted regressor is \(\hat{x}=(1.5,1.5,4.5,4.5)'\), and the fitted outcome is \(\hat{y}=(2.5,2.5,6.5,6.5)'\). Reversing the labels swaps the names of the two groups but leaves these fitted values attached to the same observations.

The estimate is \( \hat{\beta}_{2SLS}=\hat{x}'y/(\hat{x}'x) \). The numerator is \(1.5(2+3)+4.5(6+7)=7.5+58.5=66\); the denominator is \(1.5(1+2)+4.5(4+5)=4.5+40.5=45\). Hence \(\hat{\beta}_{2SLS}=66/45=22/15\approx1.467\) units of outcome per unit of \(x\). The reversed coding gives the same answer because the intercept and binary instrument span the same space before and after recoding.

When a Recoding Changes the Model

Shifting an instrument by a constant is not always harmless. It preserves the instrument space when an intercept is already in that space, but without an intercept a shift generally adds a direction that was not available before and removes the original one-column span. The next calculation shows the resulting change in the estimate.

Worked Example: Centering Without an Intercept Changes the Estimate

Use the hypothetical \(x=(1,2,2)'\) and \(y=(2,1,4)'\) from the earlier calculation, but now specify a model with no intercept and a single instrument \(z=(1,2,3)'\). Compare it with the centered instrument \(z_c=z-\bar{z}\mathbf{1}=(-1,0,1)'\). Since the model has no intercept instrument, these two single-column instrument spaces are different.

With one instrument and one structural regressor, \(P_zx=z(z'x)/(z'z)\), and simplifying the 2SLS ratio gives \(\hat{\beta}_{2SLS}=(z'y)/(z'x)\), provided \(z'x\ne0\). For the original instrument, \(z'x=1+4+6=11\) and \(z'y=2+2+12=16\), so \(\hat{\beta}_{2SLS}=16/11\approx1.455\).

For the centered instrument, \(z_c'x=-1+0+2=1\) and \(z_c'y=-2+0+4=2\). Thus the estimate becomes \(2/1=2.000\). This difference is not a failure of invariance: the centering was not a nonsingular transformation of the one-column instrument matrix. If an intercept had been included in both specifications, \(z\) and \(z_c\) would instead span the same space together with that intercept.

Coordinate Changes Versus Specification Changes

It is useful to keep separate the columns used to represent the instruments, the instrument space, and the structural regressors. A transformation of instrument coordinates can preserve the first-stage fitted values exactly. Altering the structural regressors is a different matter: it changes the coefficient parameterization or the structural model.

ChangeWhat happens to the instrument space?Typical consequence
Multiply one instrument column by a nonzero constantUnchangedSame 2SLS fitted values and coefficients
Reverse 0/1 coding with an included interceptUnchangedSame 2SLS fitted values and coefficients
Center an instrument with an included interceptUnchangedSame 2SLS fitted values and coefficients
Center an instrument without an interceptGenerally changedFitted values and estimates may change
Change units of a structural regressorMay be unchanged, but \(X\) is rescaledCoefficient changes to reflect the new units
Drop an instrument or add a genuinely new instrumentGenerally changed2SLS estimate may change

For example, if one structural regressor is changed from \(x\) to \(x^*=100x\), while the model otherwise represents the same fitted structural values, its coefficient becomes \(\hat{\beta}^*=\hat{\beta}/100\). This is a change of units, not instrument-coding invariance. With several regressors, an invertible reparameterization \(X^*=XC\) changes the coefficient coordinates to \(C^{-1}\hat{\beta}\); it does not generally leave the numerical coefficient vector unchanged.

Ordinary least squares and 2SLS also answer different estimation problems. OLS projects onto the span of \(X\), whereas 2SLS uses the projection onto the instrument space to form fitted regressors. Rewriting the same instruments in new coordinates does not change the 2SLS projection; replacing the instrument space with a different one can. This comparison concerns the estimator’s defining projections, not whether either set of assumptions is credible in a particular application.

Diagnostics, Limitations, and Common Mistakes

A practical invariance check is to compare the column spaces, not just to compare whether variables seem to carry similar labels. After recoding, verify that the same intercept and included exogenous variables remain, that the transformation among instrument columns is nonsingular, and that the same observations and weights are used. When the transformation is meant to preserve the instrument space, the first-stage fitted values should agree up to numerical precision.

If results differ unexpectedly, check whether the new coding actually preserves the space, whether a constant or other instrument was omitted, whether a column became redundant, and whether software silently dropped a collinear column or changed the sample. Nearly collinear instruments can also create numerical instability: theoretically equivalent calculations may differ slightly because of floating-point arithmetic. Such discrepancies warrant checking matrix rank and numerical conditioning; they do not establish that the coding changed the underlying estimator.

  • Mistake: “Multiplying an instrument by 10 makes it ten times stronger.” The raw first-stage coefficient changes units, but rescaling alone does not change the instrument space or fitted values.
  • Mistake: “Any recoding of a binary instrument is harmless.” Reversing 0/1 codes preserves the space with an intercept, but an intercept cannot be assumed if it is absent from the specified instrument matrix.
  • Mistake: “If the estimate changed, the software must be wrong.” A changed estimate may correctly reflect a different instrument space, sample, structural regressor, or weighting scheme.
  • Mistake: “The coefficient must stay the same when the regressor’s units change.” A coefficient is expressed per unit of its regressor; changing that unit changes its numerical value.

The invariance claim is limited to equivalent representations of the same instrument space with the same outcome, structural regressors, observations, and estimation criterion. It does not establish instrument relevance, exogeneity, or identification, and it does not make a different instrument set equivalent merely because its columns are correlated with the old ones. Valid 2SLS interpretation still depends on the substantive assumptions for the model.

Key takeaway: 2SLS depends on the instrument projection \(P_Z\). Any nonsingular recoding of the instrument columns preserves that projection and therefore preserves first-stage fitted values and 2SLS coefficients. A change that alters the instrument space—or changes the structural regressors or units—need not preserve the numerical result.

Check Your Understanding

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

  1. An instrument column is multiplied by \(-3\), with all other model components unchanged. Does the 2SLS coefficient change? Explain.
  2. A binary instrument \(z\) is replaced by \(1-z\). What additional condition on the instrument set guarantees that this recoding preserves the instrument space?
  3. In a model with no intercept, why might replacing \(z\) by \(z-\bar{z}\) change the 2SLS estimate?
  4. A structural regressor is changed from dollars to cents. Should its numerical 2SLS coefficient remain the same? Explain the coefficient’s unit conversion.
  5. A program reports different fitted regressors after an instrument is rescaled, even though no other input was changed. Name two checks that could help locate the problem.

Solutions. (1) No. Multiplication by a nonzero constant is a nonsingular transformation of the instrument columns, so the instrument projection and fitted regressors are unchanged. (2) Include an intercept in the instrument space, since \(1-z\) is then a linear combination of the intercept and \(z\), and conversely. (3) Without an intercept, centering generally replaces the one-column span of \(z\) with a different span, changing the projection used by 2SLS. (4) No. One dollar equals 100 cents, so the coefficient per cent is one hundredth of the coefficient per dollar, with other parts of the model held fixed. (5) Check whether the same sample, intercept, and other instruments were used; also check for collinearity handling, rank changes, or numerical instability.

Clinical Biostats