What the Two Stages Calculate
Two-stage least squares (2SLS) uses variation in an instrument \(Z\) to construct predicted values of treatment \(D\), then relates the outcome \(Y\) to those predictions. The first stage describes how treatment varies with the instrument; the second stage uses only the component of treatment captured by that first-stage relationship. The procedure is a calculation, not a guarantee that the instrument is valid.
Here we consider one scalar instrument, one scalar treatment, one outcome, and an intercept in each regression. For observations \(i=1,\ldots,n\), the first stage regresses \(D_i\) on \(Z_i\). Its fitted value is \(\hat{D}_i\). The second stage regresses \(Y_i\) on \(\hat{D}_i\). The slope from this second regression is the scalar 2SLS estimate.
A convenient model for describing a causal interpretation is \(Y_i=\beta_0+\beta_1D_i+\varepsilon_i\), where \(\beta_1\) is the treatment effect under a constant-effect linear model. For the instrument to support a causal interpretation, it must satisfy the relevant IV conditions: it must be associated with treatment (relevance), be independent of unmeasured causes of the outcome (independence or exogeneity), and affect the outcome only through treatment (exclusion). These conditions concern the study and its causal model; calculating two regressions does not establish them.
The calculations below show the 2SLS coefficient. They do not provide a standard error or confidence interval. In particular, the fitted treatment values are inputs to the point-estimate calculation, not a reason to interpret ordinary second-stage regression inference as valid.
Worked Example: Both Stages With a Binary Instrument
Worked Example: Both Stages With a Binary Instrument
Suppose a hypothetical encouragement study records a binary instrument \(Z\), treatment \(D\), and outcome \(Y\) for six people. The outcome is measured in points, and treatment is coded 0 or 1.
| Person | \(Z\) | \(D\) | \(Y\) (points) |
|---|---|---|---|
| 1 | 0 | 0 | 2 |
| 2 | 0 | 1 | 3 |
| 3 | 0 | 0 | 1 |
| 4 | 1 | 1 | 5 |
| 5 | 1 | 1 | 4 |
| 6 | 1 | 0 | 3 |
Stage 1: regress treatment on the instrument. For \(Z=0\), the treatment mean is \((0+1+0)/3=1/3\). For \(Z=1\), it is \((1+1+0)/3=2/3\). With a binary regressor and an intercept, the fitted value in each group equals that group’s treatment mean. Equivalently, the fitted first-stage line is:
Thus, each of persons 1–3 receives fitted treatment \(\hat{D}=1/3\), and each of persons 4–6 receives \(\hat{D}=2/3\). These are predictions from the first-stage regression, not the observed treatment values.
Stage 2: regress outcome on fitted treatment. The mean outcome is \((2+3+1)/3=2\) when \(Z=0\), and \((5+4+3)/3=4\) when \(Z=1\). Since fitted treatment takes the value \(1/3\) in the first group and \(2/3\) in the second, the second-stage slope is:
The second-stage intercept is \(2-6(1/3)=0\). The fitted regression is therefore \(\hat{Y}=0+6\hat{D}\). The calculated 2SLS slope is 6 outcome points per one-unit increase in treatment, under the treatment and outcome coding used here. Its causal interpretation would still require the IV assumptions; these hypothetical data alone do not verify them.
Why the Second-Stage Slope Matches the IV Ratio
In this scalar, just-identified setup, the second-stage slope can be checked against the ratio of the reduced-form slope (the slope from regressing \(Y\) on \(Z\)) to the first-stage slope. The relationship follows directly from the two OLS regressions with intercepts.
Let \(S_{ZZ}=\sum_i(Z_i-\bar{Z})^2\), \(S_{ZD}=\sum_i(Z_i-\bar{Z})(D_i-\bar{D})\), and \(S_{ZY}=\sum_i(Z_i-\bar{Z})(Y_i-\bar{Y})\). Provided \(S_{ZZ}>0\) and the first-stage slope is nonzero, the first-stage slope is \(b=S_{ZD}/S_{ZZ}\). The first-stage fitted values satisfy \(\hat{D}_i-\bar{\hat{D}}=b(Z_i-\bar{Z})\). Substituting this relation into the OLS formula for the second-stage slope gives:
The numerator divided by \(S_{ZZ}\) is the reduced-form slope, and the denominator divided by \(S_{ZZ}\) is the first-stage slope. So the second-stage calculation equals reduced form divided by first stage. For the six-person example, the reduced-form slope is \(4-2=2\), and the first-stage slope is \(2/3-1/3=1/3\); their ratio is \(2/(1/3)=6\), agreeing with the direct second-stage calculation.
This identity is an algebraic property of the scalar, just-identified regressions with intercepts. It does not add an assumption or make an invalid instrument valid. In a population model, a nonzero association between instrument and treatment is the relevance requirement; in the sample calculation, the corresponding first-stage slope must be nonzero for the ratio to be defined.
Worked Example: Calculating the Regression From Fitted Values
Worked Example: Calculating the Regression From Fitted Values
Consider a second hypothetical dataset with four people. The instrument is binary, and the observed treatment and outcome are shown below. Outcomes are measured in points.
| Person | \(Z\) | \(D\) | \(Y\) (points) |
|---|---|---|---|
| 1 | 0 | 0 | 1 |
| 2 | 0 | 0 | 3 |
| 3 | 1 | 0 | 4 |
| 4 | 1 | 1 | 6 |
In the first stage, the treatment means are \(0\) for \(Z=0\) and \((0+1)/2=1/2\) for \(Z=1\). Hence \(\hat{D}_i=0\) for the first two people and \(\hat{D}_i=1/2\) for the last two. In the second stage, the mean fitted treatment is \(1/4\) and the mean outcome is \((1+3+4+6)/4=3.5\). The OLS slope can be calculated from centered values:
The intercept is \(3.5-6(1/4)=2\). The fitted second-stage line is \(\hat{Y}=2+6\hat{D}\). A direct check gives the same slope: the mean outcome rises by \(5-2=3\) points between instrument groups, while the mean treatment rises by \(1/2-0=1/2\), and \(3/(1/2)=6\).
When the Calculation Is Undefined
For scalar 2SLS with an intercept, the fitted treatment must vary across observations. If the instrument has no sample association with treatment, the first-stage slope is zero and every first-stage fitted value is the same. There is then no variation in the second-stage regressor, so its slope cannot be calculated.
Worked Example: A Zero Sample First Stage
Suppose a hypothetical dataset has two people with \(Z=0\) and two with \(Z=1\), with treatment values \(0,1,0,1\), respectively. The treatment mean is \(1/2\) in each instrument group, so the first-stage regression with an intercept has slope \(0\) and fitted values \(\hat{D}_i=1/2\) for all four people.
In the second stage, the denominator of the OLS slope is \(\sum_i(\hat{D}_i-\bar{\hat{D}})^2=0\), because every fitted value equals its mean. Division by this denominator is undefined. Whatever the outcomes are, this dataset does not yield a finite scalar 2SLS slope by this two-stage calculation. This is a sample calculation problem; it is not, by itself, a general test of whether an instrument is valid.
Common Pitfalls and Interpretation
A frequent mistake is to regress \(Y\) on the observed \(D\) in the second stage and call that result 2SLS. That is not the procedure: the second-stage regressor is the first-stage fitted value \(\hat{D}\). Replacing fitted treatment with observed treatment returns an ordinary outcome-on-treatment regression, which does not implement this IV calculation.
A second pitfall is to say that the first stage “proves” the instrument is valid because the treatment responds to it. A nonzero first-stage association addresses relevance only. Independence or exogeneity and exclusion require separate causal justification. Likewise, the arithmetic result \(6\) in the examples is an estimated regression coefficient, not automatically a population causal effect. Under a correctly specified constant-effect structural model and valid IV assumptions, it can estimate the structural treatment coefficient; other causal interpretations require their own assumptions.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- In the six-person example, what fitted treatment value is assigned to a person with \(Z=1\), and how is it obtained?
- Why must the second-stage regression use \(\hat{D}\) rather than the observed \(D\)?
- If the first-stage slope is \(1/4\) and the reduced-form slope is \(3/2\), what is the scalar 2SLS slope?
- What happens to the second-stage OLS slope when every fitted treatment value is identical?
- Which IV conditions are not established merely by finding a nonzero first-stage slope?