From a Dataset to an IV Result
An instrumental-variables analysis is not just a final coefficient. A reader needs to see how the outcome, endogenous treatment, instrument, and model fit together; how the first stage and reduced form lead to 2SLS; and how uncertainty is calculated. This workshop follows that sequence using a small, hypothetical observational dataset.
Suppose researchers are interested in the effect of tutoring hours on a test score. Students who receive more tutoring may differ in motivation or prior preparation, so a regression of scores on tutoring hours need not identify a causal effect. The proposed instrument is an invitation to a tutoring program. An invitation may change the number of tutoring hours received, but a causal interpretation also requires that it affect scores only through tutoring and be unrelated to other causes of scores.
Because these are observational data, those assumptions need a substantive defense; a regression table cannot establish them. In particular, a strong association between invitation and tutoring does not show that invitation is independent of unmeasured causes of test scores or that it has no direct effect. The example uses no additional covariates, so the assumptions are stated without conditioning on \(X_i\). In an analysis with covariates, the same choices about outcome, endogenous regressor, instruments, and controls must be made consistently in the first and second stages.
The Hypothetical Data and Model Checks
The eight students below are hypothetical. Tutoring hours are the endogenous treatment, the invitation is the instrument, and the score is the outcome.
| Student | Invitation \(Z_i\) | Tutoring hours \(D_i\) | Test score \(Y_i\) (points) |
|---|---|---|---|
| A | 0 | 1 | 10 |
| B | 0 | 2 | 12 |
| C | 0 | 3 | 13 |
| D | 0 | 4 | 15 |
| E | 1 | 3 | 13 |
| F | 1 | 4 | 15 |
| G | 1 | 5 | 17 |
| H | 1 | 6 | 19 |
Worked Example: Estimate the First Stage and Reduced Form
For a binary instrument and an intercept, the slope in a regression on \(Z_i\) is the difference in group means, the mean for invited students minus the mean for non-invited students. The first stage regresses \(D_i\) on \(Z_i\). The reduced form regresses \(Y_i\) on \(Z_i\).
For the first stage, the mean tutoring hours among students with \(Z_i=0\) are \((1+2+3+4)/4=2.5\). Among students with \(Z_i=1\), they are \((3+4+5+6)/4=4.5\). Thus the fitted first-stage equation is:
The estimated first-stage slope is \(4.5-2.5=2.0\) hours: in this dataset, invited students average 2.0 more tutoring hours. This describes the observed instrument-treatment association; it does not, by itself, establish instrument validity.
For the reduced form, the score means are \((10+12+13+15)/4=12.5\) points for \(Z_i=0\), and \((13+15+17+19)/4=16.0\) points for \(Z_i=1\). The fitted reduced-form equation is:
The estimated reduced-form slope is \(16.0-12.5=3.5\) points. It is the invitation-score association, not yet the effect of an additional tutoring hour.
From the Two Regressions to 2SLS
With one endogenous treatment and one excluded instrument, the model is just identified: there is one excluded instrument for the one endogenous regressor. In this simple setting, the 2SLS slope equals the reduced-form slope divided by the first-stage slope. Equivalently, the first stage supplies fitted treatment values, and the second stage regresses the outcome on those fitted values and an intercept.
Worked Example: Calculate the 2SLS Estimate
The first-stage fitted tutoring hours are 2.5 for each student with \(Z_i=0\) and 4.5 for each student with \(Z_i=1\). The second-stage slope is therefore the difference in mean scores divided by the difference in fitted tutoring hours. Substituting the estimates from the two regressions gives:
The second-stage intercept is \(12.5-(1.75)(2.5)=8.125\), so the fitted second-stage equation is \(\widehat{Y}_i=8.125+1.75\widehat{D}_i\). Under the stated constant-effect and instrument-validity assumptions, the slope is an estimated increase of 1.75 test-score points per additional tutoring hour. Without those assumptions, the calculation is an IV estimate but its causal interpretation is not established.
The second-stage regressor is fitted tutoring hours, not the observed tutoring hours. This distinction matters for estimation and especially for uncertainty: an ordinary least-squares standard error from a regression on fitted treatment does not account for the first-stage estimation. Inference must use a 2SLS variance estimator.
Heteroskedasticity-Robust Inference
A heteroskedasticity-robust 2SLS covariance estimator allows the structural error variance to differ across observations. In matrix notation, let \(X\) contain the intercept and observed endogenous regressor, let \(Z\) contain the intercept and excluded instrument, and define \(P_Z=Z(Z'Z)^{-1}Z'\). If \(\hat{u}_i=Y_i-X_i'\widehat{\beta}^{\,2SLS}\), the HC0 sandwich estimator is:
Here \(Z_i\) in the matrix expression is the vector of instruments for observation \(i\), including the intercept. HC0 uses the squared 2SLS residuals and does not apply a finite-sample degrees-of-freedom correction. Robustness concerns the form of the error variance; it does not repair an invalid instrument, omitted model structure, or a weak first stage.
For the binary-instrument example, the slope component of this sandwich estimator has a particularly transparent form. Write \(\bar{D}_1-\bar{D}_0\) for the observed difference in mean treatment and let \(\hat{u}_i\) be the 2SLS residual. Since the instrument moments make residuals sum to zero within each instrument group, the HC0 variance for the slope is:
Worked Example: Compute the Robust Standard Error and Interval
Use the 2SLS equation \(\widehat{Y}_i=8.125+1.75D_i\) to calculate the structural residuals. In the \(Z_i=0\) group, the fitted scores based on observed tutoring hours are 9.875, 11.625, 13.375, and 15.125 points. Subtracting these from the observed scores gives residuals \(0.125, 0.375, -0.375, -0.125\). Their squared sum is:
For the \(Z_i=1\) group, fitted scores are 13.375, 15.125, 16.875, and 18.625 points. The residuals are \(-0.375, -0.125, 0.125, 0.375\), whose squared sum is also 0.3125. There are four students in each group, and the difference in mean tutoring hours is 2.0 hours. Therefore:
Using a standard normal approximation, the test statistic for \(H_0:\beta_1=0\) is \(z=1.75/0.09882=17.71\), giving a two-sided \(p\)-value below 0.001. The 95% Wald confidence interval is:
Under the model and IV assumptions, this interval is an asymptotic confidence interval for the constant causal effect: its endpoints describe effects in test-score points per additional tutoring hour. The procedure does not assign a 95% probability to the fixed parameter being in this particular interval. With only eight observations, the normal approximation may be poor; the calculation is a transparent illustration, not a recommendation to rely on asymptotic inference in such a small study.
Reporting the Analysis
A compact table can show how the instrument is associated with treatment and outcome and how those estimates produce the 2SLS result. Label each quantity, give units, and identify the standard-error method. The table below reports the estimates from the hypothetical data; the confidence interval is the asymptotic HC0 Wald interval calculated above.
| Quantity | Estimate | Uncertainty or interpretation |
|---|---|---|
| First-stage slope | 2.000 hours | Mean tutoring-hour difference by invitation |
| Reduced-form slope | 3.500 points | Mean score difference by invitation |
| 2SLS treatment coefficient | 1.750 points per hour | HC0 SE = 0.09882; 95% interval [1.556, 1.944] |
Worked Example: Write a Concise Result
A concise report could read: “In the hypothetical sample, the invitation was associated with 2.00 additional tutoring hours and a 3.50-point higher test score. The just-identified 2SLS estimate was 1.75 test-score points per tutoring hour (HC0 SE 0.0988; asymptotic 95% CI 1.56 to 1.94). A causal interpretation requires the invitation to be relevant, independent of unmeasured causes of scores, and to affect scores only through tutoring; the constant-effect interpretation also assumes a common effect across students.”
This wording separates observed instrument associations from the treatment effect interpretation and makes the assumptions visible. It also avoids implying that the robust standard error or narrow interval can verify instrument validity.
Common Mistakes and Practical Limits
- Calling the reduced form the treatment effect. The reduced-form estimate is the score difference associated with invitation. In this just-identified model, the 2SLS estimate divides that difference by the first-stage treatment difference.
- Using the ordinary second-stage standard error. Regressing the outcome on fitted treatment can reproduce the 2SLS point estimate, but its ordinary OLS standard error is not the 2SLS standard error. Use a 2SLS covariance estimator that accounts for the instrumented estimation.
- Treating robust as synonymous with valid. HC0 permits heteroskedasticity in the structural errors. It does not establish exclusion or exogeneity and does not resolve weak identification.
- Overstating the causal conclusion. The estimate is causal only under the IV assumptions and the stated effect model. If treatment effects vary, the constant-effect interpretation need not apply; the coefficient is not automatically the population average treatment effect.
- Ignoring sample size. A computed standard error and p-value do not guarantee reliable finite-sample inference. This eight-person example is especially unsuitable for treating a normal approximation as definitive.
Check Your Understanding
Use the workshop's models and calculations to answer the following questions.
- What are the first-stage and reduced-form slopes in the hypothetical data, and what are their units?
- Show how dividing the reduced-form slope by the first-stage slope gives the 2SLS coefficient.
- Why is the 2SLS residual calculated using observed tutoring hours, even though the second stage uses fitted tutoring hours?
- What does the HC0 robust standard error allow, and which IV assumptions does it not establish?
- State the assumptions needed to interpret the reported 2SLS coefficient as a constant causal effect in this example.