Quant Memo
Core

Endogeneity and Instrumental Variables

The deepest OLS failure, a regressor correlated with the error, which biases and un-fixes the estimator no matter the sample size, and the instrumental-variables / 2SLS machinery that recovers a causal effect.

Prerequisites: Ordinary Least Squares (OLS), The Gauss–Markov Theorem

Endogeneity is the failure that ends the Gauss–Markov story before it starts. Heteroskedasticity and autocorrelation only spoil OLS's efficiency and standard errors, the point estimate stays honest. Endogeneity spoils the point estimate itself: when a regressor is correlated with the error term, OLS is biased and inconsistent, and no amount of data rescues it. It is the difference between "correlation with wrong error bars" and "correlation that isn't the causal effect you think it is." Instrumental variables are the classic tool for clawing back a causal estimate.

What breaks: strict exogeneity fails

The load-bearing OLS assumption is strict exogeneity, E[εX]=0\mathbb{E}[\varepsilon\mid X] = 0, equivalently E[xiεi]=0\mathbb{E}[x_i\varepsilon_i] = 0. Endogeneity is its violation: E[xiεi]0\mathbb{E}[x_i\varepsilon_i] \ne 0 for some regressor. From β^=β+(XX)1Xε\hat\beta = \beta + (X^\top X)^{-1}X^\top\varepsilon, taking probability limits,

plimβ^=β+(plim1nXX)1plim1nXε=β+Σxx1E[xε].\operatorname{plim}\,\hat\beta = \beta + \big(\operatorname{plim}\,\tfrac1n X^\top X\big)^{-1}\operatorname{plim}\,\tfrac1n X^\top\varepsilon = \beta + \Sigma_{xx}^{-1}\,\mathbb{E}[x\varepsilon].

If E[xε]0\mathbb{E}[x\varepsilon] \ne 0, the second term does not vanish, β^\hat\beta converges to the wrong number. This is the crucial point: unlike the variance problems, the inconsistency does not shrink with nn. A billion observations reproduce the bias perfectly.

The three classic sources

  1. Omitted variables. A driver of yy is left out and correlated with an included regressor, so its effect loads onto the error and contaminates the regressor's coefficient. Regress returns on a signal that proxies for an unmeasured risk factor and you attribute the risk premium to the signal.
  2. Simultaneity / reverse causality. xx affects yy and yy affects xx. Price impact is the canonical finance example, order flow moves price, but informed traders' flow also responds to price, so regressing returns on flow conflates the two directions.
  3. Measurement error (errors-in-variables). If the true regressor xx^* is observed with noise x=x+ux = x^* + u, the noise enters the error term correlated with xx, producing attenuation bias that pulls the coefficient toward zero. Noisy signals, proxy variables, and revised macro data all suffer this.

Instrumental variables: the idea

An instrument zz is a variable that affects yy only through xx. It must satisfy two conditions:

  • Relevance: Cov(z,x)0\operatorname{Cov}(z, x) \ne 0, the instrument actually moves the endogenous regressor.
  • Exogeneity (exclusion): Cov(z,ε)=0\operatorname{Cov}(z, \varepsilon) = 0, the instrument is uncorrelated with the error, i.e. it influences yy through no channel but xx.

Given a valid instrument, the IV estimator in the single-regressor case is the ratio of covariances

β^IV=Cov(z,y)Cov(z,x).\hat\beta_{\text{IV}} = \frac{\operatorname{Cov}(z, y)}{\operatorname{Cov}(z, x)}.

The logic: variation in xx driven by zz is exogenous by construction (since zεz\perp\varepsilon), so regressing yy on that clean slice of xx-variation recovers the causal slope. In matrix form β^IV=(ZX)1Zy\hat\beta_{\text{IV}} = (Z^\top X)^{-1}Z^\top y with instrument matrix ZZ. IV is exactly GMM with the moment condition E[zε]=0\mathbb{E}[z\varepsilon] = 0.

Two-stage least squares

With more instruments than endogenous regressors (overidentification), or several instruments per regressor, the efficient combination is 2SLS:

  • Stage 1: regress each endogenous regressor on all instruments (and exogenous controls), XX on ZZ, and keep the fitted values X^=Z(ZZ)1ZX=PZX\hat X = Z(Z^\top Z)^{-1}Z^\top X = P_Z X. These are the parts of XX explained by the (exogenous) instruments.
  • Stage 2: regress yy on X^\hat X:

β^2SLS=(X^X^)1X^y=(XPZX)1XPZy.\hat\beta_{\text{2SLS}} = (\hat X^\top \hat X)^{-1}\hat X^\top y = (X^\top P_Z X)^{-1}X^\top P_Z\, y.

Because X^\hat X lives in the instrument space and is orthogonal to ε\varepsilon, the second stage is clean. (Compute standard errors from the 2SLS formula, not by naively running two OLS regressions, which would understate them.)

Worked example: does an index inclusion raise a stock's return?

You want the causal effect of index membership on returns, but firms added to an index differ systematically (size, momentum), so membership is endogenous, the naive regression conflates the effect with the selection. An instrument: a rule-based inclusion threshold (e.g. a float or rank cutoff) that shifts membership probability discontinuously but is unrelated to the firm's unobserved return drivers near the cutoff. Firms just above vs just below the threshold are comparable except for inclusion, so the threshold instruments for membership and IV isolates the inclusion effect. This is the flavor of natural-experiment identification desks and academics use when randomization is impossible.

Failure modes in financial data

  • Weak instruments. If Cov(z,x)\operatorname{Cov}(z,x) is small, the denominator of β^IV\hat\beta_{\text{IV}} is near zero, so the estimator is high-variance and, worse, biased toward the OLS estimate it was meant to fix, and standard errors become unreliable. Check the first-stage FF-statistic; a common rule is F>10F > 10. Weak instruments can be more dangerous than the endogeneity itself.
  • Invalid instruments. Exogeneity is fundamentally untestable with a single instrument, you must argue it from economics. A plausible-looking instrument that secretly affects yy through another channel gives a confidently wrong causal claim.
  • Overidentification tests give false comfort. The Hansen/Sargan J-test checks consistency across instruments, not that they are jointly valid; all your instruments can share the same flaw and pass.
  • Local effect only. IV identifies a local average treatment effect, the effect for the subpopulation whose xx the instrument actually moves, which may not generalize to the whole universe.

In interviews

The essential contrast, stated without wobble: heteroskedasticity/autocorrelation leave OLS unbiased (only SEs wrong); endogeneity makes OLS biased and inconsistent, and more data does not help. Be able to write plimβ^=β+Σxx1E[xε]\operatorname{plim}\hat\beta = \beta + \Sigma_{xx}^{-1}\mathbb{E}[x\varepsilon] and name the three sources (omitted variables, simultaneity, measurement error, and that measurement error causes attenuation toward zero). State the two instrument conditions, relevance (Cov(z,x)0\operatorname{Cov}(z,x)\ne0, testable) and exogeneity (Cov(z,ε)=0\operatorname{Cov}(z,\varepsilon)=0, untestable), and describe 2SLS as projecting XX onto the instrument space and regressing on the clean fitted values. The mature closer is the weak-instrument warning: a weak instrument reintroduces the very bias it was meant to remove, so always check the first-stage FF.

Related concepts

Practice in interviews

Further reading

  • Angrist & Pischke, Mostly Harmless Econometrics (Ch. 4)
  • Hayashi, Econometrics (Ch. 3)
  • Wooldridge, Econometric Analysis of Cross Section and Panel Data (Ch. 5)
ShareTwitterLinkedIn