lenatriestounderstand

Chapter 37 of 57

The Control Function: The Residual Trick Behind 2SLS

Created Jul 5, 2026 Updated Oct 25, 2026

A regressor is endogenous when it moves with the error term, and the standard repair is an instrument Z — a variable that shifts X without acting on y except through X, and uncorrelated with the structural error. Two-stage least squares spends that instrument by replacing the regressor: throw away X, keep the instrument-cleaned X̂. The control function approach spends the same instrument by the opposite door — it keeps X and adds one new column that absorbs exactly the contaminated part of it.

Here's the mechanic. Split X into the part the instrument explains and the part it doesn't, X = X̂ + v̂. The instrument is clean by assumption, so whatever ties X to the error sits in v̂ — and a term you can compute is a term you can control for:

  • Stage 1 — regress X on Z, and instead of keeping the fitted X̂, keep the residual v̂ = X − X̂.
  • Stage 2 — regress y on X and v̂ together. Conditioning on v̂ leaves exactly the variation X̂ carries, which is why the coefficient on X comes back clean — and why, in this linear case, it is numerically the same number 2SLS gives.

Watch the two steps work. Stage 1 leaves the residual v̂ = X − X̂; stage 2 regresses y on X and v̂. The OLS line is dragged off the truth by the confounding δ, while the CF coefficient on X recovers β up to sampling error. The card row makes the headline concrete: β̂_CF and the 2SLS estimate are identical to numerical precision — in this linear, one-endogenous-regressor case, replacement and conditioning are two routes to one number. The coefficient ρ̂ on v̂ is a built-in Hausman-style test: dial δ to zero and ρ̂ collapses, telling you the correction was unnecessary.

Two payoffs beyond the estimate itself:

  • A built-in endogeneity test. Testing whether the coefficient on v̂ is zero is the regression form of the Durbin–Wu–Hausman test. A significant coefficient is evidence of endogeneity, given a valid instrument; a non-significant one is not proof of exogeneity, and with a weak instrument the test has little power to find anything at all.
  • It generalises where 2SLS stalls. In the plain linear model, control function and 2SLS are numerically identical — same number, two parameterisations. The reason to keep it in your kit is what happens when the second stage stops being a linear regression. Take a binary outcome — did the customer churn — with an endogenous price. You can still substitute X̂ into a probit or logit; the estimate just isn't consistent, because the expectation of a nonlinear function isn't that function of the expectation. Conditioning on v̂ is the standard route instead — but it stops being free. Nonlinear control functions buy their consistency with assumptions about how the structural error depends on v̂ (the textbook probit leans on joint normality), and residual inclusion in a logit carries no general guarantee. The same conditioning idea reappears in double/debiased machine learning, which is more than a fancier first stage: it adds orthogonalised scores and cross-fitting.

Two cautions travel with it. v̂ is a generated regressor, so the second stage's textbook standard errors are the wrong ones — bootstrap, or take 2SLS's. And nothing here rescues a weak instrument: push the first stage toward zero and both estimators fall apart together.

So think of it as the same identification wearing different clothes: 2SLS purifies the regressor; the control function conditions on the impurity. In a linear model pick either — they return the same number. Pick the control function when the second stage is nonlinear, when you want the endogeneity test built in, or when the first stage is a learned model rather than a regression.

The full version — why CF and 2SLS coincide, where the flexible first stage helps, and the bridge to double ML — is in the Control Function Approach note.