Tutorials › Causal Inference › Common Specification Errors in 2SLS

Linear IV Estimation · Tutorial 535 of 972

Common Specification Errors in 2SLS

Check the instrument set, sample, and causal interpretation before treating a 2SLS result as the effect you intend to estimate.

Intermediate 10 min read

What You'll Learn

  • State the linear IV model and the role of included exogenous covariates.
  • Check why included exogenous regressors belong in the instrument set.
  • Explain why every 2SLS stage must use the same complete-case sample.
  • Distinguish a 2SLS coefficient from an unrestricted population average treatment effect.
  • Diagnose these specification errors with rank, projection, and effect-heterogeneity calculations.

Why Small Specification Choices Matter

Two-stage least squares (2SLS) can be implemented with a few lines of software or by manually running two regressions. That convenience makes it easy to overlook what the calculation requires: the same model variables and observations must be used throughout, and the fitted treatment must be constructed from the complete instrument set. Even a correctly computed coefficient can also be described too broadly if treatment effects vary.

Let \(Y\) be an outcome, \(D\) an endogenous treatment, \(X\) a vector of included exogenous covariates, and \(Z\) a vector of excluded instruments. A standard linear structural equation is \(Y = \beta D + X'\gamma + u\). The instruments are excluded from this equation: under the model, they affect \(Y\) through \(D\), not through a separate direct effect. For the usual IV interpretation, the instruments must also satisfy an appropriate exogeneity condition, such as \(E[Zu]=0\), and provide enough relevant variation to identify the coefficients. The included covariates are assumed exogenous, so \(E[Xu]=0\).

Definition: In 2SLS, the instrument matrix contains the excluded instruments and every included exogenous regressor. If \(Q=[1,D,X]\) is the structural-regressor matrix, then \(W=[1,Z,X]\) is the instrument matrix. The constant is included when the structural equation has an intercept.

The inclusion of \(X\) in \(W\) is not optional merely because \(X\) is not the focus of the analysis. In 2SLS, each structural regressor must be instrumented by itself if it is exogenous, or by valid instruments if it is endogenous. Software often adds included exogenous regressors to the instrument set automatically; a researcher should check the software's convention rather than assume that a formula listing only \(Z\) describes the full instrument matrix.

Error 1: Leaving Included Covariates Out of the Instrument Set

A common manual workflow regresses \(D\) on \(Z\) alone, saves the fitted values, and then regresses \(Y\) on those fitted values and \(X\). That is not the general 2SLS procedure for the stated model. The first-stage projection must use \(Z\) and \(X\) together, while the second-stage regression retains \(X\). Equivalently, the full 2SLS instrument matrix is \(W=[1,Z,X]\).

Worked Example: Checking the Instrument-Set Rank

Suppose a hypothetical sample has four observations, and the structural regressors are an intercept, \(D\), and a covariate \(X\). The proposed excluded instrument is \(Z\).

Observation\(Z\)\(X\)\(D\)
1-1-1-2
2-110
31-10
4112

Here \(D=Z+X\). If the proposed instrument matrix contains only the intercept and \(Z\), it has two columns, whereas the structural-regressor matrix \([1,D,X]\) has three. Its rank cannot exceed two, so it cannot identify all three structural coefficients. The problem is visible in the projection matrix expression for 2SLS:

$$ \widehat{\theta}_{2SLS}=(Q'P_WQ)^{-1}Q'P_WY,\qquad P_W=W(W'W)^{-1}W' $$

When \(W=[1,Z]\), the matrix \(Q'P_WQ\) has rank at most two, so its inverse does not exist. In the correct specification \(W=[1,Z,X]\), the instrument set includes all three columns needed here. The first-stage fitted treatment is \(D\) itself in this constructed sample because \(D=Z+X\). In less artificial data, the fitted values need not equal \(D\), but the covariate still belongs in the first-stage instrument set.

A detail that can make this error hard to spot is that some software syntax treats exogenous regressors as instruments automatically. A command that lists \(Y\), \(D\), \(X\), and \(Z\) may therefore implement \(W=[1,Z,X]\), even if the command's instrument list displays only \(Z\). The correct check is the actual instrument matrix used by the estimator, not just the labels in a formula. A hand-built first stage should explicitly regress \(D\) on the constant, \(Z\), and \(X\).

Error 2: Changing the Sample Between Stages

The 2SLS projection is defined for a particular set of rows. Every variable in the structural equation and instrument set must be observed for a row to contribute to that 2SLS fit. If a first stage uses observations that are later omitted from the outcome regression, the fitted treatment values were obtained from a different projection than the one required by the final-stage sample. This can change the fitted values for the retained observations and no longer implements the ordinary 2SLS estimator on that sample.

Worked Example: A First Stage Fit on Too Many Rows

Consider a hypothetical first-stage dataset with an intercept and one instrument. The outcome is missing for observation 4, so the final analysis can use only observations 1–3. The treatment and instrument values are:

Observation\(Z\)\(D\)\(Y\)
100Observed
211Observed
321Observed
434Missing

If all four rows are used to regress \(D\) on an intercept and \(Z\), then \(\bar{Z}=1.5\), \(\bar{D}=1.5\), \(S_{ZZ}=5\), and \(S_{ZD}=6\). Thus the slope is \(6/5=1.2\), and the intercept is \(1.5-(1.2)(1.5)=-0.3\). The fitted values for the first three rows are \(-0.3,\ 0.9,\ 2.1\).

The appropriate first stage for the final analysis uses only rows 1–3. For those rows, \(\bar{Z}=1\), \(\bar{D}=2/3\), \(S_{ZZ}=2\), and \(S_{ZD}=1\). The slope is \(1/2=0.5\), and the intercept is \(2/3-(0.5)(1)=1/6\), approximately \(0.167\). The fitted values are approximately \(0.167,\ 0.667,\ 1.167\), not the values from the four-row fit.

This calculation shows why matching the final-stage rows after the first stage has already been fit is not enough: the first-stage coefficients, and hence the retained fitted values, can differ. The repair is to define the complete-case analysis sample using all model variables first, then estimate every stage on exactly that sample.

The issue is not that each stage must have identical variable names in its regression equation. Rather, the sample rows and the underlying 2SLS specification must agree. For example, included exogenous covariates remain in the outcome equation and in the instrument set; they are not replaced by fitted values. In a multi-stage manual calculation, keep the analysis sample fixed and retain the original values of those covariates in the second-stage regression.

Error 3: Calling the Coefficient an Unrestricted Average Effect

A 2SLS coefficient is not automatically the average treatment effect for everyone in the population. Under a correctly specified constant-effect linear model, \(\beta\) represents the common treatment effect, and the 2SLS coefficient can estimate that structural parameter when the IV assumptions and identification conditions hold. With heterogeneous effects, interpretation depends on the instrument and the assumptions. In the standard binary-instrument setting, independence, exclusion, relevance, and monotonicity identify a local average treatment effect (LATE) for compliers, not necessarily the average treatment effect (ATE) for the full population.

Worked Example: A Complier Effect Is Not the Population ATE

Imagine a hypothetical randomized encouragement \(Z\) that can change whether a person receives a treatment \(D\). Suppose 20% of the population are always-takers, 50% are compliers, and 30% are never-takers. Assume the encouragement has no direct effect on the outcome, is independent of potential outcomes and treatment responses, and no one responds to encouragement by doing the opposite of what it encourages. Suppose the treatment effects are 5 outcome units for always-takers, 2 units for compliers, and 1 unit for never-takers.

The change in treatment probability caused by the encouragement is the proportion of compliers:

$$ P(D=1\mid Z=1)-P(D=1\mid Z=0)=0.50 $$

Under the stated IV assumptions, the reduced-form change in mean outcome is the complier proportion multiplied by the complier treatment effect: \(0.50\times2=1.00\) outcome unit. The Wald ratio, which is the binary-instrument 2SLS coefficient in this simple setting, is therefore:

$$ \frac{E[Y\mid Z=1]-E[Y\mid Z=0]} {P(D=1\mid Z=1)-P(D=1\mid Z=0)} = \frac{1.00}{0.50}=2.00 $$

The population ATE, by contrast, weights all three groups' effects by their population proportions:

$$ ATE=(0.20)(5)+(0.50)(2)+(0.30)(1)=1.00+1.00+0.30=2.30 $$

Thus the 2SLS coefficient is 2.00 outcome units per treatment, the complier effect in this example, while the population ATE is 2.30 units per treatment. They differ because the instrument identifies an effect for compliers and the other groups have different effects. Reporting 2.00 as the unrestricted population average would overstate what these assumptions and this instrument establish.

With multiple instruments or more general treatment settings, the 2SLS coefficient under heterogeneity can reflect a particular weighted combination of effects rather than a single simple subgroup average. The key practice is to state the causal assumptions and the population or margin to which the interpretation applies. Do not infer an ATE merely from the fact that the reported estimate is a 2SLS coefficient.

A Short Justification for the Common-Sample Rule

The usual 2SLS definition makes the sample requirement explicit. On a fixed sample, let \(Q=[1,D,X]\) and \(W=[1,Z,X]\). The projection \(P_W\) maps each column onto the linear span of the instruments. The estimator uses this projection to form the second-stage regressor space. In particular, for the endogenous treatment, \(\hat D=P_WD\), while the included exogenous regressors are already in the span of \(W\) and remain unchanged.

$$ \hat D=P_WD,\qquad P_W=W(W'W)^{-1}W' $$

This formula uses the rows of \(D\) and \(W\) together. Changing rows changes \(W\), \(P_W\), and generally \(\hat D\). Therefore fitted values generated using a larger or different sample are not the projection specified by the final-stage sample. This is a direct consequence of the estimator's definition, not a special adjustment to make after the regression.

A Practical Specification Check

1
Write the structural equation.
Name the outcome, endogenous treatment, included exogenous covariates, and excluded instruments. State which variables are assumed exogenous and why the excluded instruments have no direct structural effect on the outcome.
2
Write the full instrument matrix.
Include a constant if used, every excluded instrument, and every included exogenous regressor. Check that the instrument matrix can identify all structural regressors; counting columns is a useful first check, though full rank is also required.
3
Fix one analysis sample.
Apply the missing-data rule to all variables in the model before estimation. Use the resulting same rows for first-stage and second-stage calculations.
4
Limit the causal claim.
State whether the interpretation relies on a constant treatment effect or on a heterogeneity-specific IV result, and name the target population or effect when it is identified.

Common Mistakes

  • “The covariate is exogenous, so it does not need to be an instrument.” In 2SLS, included exogenous regressors instrument themselves. Check that they are present in the instrument matrix, whether entered explicitly or added automatically by software.
  • “The first stage can use every available treatment observation.” Not if the final-stage analysis uses a smaller sample. Define the complete-case sample first and use it at every stage.
  • “The 2SLS coefficient is the average effect for everyone.” That conclusion requires assumptions such as a constant effect or additional identification of the population average. Under a standard heterogeneous binary-IV model, the coefficient identifies a complier effect.
  • “A valid-looking regression proves the instruments are valid.” Correct specification of the instrument matrix does not establish instrument exogeneity or exclusion. Those are substantive assumptions that require justification.
Key takeaway: A defensible 2SLS analysis uses the full instrument set, including included exogenous covariates; keeps a single sample across stages; and interprets the coefficient only as broadly as the model and IV assumptions allow.

Check Your Understanding

Use the model and checks above to answer these questions.

  1. If the structural regressors are an intercept, \(D\), and \(X\), and \(D\) is endogenous while \(X\) is exogenous, what belongs in the instrument matrix when \(Z\) is the excluded instrument?
  2. Why can a first stage fit on four rows produce unsuitable fitted values for a final-stage analysis using only three of those rows?
  3. In a binary-instrument setting with a first-stage difference of 0.40 and a reduced-form difference of 0.80 outcome units, what is the Wald ratio? Under the standard assumptions with heterogeneity, which effect does it represent?
  4. What additional condition would justify interpreting a 2SLS coefficient as a common treatment effect rather than a heterogeneity-specific effect?
  5. Why does including all exogenous covariates in the instrument matrix not, by itself, prove that an excluded instrument is valid?
Clinical Biostats