Tutorials › Propensity Score Matching and Instrumental Variables › The Scalar 2SLS Estimator

Two-Stage Least Squares · Tutorial 481 of 699

The Scalar 2SLS Estimator

Derive and calculate the single-instrument, single-regressor 2SLS estimate, and understand what the covariance ratio does—and does not—establish.

Advanced 10 min read

What You'll Learn

  • Write the first-stage and second-stage regressions with intercepts.
  • Derive the scalar 2SLS slope as the sample covariance of instrument and outcome divided by that of instrument and treatment.
  • Calculate the fitted treatment values and second-stage coefficient in a numerical example.
  • Recognize the equivalence to the Wald ratio for a binary instrument.
  • Diagnose zero or weak sample first stages and distinguish relevance from instrument validity.
  • Compare 2SLS with the OLS slope and identify the assumptions needed for a causal interpretation.

Why the Scalar 2SLS Formula Is Useful

With one instrument and one endogenous regressor, two-stage least squares (2SLS) has a compact expression: its slope is a ratio of two sample covariances. That expression makes the calculation transparent. The numerator measures the instrument’s association with the outcome; the denominator measures its association with the treatment. The ratio rescales the outcome association by the treatment shift associated with the instrument.

The formula is exact for the specified two-stage regressions with an intercept; it is not an approximation. But an easy calculation is not proof that an instrument is valid. Relevance, instrument independence, exclusion, consistency, and any other design assumptions needed for a causal interpretation must be defended on substantive grounds.

Model, Notation, and Conditions

For observations \(i=1,\ldots,n\), let \(Y_i\) be the outcome, \(D_i\) the single potentially endogenous regressor or treatment, and \(Z_i\) the single instrument. This tutorial considers a model with an intercept and no additional covariates:

$$ Y_i=\alpha+\beta D_i+u_i. $$

Here \(\beta\) is the structural slope of interest, and \(u_i\) contains the other determinants of \(Y_i\). The instrument is allowed to be associated with \(D_i\), but for the structural moment condition it must be uncorrelated with \(u_i\). In a causal application, this condition is supported by assumptions such as instrument independence and exclusion, together with a well-defined treatment and outcome. These assumptions concern the design and substantive setting; they cannot be established merely by calculating 2SLS.

Definition: In the single-instrument, single-regressor model with an intercept, the sample 2SLS slope is obtained by (1) regressing \(D_i\) on an intercept and \(Z_i\), (2) regressing \(Y_i\) on an intercept and the first-stage fitted values, and taking the slope on those fitted values. The instrument must have nonzero sample variation and a nonzero sample covariance with \(D_i\) for this slope to be defined.

For interpreting the estimate as informative about a population structural slope, the corresponding population conditions include instrument relevance, \(\operatorname{Cov}(Z,D)\ne 0\), and instrument exogeneity, \(\operatorname{Cov}(Z,u)=0\). Standard sampling conditions are also needed for claims about how the estimate behaves across samples. A nonzero sample covariance is necessary for the calculation but does not, by itself, establish population relevance or exogeneity.

Deriving the Covariance Ratio

Use sample covariance and variance with denominator \(n-1\). The same ratio results if both are defined with denominator \(n\). In the first stage, the ordinary least-squares regression of \(D_i\) on an intercept and \(Z_i\) has slope \(\hat{\pi}=\operatorname{Cov}(Z,D)/\operatorname{Var}(Z)\). Its fitted values are \(\hat{D}_i=\bar{D}+\hat{\pi}(Z_i-\bar{Z})\), so their sample mean is \(\bar{D}\).

The second-stage slope is the sample covariance of \(\hat{D}\) and \(Y\), divided by the sample variance of \(\hat{D}\). Centering the fitted values gives \(\hat{D}_i-\bar{D}=\hat{\pi}(Z_i-\bar{Z})\). Therefore:

$$ \begin{aligned} \hat{\beta}_{2SLS} &=\frac{\operatorname{Cov}(\hat{D},Y)} {\operatorname{Var}(\hat{D})}\\ &=\frac{\hat{\pi}\operatorname{Cov}(Z,Y)} {\hat{\pi}^{\,2}\operatorname{Var}(Z)}\\ &=\frac{\operatorname{Cov}(Z,Y)} {\hat{\pi}\operatorname{Var}(Z)} =\frac{\operatorname{Cov}(Z,Y)} {\operatorname{Cov}(Z,D)}. \end{aligned} $$

The cancellation is valid when \(\hat{\pi}\ne0\), equivalent here to \(\operatorname{Cov}(Z,D)\ne0\). If the sample first-stage covariance is zero, all first-stage fitted values are equal. There is no variation in the fitted regressor from which to estimate a second-stage slope, and the covariance ratio has a zero denominator. This derivation establishes an algebraic identity between the specified regressions and the ratio; it does not establish causal validity or a sampling distribution.

Worked Example: Calculating 2SLS From Four Observations

Suppose a hypothetical dataset records an outcome \(Y\), treatment \(D\), and instrument \(Z\) for four units:

Unit\(Z\)\(D\)\(Y\)
1015
2027
3129
41311

The sample means are \(\bar{Z}=0.5\), \(\bar{D}=2\), and \(\bar{Y}=8\). Using denominator \(n-1=3\), the centered products for \(\operatorname{Cov}(Z,D)\) sum to \(1\), and those for \(\operatorname{Cov}(Z,Y)\) sum to \(4\). Thus:

$$ \hat{\beta}_{2SLS} =\frac{\operatorname{Cov}(Z,Y)}{\operatorname{Cov}(Z,D)} =\frac{4/3}{1/3}=4. $$

Check this by carrying out both stages. Since \(\operatorname{Var}(Z)=1/3\), the first-stage slope is \((1/3)/(1/3)=1\); its intercept is \(\bar{D}-1\bar{Z}=1.5\). The fitted treatment values are \(1.5,1.5,2.5,2.5\). Their covariance with \(Y\) is \(4/3\), and their variance is \(1/3\), so the second-stage slope is \((4/3)/(1/3)=4\). The second-stage intercept is \(8-4(2)=0\). The estimated slope is 4 outcome units per treatment unit. This arithmetic does not establish that the instrument assumptions hold.

Binary Instruments and the Wald Ratio

When \(Z\) is binary, the covariance ratio can also be written using group means. Write \(\bar{Y}_1\) and \(\bar{Y}_0\) for the mean outcome among observations with \(Z=1\) and \(Z=0\), respectively, and define \(\bar{D}_1,\bar{D}_0\) similarly. With sample covariance defined using denominator \(n-1\), the covariance of a binary variable with any sample variable \(W\) equals \(\frac{n}{n-1}p_1p_0(\bar{W}_1-\bar{W}_0)\), where \(p_1\) and \(p_0\) are the sample fractions with \(Z=1\) and \(Z=0\), respectively. The common factor cancels in the ratio:

$$ \hat{\beta}_{2SLS} =\frac{\bar{Y}_1-\bar{Y}_0}{\bar{D}_1-\bar{D}_0}, \qquad \bar{D}_1\ne\bar{D}_0. $$

This is the sample Wald ratio. It is an algebraic restatement of scalar 2SLS with an intercept and a binary instrument, not a separate estimator with different arithmetic. Its causal interpretation still depends on the assumptions appropriate to the design.

Worked Example: Binary Instrument and Group Means

Consider these hypothetical observations, where \(Y\) is measured in points and \(D\) in treatment units:

Unit\(Z\)\(D\)\(Y\)
1018
20312
31213
41415

For \(Z=0\), the treatment mean is \((1+3)/2=2\), and the outcome mean is \((8+12)/2=10\). For \(Z=1\), the corresponding means are \((2+4)/2=3\) and \((13+15)/2=14\). The first-stage difference is \(3-2=1\) treatment unit, so relevance holds in this sample. The reduced-form difference is \(14-10=4\) points. The Wald calculation is:

$$ \hat{\beta}_{2SLS}=\frac{14-10}{3-2} =\frac{4\text{ points}}{1\text{ treatment unit}} =4\text{ points per treatment unit}. $$

The overall means are \(\bar{D}=2.5\) and \(\bar{Y}=12\). The second-stage intercept is \(12-4(2.5)=2\) points. The group-mean form and the covariance form give the same slope. Whether that slope has a causal interpretation depends on the instrument’s validity, not simply on the fact that the groups have different means.

Reading the Estimate and Diagnosing Problems

The ratio separates two empirical relationships. The numerator, \(\operatorname{Cov}(Z,Y)\), is the reduced-form association between instrument and outcome. The denominator, \(\operatorname{Cov}(Z,D)\), is the first-stage association between instrument and treatment. If the denominator is small, even a moderate numerator can produce a large estimate. If it is zero, the estimate is undefined. A small denominator is a warning about weak sample relevance; the ratio alone does not provide a complete diagnosis or appropriate inference.

A negative estimate is also possible. It may arise because the instrument and outcome move in opposite directions, because the instrument and treatment move in opposite directions, or both. Its sign should be checked against the observed numerator and denominator rather than interpreted in isolation.

In the binary-instrument case, inspect the two treatment-group means and their difference before interpreting the Wald ratio. For a nonbinary instrument, examine the first-stage relationship and the variation in \(Z\). In either case, investigate the design basis for independence and exclusion separately: a strong first stage does not imply a valid instrument, and covariances in the observed sample cannot verify the absence of a direct effect on the outcome.

Worked Example: A Negative Ratio and Its Intercept

For a hypothetical three-unit dataset, let \((Z,D,Y)\) be \((0,1,10)\), \((1,2,8)\), and \((2,4,4)\). The means are \(\bar{Z}=1\), \(\bar{D}=7/3\), and \(\bar{Y}=22/3\). The centered cross-products for \(Z,D\) sum to \(3\), while those for \(Z,Y\) sum to \(-6\). Dividing each sum by \(n-1=2\) gives \(\operatorname{Cov}(Z,D)=3/2\) and \(\operatorname{Cov}(Z,Y)=-3\). Hence:

$$ \hat{\beta}_{2SLS}=\frac{-3}{3/2}=-2. $$

The first-stage slope is \((3/2)/1=3/2\), since \(\operatorname{Var}(Z)=1\). The fitted treatment values are \(7/3+(3/2)(Z_i-1)\), namely \(5/6,7/3,23/6\). Their mean is \(7/3\). The second-stage intercept, using the unrounded slope, is:

$$ \bar{Y}-\hat{\beta}_{2SLS}\bar{\hat{D}} =\frac{22}{3}-(-2)\frac{7}{3} =12. $$

The negative slope is consistent with the negative reduced-form covariance and positive first-stage covariance. It is an estimated change of \(-2\) outcome units per treatment unit in this fitted IV relationship. Whether it represents a causal effect requires the model and instrument assumptions; the sign alone does not settle that question.

How 2SLS Relates to Other Approaches

ApproachWhat it calculates hereKey distinction
2SLS with one instrument\(\operatorname{Cov}(Z,Y)/\operatorname{Cov}(Z,D)\)Uses the instrument-induced component of treatment in the specified two-stage regressions.
Wald ratio, binary \(Z\)Difference in mean \(Y\) divided by difference in mean \(D\)Algebraically identical to scalar 2SLS with an intercept for a binary instrument.
OLS regression of \(Y\) on \(D\)The sample outcome-treatment regression slopeUses the full observed treatment variation; with endogenous treatment, it need not estimate the structural slope.

The direct OLS slope is generally not a substitute when treatment is endogenous: its variation can be related to \(u_i\). 2SLS instead uses variation associated with \(Z_i\), which supports a causal interpretation only if the instrument assumptions hold. In this single-instrument setting, expressing the answer as a reduced-form-to-first-stage ratio is exactly the scalar 2SLS calculation, rather than an alternative estimator.

Limitations and Common Pitfalls

  • Treating relevance as validity. A nonzero first stage is needed for the ratio, but it does not show instrument independence or exclusion.
  • Ignoring a zero or small denominator. A zero first-stage covariance makes the estimate undefined. A small one can make the ratio unstable; reporting a large coefficient without discussing this is misleading.
  • Calling every ratio a causal effect. The calculation returns a sample slope. A causal interpretation needs the structural and design assumptions, and the target interpretation depends on the setting.
  • Dropping the intercept without justification. The covariance-ratio derivation uses centered variables and the specified regressions include intercepts. A regression forced through the origin is a different calculation.
  • Rounding intermediate values too early. Keep exact fractions or sufficient precision through the slope and intercept calculations, then round the reported result.
Key takeaway: With one instrument, one endogenous regressor, and an intercept, the 2SLS slope is \(\operatorname{Cov}(Z,Y)/\operatorname{Cov}(Z,D)\). The formula describes the estimator’s arithmetic; instrument relevance and validity determine whether its causal interpretation is defensible.

Check Your Understanding

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

  1. Suppose \(\operatorname{Cov}(Z,Y)=6\) points and \(\operatorname{Cov}(Z,D)=2\) treatment units. What is the scalar 2SLS slope and its units?
  2. For a binary instrument, the mean treatment is 5 for \(Z=0\) and 7 for \(Z=1\); the mean outcome is 20 and 26, respectively. Calculate the Wald ratio.
  3. What happens to the scalar 2SLS estimate if \(\operatorname{Cov}(Z,D)=0\)? Does this establish that the instrument is invalid?
  4. Explain why a strong first-stage association does not, by itself, establish a causal interpretation.

Solutions. (1) \(\hat{\beta}_{2SLS}=6/2=3\) points per treatment unit. (2) The outcome difference is \(26-20=6\), and the treatment difference is \(7-5=2\), so the ratio is \(6/2=3\) outcome units per treatment unit. (3) The ratio has a zero denominator and is undefined; there is no sample first-stage variation in fitted treatment. This calculation alone does not establish instrument invalidity: it shows that the scalar estimator cannot be computed with this sample first stage. (4) Relevance concerns whether \(Z\) predicts \(D\). A causal interpretation also requires assumptions such as independence and exclusion, which a strong association between \(Z\) and \(D\) does not verify.

Clinical Biostats