Section 3.13

Instrumental Variables & 2SLS

The previous lesson ends with a rule: adjust for the common causes. It works only for common causes you have measured. Motivation, ability, health at baseline, how much a family already valued the thing you are studying — none of those sit in your file, and no amount of careful adjustment can close a backdoor path through a variable you do not have. An instrumental variable is the way around that. Instead of blocking the contaminated comparison, you go looking for a clean one that was already there.

When the regressor is part of the problem

A regressor is endogenous when it is correlated with whatever the error term is carrying. Ordinary least squares assumes the opposite, and when the assumption fails the coefficient stops estimating a causal effect and starts estimating that effect plus whatever the error was holding.

Three routes lead there, and it is worth being able to name which one you are in:

  • Omitted variables. Something causes both the regressor and the outcome and is missing from the model. Section 2.9 works out exactly what that costs: the slope you get is the slope you wanted plus the omitted variable's effect on the outcome times its own regression on your predictor. That identity is the whole diagnosis, and it is worth rereading before going further, because instrumental variables are a response to the case where the missing term cannot be supplied.
  • Reverse causality. Police numbers predict crime rates, and crime rates also determine police numbers. Whichever direction you write the regression in, the other one is inside the error.
  • Measurement error in the regressor. A predictor recorded with noise is correlated with its own error, and the resulting slope is pulled toward zero. This one surprises people: careless measurement of the outcome costs precision, while careless measurement of the predictor costs accuracy.

All three have the same shape. The variation in the regressor that you are using to identify the effect is contaminated, and adjustment cannot decontaminate it.

Three conditions, and only one of them is testable

An instrument is a variable, written Z, that satisfies three conditions with respect to your endogenous regressor X and your outcome Y. The course names them in this order and so will we.

  • Relevance. Z actually moves X. If the instrument barely shifts the regressor, there is nothing to work with.
  • Independence. Z is as good as randomly assigned, so nothing that causes Y also causes Z.
  • Exclusion. Z affects Y only by way of X, with no direct path and no path through anything else.

Relevance is the only one your data can speak to. It is a claim about an association between two variables you both observe, and the first stage below measures it. Independence and exclusion are claims about paths that involve the error term, and the error term is by definition the part you never see. They are arguments, made from how the instrument came to exist, and a reader either accepts the argument or does not. That asymmetry is the lesson. Everything else here is arithmetic.

A worked instrument. A city library runs a free ten-week tutoring program with more applicants than places, so places are allocated by lottery among the applicants. Z is winning the lottery, X is hours of tutoring actually attended, Y is a test score at the end of the term. Relevance is plain: winners attend far more than losers. Independence comes from the lottery itself, which is a coin, not a committee. Exclusion is the arguable one: winning has to change the score only by getting people into the room. This example runs through the rest of the lesson.

First stage, reduced form, and the ratio between them

Two regressions do all the work, and both of them are ordinary, because both put the instrument on the right-hand side and the instrument is clean.

  • The first stage regresses the endogenous regressor on the instrument: X = a0 + a1Z. Its slope a1 says how much of X the instrument delivers.
  • The reduced form regresses the outcome on the instrument: Y = r0 + r1Z. Its slope r1 says how much of Y the instrument delivers.

Now use the exclusion restriction. If the only way Z reaches Y is through X, then the whole of r1 was produced by that journey: the instrument moved X by a1, and each unit of X moves Y by the causal effect we are after. So r1 = β × a1, and dividing gives

β = r1 / a1 = (effect of Z on Y) / (effect of Z on X)

which is the Wald ratio. It is the estimator, and it is also the argument for the estimator, in one line: the effect of the instrument on the outcome, deflated by how much regressor the instrument bought you. The Greek letter is β (beta), the same causal slope ordinary regression was trying and failing to estimate.

In the library study, suppose lottery winners attended 12.0 hours on average and losers 4.0 hours, so the first stage is 8.0 hours. Winners scored 68.4 and losers 62.0, so the reduced form is 6.4 points. The Wald ratio is 6.4 / 8.0 = 0.80 points per hour of tutoring. The ordinary regression of score on hours, run on the same 500 people, reports 1.35. The gap of 0.55 points per hour is the omitted-variable term from Section 2.9 made visible: it is what motivation contributes to the naive slope by raising both attendance and scores, and it would have been reported as tutoring.

🎮 The Instrument at Work

Six hundred applicants, half of them lottery winners (indigo), half not (teal). Motivation is real, drives both attendance and scores, and is never measured. The orange line is the ordinary regression through the whole cloud; the dashed indigo line joins the two group averages, and its slope is the Wald ratio. Set the exclusion violation above zero and watch which of the three numbers reacts.

True effect β
Ordinary regression
Wald ratio
Its standard error
First-stage F

Two-stage least squares

Two-stage least squares, universally abbreviated 2SLS, is the same answer reached by a different road, and it is the one that generalizes. Fit the first stage. Keep its predicted values, X̂, which are the part of the regressor the instrument accounts for and therefore the part that carries none of the contamination. Then regress Y on X̂. The second slope is the causal estimate.

With one instrument and one endogenous regressor the two routes agree to the last decimal, because X̂ is a linear function of Z and regressing on it recovers exactly r1/a1. The reason to learn 2SLS anyway is that it keeps working when the Wald ratio runs out: several instruments at once, control variables alongside the endogenous one, more than one endogenous regressor. A ratio of two numbers cannot absorb any of that; a pair of regressions can.

One warning about doing it literally. If you fit the first stage, save the predictions into a new column and run the second regression by hand, the coefficient is right and the standard errors are wrong. The second regression thinks X̂ arrived as data, so it computes its residuals against the fitted regressor instead of the real one, and reports more precision than you have. Dedicated commands exist for exactly this reason, and the software section below says what to do in a package that has none.

A weak instrument is worse than it looks

The Wald ratio divides by the first stage, so an instrument that barely moves the regressor divides by something close to zero. Two things go wrong at once. The estimate becomes enormously variable, since small sampling wobbles in a small denominator swing the ratio around, and it also becomes biased toward the ordinary least squares estimate it was supposed to rescue you from. A weak instrument does not degrade gracefully into "no answer". It degrades into a confident wrong answer that looks like the one you were trying to avoid.

The conventional screen is the F statistic from the first stage, testing whether the instruments belong there at all, with a working threshold of about 10. Drag the strength slider down in the widget above and watch the two numbers move together: the standard error inflates by roughly the factor the first stage shrank by, and the F falls through 10 on its way. Treat 10 as a rule of thumb rather than a law. It is a convention that came out of simulations, the bar has been argued upward since, and a first stage of 11 is not a different creature from a first stage of 9.

When the exclusion restriction fails

Suppose winning the lottery is worth 1.6 points on its own, because winners feel picked out and try harder in the term generally, whether or not they attend. The reduced form still reads 6.4, but only 4.8 of it came through tutoring, so the honest effect is 4.8 / 8.0 = 0.60 points per hour. The Wald ratio reports 6.4 / 8.0 = 0.80 and overstates the effect by a third.

Two features of that arithmetic are worth holding onto. The bias is the direct effect divided by the first stage, 1.6 / 8.0 = 0.20 here, so a weak instrument magnifies a violation as surely as it magnifies noise: the same 1.6-point leak through a first stage of 0.8 hours would have added 2.0 to the estimate instead of 0.20. And the first-stage F is completely unmoved by any of this, because the first stage never looks at the outcome. You can see that on screen. Turn the violation slider up and the Wald ratio drifts away from the truth while the F sits exactly where it was.

LATE: whose effect is this?

One more piece of honesty, and the syllabus names it: LATE, the local average treatment effect. When the effect of X on Y varies from person to person, the ratio does not recover the average effect in the population. It recovers the average among the people whose regressor the instrument actually moved, and those people have a name.

Sort the applicants by how they would behave under both states of the lottery. Always-takers get tutoring either way, paying for it elsewhere if the lottery goes against them. Never-takers do not attend even when handed a place. Compliers attend if they win and do not if they lose. Only the compliers change their X when Z changes, so only they contribute to the numerator and the denominator, and the estimate is their average effect. The word "local" in the name means local to that group.

It is easiest to see when the regressor is itself yes-or-no. If 62% of winners attended and 18% of losers did, the first stage is 0.44, and that 0.44 is the complier share. A reduced-form gap of 2.2 points then gives 2.2 / 0.44 = 5.0 points as the effect of attending, for compliers.

Whether that is the number you wanted depends on the question. A city deciding whether to fund more lottery places is asking precisely about the people extra places would draw in, so the local estimate is the policy-relevant one. A researcher asking what tutoring does for the average applicant is not, and a different instrument moving a different slice of people would honestly return a different number. Report which group your instrument moved, and say so in the same sentence as the estimate.

What no output will tell you

Software will print a first-stage F, so relevance gets checked. Nothing in any package tests independence or exclusion, and no residual plot, diagnostic or goodness-of-fit measure contains information about them. This is the same shape as Section 2.8's point that independence of observations is the assumption a residual plot cannot check: the data are silent, so the design has to speak.

What you can do instead is argue, in public, and leave the argument where a reader can attack it. State the instrument and where its variation came from. Show the first stage as a number rather than as a claim. Name the direct paths a skeptic would propose, and say what you know that rules each one out. Where the instrument is a lottery or a rule, show that the groups it created look alike on everything you did measure, which does not prove independence but would certainly have embarrassed it. Then say whose effect the estimate is. A causal claim from observational data is a claim about assumptions, and the assumptions are the part that belongs in the write-up.

Why it matters: adjustment can only close backdoor paths through variables you have. An instrument closes them through a variable you do not, by finding a slice of variation in the regressor that arrived for reasons unrelated to the outcome. The price is that the two conditions doing the work are untestable and the estimate belongs to the compliers. The next lesson strikes the same bargain with a rule instead of a lottery: a strict cutoff on a score, and a comparison of the people standing either side of it. Quasi-experimental designs in the Research Toolkit are the same trade made with other natural experiments.

Common questions

My instrument is significant in the first stage. Is that enough?

Significance and strength are different bars, and the second one is much higher. With a single instrument the first-stage F is the square of the t on its coefficient, so the conventional threshold of F = 10 corresponds to a t of about 3.16, where ordinary significance at .05 only asks for 1.96. An instrument can be comfortably significant and still be weak enough to produce an estimate that is both wildly imprecise and biased back toward the ordinary regression. Report the first-stage F itself rather than a p-value, and if it sits near 10 rather than far above it, say what that costs your estimate instead of leaving the reader to work it out.

What is the difference between an instrument and a control variable?

Where it goes in the model, and it is the opposite of what people expect. A control variable is included in the outcome regression, because you want to hold it constant while reading the coefficient on your predictor. An instrument must be excluded from the outcome regression, because the whole argument rests on it having no path to the outcome except through the predictor. Put an instrument into the outcome model as a covariate and you have destroyed it: whatever it explains of the outcome directly is now being absorbed there, and the two-stage estimate loses the variation it was living on. A variable that plausibly belongs in the outcome model is, by that fact, not a candidate instrument.

Is there a test for the exclusion restriction?

Not with one instrument, and only a partial one with several. If you have more instruments than endogenous regressors, the model is overidentified, and the Sargan and Hansen overidentification tests ask whether the instruments agree with one another about the answer. A small p is evidence that at least one of them is invalid, which is useful. A large p is much weaker than it looks, because instruments that share the same flaw agree with each other perfectly, and the test assumes at least one of the set is valid in order to judge the rest. With a single instrument, which is the common case, there is nothing to compare it against and the restriction is untestable in principle rather than merely in practice. Argue it from where the instrument came from, and name the direct paths you are ruling out.