Lecture 9
PIMES/UFPE
For eight lectures, one assumption carried every consistency result: exogeneity, \(\E[\mathbf{x}_i\varepsilon_i]=\mathbf{0}\). This lecture asks what happens when it fails — when a regressor is correlated with the error. Least squares then breaks in the limit, not merely in small samples. Naming that failure is endogeneity; repairing it needs information from outside the regression — an instrument. At heart it is a question of identification: with exogeneity gone, is the parameter still recoverable?
A refresher from Lecture 2 — with no assumptions beyond finite second moments.
Definition 1 (Endogeneity) Posit a structural equation \(y_i=\mathbf{x}_i'\bbeta+\varepsilon_i\) in which \(\bbeta\) is defined by economics — the causal effect — not by fit. A regressor is endogenous for \(\bbeta\) when it is correlated with the structural error, equivalently when the structural parameter and the projection disagree: \[\E[\mathbf{x}_i\varepsilon_i]\neq\mathbf{0}\iff\bbeta^{*}\neq\bbeta.\] It is a property relative to a structural equation — the same variable can be exogenous in one model and endogenous in another.
Regress log weekly earnings on years of education (plus experience and controls). OLS gives a return of about 7% per year — clean and precise. Is it the causal return?
With \(\bb=(\bX'\bX)^{-1}\bX'\bY\) and the structural \(\bY=\bX\bbeta+\beps\),
\[\bb =\bbeta+\Big(\tfrac1n\textstyle\sum_i\mathbf{x}_i\mathbf{x}_i'\Big)^{-1}\Big(\tfrac1n\textstyle\sum_i\mathbf{x}_i\varepsilon_i\Big) \;\pto\;\underbrace{\bbeta+\big(\E[\mathbf{x}_i\mathbf{x}_i']\big)^{-1}\E[\mathbf{x}_i\varepsilon_i]}_{=\;\bbeta^{*}}.\]
The population is \(\{(y_i,\mathbf{x}_i,\mathbf{z}_i)\}\), i.i.d. from \(F\). The structural equation is \(y_i=\mathbf{x}_i'\bbeta+\varepsilon_i\), but now \(\E[\mathbf{x}_i\varepsilon_i]\neq\mathbf{0}\) for at least one regressor. Alongside \(\mathbf{x}\) there is a further variable \(\mathbf{z}\) — the instrument, developed in Part II — whose role is to supply the identifying information the structural equation lacks on its own.
The long model is \(y_i=\mathbf{x}_i'\bbeta+w_i\gamma+u_i\), with \(u\) orthogonal to both \(\mathbf{x}\) and \(w\). Omit \(w\) and it falls into the error, \(\varepsilon_i=w_i\gamma+u_i\), giving \(\E[\mathbf{x}_i\varepsilon_i]=\gamma\,\E[\mathbf{x}_i w_i]\).
The long-vs-short coefficient gap \(\gamma\,(\E[\mathbf{x}\mathbf{x}'])^{-1}\E[\mathbf{x} w]\) is the omitted-variable bias of Lecture 3. Omitted-variable bias is endogeneity, seen from the regression table.
We regress on a noisy measurement \(\tilde x_i=x_i^{*}+u_i\) of the true regressor \(x_i^{*}\), with \(u_i\) independent of \(x_i^{*}\) and \(\varepsilon_i\). The structural model is \(y_i=x_i^{*}\beta+\varepsilon_i\), so in terms of \(\tilde x_i\) the error becomes \(\varepsilon_i-\beta u_i\) and
\[\plim b=\beta^{*} =\beta\,\frac{\Var(x_i^{*})}{\Var(x_i^{*})+\Var(u_i)} =\frac{\beta}{1+\Var(u_i)/\Var(x_i^{*})}\;<\;\beta.\]
This is the inconsistent estimator from the Monte Carlo taxonomy (Demo 2): the sampling distribution tightened on the wrong value, \(0.5\) rather than \(\beta=1\). There we saw it; here we derive it.
Even when \(\mathbf{x}\) is exogenous in the full population, keeping only the units that made it into the sample can make the in-sample error correlated with \(\mathbf{x}\).
Price and quantity are set together — demand and supply hold at once: \[q_i=\alpha p_i+\varepsilon_i^{d}\ (\text{demand}),\qquad q_i=\delta p_i+\varepsilon_i^{s}\ (\text{supply}).\]
Definition 2 (Identification) A parameter is identified if it is a unique function of the distribution of the observables. The projection \(\bbeta^{*}\) is always identified — it is an explicit function of population moments. The structural \(\bbeta\) is identified only if the data pin it down uniquely; under endogeneity the structural equation alone does not, so we must add information.
To pin down \(\bbeta\) (\(k\) unknowns) you need \(k\) valid moment conditions \(\E[\mathbf{w}(y-\mathbf{x}'\bbeta)]=\mathbf{0}\) — a solvable linear system: \[\E[\mathbf{w}\,y]=\E[\mathbf{w}\,\mathbf{x}']\,\bbeta,\qquad\text{unique }\bbeta\iff \rank\big(\E[\mathbf{w}\mathbf{x}']\big)=k.\]
Definition 3 (Instrumental variable) A variable \(\mathbf{z}_i\) is a valid instrument for an endogenous \(\mathbf{x}_i\) if it satisfies
Think of the instrument as a lever on \(\mathbf{x}\).
Write exclusion as an expectation involving the parameter: \[\E\big[\mathbf{z}_i(y_i-\mathbf{x}_i'\bbeta)\big]=\E[\mathbf{z}_i\varepsilon_i]=\mathbf{0}.\] This single vector equation is the estimator — replace the expectation by its sample analogue and solve. For OLS the instrument is \(\mathbf{x}\) itself (\(\E[\mathbf{x}_i\varepsilon_i]=\mathbf{0}\)); when \(\mathbf{x}\) is endogenous we swap in \(\mathbf{z}\). This is the moment condition that returns, generalised to \(\E[g(W_i,\theta)]=\mathbf{0}\), as the foundation of GMM in Lecture 11.
Split the \(k\) regressors by their relation to the error, then build the instrument vector to match: \[\mathbf{x}_i=\begin{pmatrix}\mathbf{x}_{1i}\\[2pt]\mathbf{x}_{2i}\end{pmatrix},\qquad \underbrace{\E[\mathbf{x}_{1i}\varepsilon_i]=\mathbf{0}}_{k_1\text{ exogenous}},\quad \underbrace{\E[\mathbf{x}_{2i}\varepsilon_i]\neq\mathbf{0}}_{k_2\text{ endogenous}},\qquad k=k_1+k_2,\] \[\mathbf{z}_i=\begin{pmatrix}\mathbf{x}_{1i}\\[2pt]\mathbf{z}_{2i}\end{pmatrix},\qquad \underbrace{\mathbf{x}_{1i}}_{\text{included }(\ell_1=k_1)},\quad \underbrace{\mathbf{z}_{2i}}_{\text{excluded }(\ell_2)},\qquad \ell=\ell_1+\ell_2,\ \ \ell_1=k_1.\]
The first stage regresses the endogenous regressor on the instruments, \[\mathbf{x}_i=\boldsymbol{\Pi}'\mathbf{z}_i+\mathbf{v}_i,\qquad \boldsymbol{\Pi}=(\E[\mathbf{z}\mathbf{z}'])^{-1}\E[\mathbf{z}\mathbf{x}'].\] Substituting into the structural equation gives the reduced form of \(y\), \[y_i=\mathbf{z}_i'(\boldsymbol{\Pi}\bbeta)+(\mathbf{v}_i'\bbeta+\varepsilon_i),\] a regression of \(y\) on the exogenous \(\mathbf{z}\) — consistently estimable by OLS.
Definition 4 (IV estimator (exactly identified)) When \(\ell=k\) (exactly identified: \(\ell_2=k_2\) excluded instruments for the \(k_2\) endogenous regressors, with \(\mathbf{x}_1\) instrumenting itself), the sample moment condition \(\tfrac1n\sum_i\mathbf{z}_i(y_i-\mathbf{x}_i'\mathbf{b})=\mathbf{0}\) solves uniquely: \[\bb_{\text{IV}}=(\bZ'\bX)^{-1}\bZ'\bY,\qquad\text{scalar: } b_{\text{IV}}=\frac{\Cov(z,y)}{\Cov(z,x)}=\frac{\lambda}{\Pi}.\] The scalar form is literally reduced form \(\div\) first stage — \(\lambda=\) effect of \(z\) on \(y\), \(\Pi=\) effect of \(z\) on \(x\).
With \(\ell>k\) instruments (\(\ell_2>k_2\) excluded ones), each gives a valid IV — but one at a time wastes the others. Any linear combination of the \(\mathbf{z}\)’s is still a valid instrument; the best (most correlated with \(\mathbf{x}\)) is the first-stage OLS fit. Hence literally two OLS stages: \[\textbf{Stage 1: } \hat{\bX}=\bP_{\bZ}\bX,\quad \bP_{\bZ}=\bZ(\bZ'\bZ)^{-1}\bZ';\qquad \textbf{Stage 2: } \bb_{\text{2SLS}}=(\hat{\bX}'\hat{\bX})^{-1}\hat{\bX}'\bY.\] Since \(\bP_{\bZ}\) is symmetric and idempotent (\(\hat{\bX}'\hat{\bX}=\bX'\bP_{\bZ}\bX\), \(\hat{\bX}'\bY=\bX'\bP_{\bZ}\bY\)): \[\bb_{\text{2SLS}}=(\bX'\bP_{\bZ}\bX)^{-1}\bX'\bP_{\bZ}\bY.\]
Estimating the two OLS regressions separately gives the right point estimate but the wrong standard errors — the second stage treats \(\hat{\bX}\) as data and ignores that it was estimated. Always use a 2SLS command (ivreg, feols(... | ...), ivregress), which corrects the variance.
Let \(D_i\in\{0,1\}\) be an endogenous treatment (people select into it) and \(z_i\in\{0,1\}\) a binary instrument. The IV estimator becomes the Wald estimator, \[b_{\text{IV}}=\frac{\bar y_{\,z=1}-\bar y_{\,z=0}}{\bar D_{\,z=1}-\bar D_{\,z=0}} =\frac{\text{reduced-form effect of }z\text{ on }y}{\text{first-stage effect of }z\text{ on }D}.\]
Oversubscribed KIPP charter schools admit by lottery: winning the lottery \(z\in\{0,1\}\) is randomly assigned, a textbook-clean instrument for actually attending \(D\in\{0,1\}\) (not every winner enrols, and losers rarely attend). 2SLS of test scores on attendance, instrumented by the lottery offer, estimates KIPP’s effect — a LATE for the students whose enrolment the lottery moves (Angrist et al. 2012). (Angrist–Krueger’s quarter-of-birth returns in Lecture 10 as the weak-instrument cautionary tale.)
Label each unit by how its treatment would respond to the binary instrument — its potential treatments \((D_i(0),D_i(1))\). Read through the Vietnam draft (Angrist 1990): \(z=\) draft-eligible (random lottery number), \(D=\) served, \(y=\) earnings.
| \(D_i(0)\,\backslash\,D_i(1)\) | \(D_i(1)=0\) | \(D_i(1)=1\) |
|---|---|---|
| \(D_i(0)=0\) | never-taker | complier |
| \(D_i(0)=1\) | defier | always-taker |
Under random \(z\), exclusion, relevance, and monotonicity (no defiers), the Wald ratio identifies the average treatment effect on compliers: \[\frac{\E[y\mid z=1]-\E[y\mid z=0]}{\E[D\mid z=1]-\E[D\mid z=0]}=\E[\,y_1-y_0\mid\text{complier}\,]\equiv\textbf{LATE}.\]
Hansen, Econometrics, ch. 12; Greene, ch. 8.