Skip to content
We use only essential cookies to keep you signed in and remember your preferences. See our Cookie Policy.
TestStop
MocksPracticeResourcesIndiaBlogPricing
Sign in
Resources › Econometrics › 11. Endogeneity and instruments
Econometrics · Lesson 11 of 18

Endogeneity and instrumental variables

Everything so far assumed that the regressors are unrelated to the error. When they are not, OLS is biased and inconsistent, and no amount of data repairs it. This lesson shows the three ways it happens, introduces the instrument, a variable that moves the regressor without touching the error, and builds the estimator in two steps: the Wald ratio, and two-stage least squares. A lab with a known truth shows what an instrument repairs, and what a weak one does not.

← Econometrics moduleLesson 11 of 18 · about 55 minutes
1Multiple regression2Matrix form and Gauss-Markov3t and F tests4R² and adjusted R²5Dummies and interactions6Functional forms7Misspecification8Multicollinearity9Heteroscedasticity10Autocorrelation11Instrumental variables12Simultaneous equations13Panel data14Logit and probit15Unit roots16ARMA, VAR and cointegration17Test Atlas18Hard problems
A question to hold on to
Consider a regression model y = β₀ + βx + u where y is regressed on a dummy variable x (1 or 0), but the model is estimated by instrumental variables, with the indicator variable z as an instrument for x. Let ȳ₁ and ȳ₀ be the averages of y when z = 1 and z = 0; x̄₁ and x̄₀ the averages of x when z = 1 and z = 0; ȳ¹ and ȳ⁰ the averages of y when x = 1 and x = 0; z̄¹ and z̄⁰ the averages of z when x = 1 and x = 0. Then the IV estimate of β is: (A) (ȳ₁ − ȳ₀) ÷ (ȳ¹ − ȳ⁰); (B) (ȳ₁ − x̄₁) ÷ (ȳ₀ − x̄₀); (C) (ȳ₁ − ȳ₀) ÷ (x̄₁ − x̄₀); (D) (ȳ₁ − ȳ₀) ÷ (z̄¹ − z̄⁰).
GATE Economics (XH-C1) 2021Solved at the end ↓
New here?What is the Ashanagar survey?The invented household survey behind this page's examples: 600 households, generated from a model whose true coefficients we publish.

The Ashanagar survey is invented. The statistics modules used one district of 60 households. Econometrics needs more households and more variables, so this is a new, larger survey of 600 households in the same imaginary district: income, spending, household size, whether the household is in the town or a village, the head’s schooling and earnings.

Because we wrote the data-generating process, we know the true answers, and every lab can show whether a regression recovers them. Household spending, in thousands of rupees a month, was generated as 1 + 0.45 × income + 0.9 × household size + 1.5 × town + an error with standard deviation 2.5. A real survey never tells you its true coefficients. This one does, so you can see how close an estimate comes.

It also holds a variable, the head’s ability, that a real survey could not observe. It is kept so that the lessons on omitted variables can show what happens when it is left out. Every figure here is illustrative, not official statistics.

Households
600
Share in the town
41%
Mean monthly income
₹15.4 thousand
Mean monthly spending
₹12.6 thousand
Mean schooling of the head
8.2 years

How the module uses it →

In this guide
Lesson · about 55 minutes
  1. Why a correlated error breaks OLS
  2. The instrument idea
  3. The lab: truth, OLS and IV
  4. The Wald estimator and two-stage least squares
  5. Weak instruments and the tests
  6. The opening question, solved
  7. The lesson on one screen
  8. Check yourself
  9. Past papers, by level
01
The problem

Why a correlated error breaks OLS

A regressor is endogenous when it is correlated with the error term: Cov(x, u) ≠ 0. Then the zero conditional mean assumption of lesson 2 fails, and OLS converges, not to the true slope, but to

The inconsistency of OLS
plimbOLS​=β+Var(x)Cov(x,u)​
Bias that does not shrink as n grows. The sign is the sign of Cov(x, u).

There are three common sources, all met earlier:

  • Omitted variable (lesson 7): something in u moves with x. In the survey, the regression of earnings on schooling alone has a slope of 1.81, against 1.3 once ability and town are held fixed (1.3): schooling is correlated with the unobserved ability that sits in the error.
  • Measurement error in x (lesson 7): the recorded x contains noise that is also in the error of the equation, so the correlation of x with u is negative and the slope is attenuated.
  • Simultaneity (lesson 12): x and y determine each other, as in price and quantity, so x is correlated with the error of the y equation.

Adding more observations cannot help, because the bias is in what OLS converges to. And because OLS makes the residuals orthogonal to x by construction, the residuals cannot show you the problem. Only an outside source of variation can: an instrument.

02
The idea

The instrument idea

Suppose x is a mixture: some of its variation is tangled up with the error (ability, a shock to both), and some is not. An instrument z is a variable that moves x but is itself unrelated to the error. If you let only z-driven movement in x speak, you have isolated the clean part. Two conditions make z valid:

  • Relevance: Cov(z, x) ≠ 0. The instrument actually moves the regressor. This can be tested, in the first stage.
  • Exogeneity (the exclusion restriction): Cov(z, u) = 0. z affects y only through x, and is unrelated to the omitted factors. This cannot be tested when there is exactly one instrument per endogenous regressor; it has to be argued from the economics.

Examples of the kind of variable economists use: the distance from a person’s home to the nearest college, as an instrument for years of schooling (it shifts schooling, and should not otherwise affect earnings); rainfall, as an instrument for income in a poor agricultural economy; a randomly assigned offer of a programme, as an instrument for taking it up. In each case the argument for exogeneity is a story about the world, and critics attack it.

Derive it

Why OLS misses and IV hits: two probability limits

We want to show
In y = a + βx + u, OLS converges to β + Cov(x, u) ÷ Var(x), which is not β when x is correlated with u. With an instrument z (Cov(z, x) ≠ 0 and Cov(z, u) = 0), the IV slope Cov(z, y) ÷ Cov(z, x) converges to β.
  1. 1
    Write the OLS slope as the truth plus an error term.

    Substitute y = a + βx + u into the OLS formula Cov(x, y) ÷ Var(x):

    Var(x)Cov(x,y)​=β+Var(x)Cov(x,u)​

    The second term is zero when x and u are uncorrelated, and is the bias when they are not. In the survey regression of earnings on schooling alone, the error contains ability and town. Taking 3 + 1.3 × schooling as the true line, the error u* = earnings − 3 − 1.3 × schooling has Cov(schooling, u*) ÷ Var(schooling) = 0.507, and the OLS slope is 1.3 + 0.507 = 1.807, which is what the regression gives (1.807).

  2. 2
    Do the same with the instrument.

    The same substitution into the IV formula:

    Cov(z,x)Cov(z,y)​=β+Cov(z,x)Cov(z,u)​

    If z is uncorrelated with u (exogenous), the second term vanishes in large samples and the estimate converges to β. If z is only weakly correlated with x, Cov(z, x) in the denominator is small, and even a small correlation of z with u becomes a large error: that is the weak-instrument problem.

  3. 3
    With a 0/1 instrument, it is a ratio of differences.

    For a binary z, Cov(z, y) is proportional to the difference in the mean of y between the two groups, and likewise for x, so the factor cancels:

    β^​IV​=xˉz=1​−xˉz=0​yˉ​z=1​−yˉ​z=0​​

    This is the Wald estimator: the effect of z on y (the reduced form) divided by the effect of z on x (the first stage).

  4. 4
    A check on eight households.

    With z = 0, 0, 0, 0, 1, 1, 1, 1, x = 2, 3, 3, 4, 4, 5, 6, 5 and y = 5, 6, 8, 7, 9, 12, 13, 11: the mean of y is 6.5 for z = 0 and 11.25 for z = 1, and the mean of x is 3 and 5. The Wald estimate is (11.25 − 6.5) ÷ (5 − 3) = 2.375. The covariance ratio gives 2.375, and two-stage least squares gives 2.375. The three routes are one estimator.

Step 1 of 4
So
IV replaces the variation in x that is tangled up with u by the part of it that z causes. It trades bias for variance: dividing by Cov(z, x) makes the IV estimator noisier than OLS (its variance is the OLS variance divided by the squared correlation of x and z).
03
Interactive

The lab: truth, OLS and IV

In the lab, y = 1 × x + u, and x is built from the instrument z (strength π) plus a first-stage error v that is correlated (ρ) with u. Each press draws 1,500 samples. Start with ρ = 0.6 and a strong instrument: the blue OLS estimates are centred well above 1 and the gold IV estimates are centred on 1, but wider. Then lower π towards zero and watch the IV distribution spread out and slide towards the OLS bias.

True model: y = 1 × x + u. x = π z + v, where z is the instrument and u and v have correlation ρ, so x is endogenous. The slope we want is 1. The histograms show the estimate from 1500 samples.

Average OLS estimate (truth 1)1.479
Median IV estimate0.998
IV: share within 0.5 of the truth96%
OLS: share within 0.5 of the truth60%
First-stage F, on average26.1
Samples with F below 105%
95% interval holds the truth: OLS0%
95% interval holds the truth: IV95%
−1.5−1−0.50.511.522.533.5412345

Horizontal: the estimated slope in each sample. Vertical: how many samples gave that value.

OLS estimatesIV estimatesTrue value, 1
What it shows

OLS is centred on 1.48, not 1: the endogeneity bias, which more data cannot remove (its 95% interval holds the truth only 0% of the time). The instrument is strong (average first-stage F 26), so the IV estimates centre on the truth (median 1) and its intervals are honest (95%). The price is precision: the IV cloud is wider than the OLS one.

Watch out for

The mistakes examiners are fishing for

  • Using an instrument that is only correlated with x. Relevance is half the requirement. A variable that is correlated with the omitted factor is no better than x itself.
  • Thinking IV is always better than OLS. When x is exogenous OLS is more precise, and IV only adds noise. IV earns its place when OLS is inconsistent.
04
The estimators

The Wald estimator and two-stage least squares

With a single instrument the IV estimator is the ratio of two covariances (the reduced-form effect of z on y over the first-stage effect of z on x). When z is a 0/1 indicator this becomes the Wald estimator:

The Wald (IV) estimator for a binary instrument
β^​IV​=xˉz=1​−xˉz=0​yˉ​z=1​−yˉ​z=0​​
Differences are between the z = 1 and z = 0 groups, not between the x = 1 and x = 0 groups. The numerator is the effect of z on y, the denominator the effect of z on x.

The general method is two-stage least squares (2SLS), which handles several instruments, several endogenous regressors and extra exogenous controls:

  • Stage 1: regress each endogenous regressor on all the exogenous variables (the instruments and the included controls). Keep the fitted values x̂, the part of x that the instruments explain.
  • Stage 2: regress y on x̂ (and the same controls). The coefficient on x̂ is the 2SLS estimate.

With one instrument and one regressor, 2SLS equals the IV ratio exactly. Two cautions. Doing the second stage by hand gives the right coefficients but the wrong standard errors, because the residuals must be computed with the original x, not x̂; software does this correctly. And the equation must be identified: at least as many instruments as endogenous regressors (the order condition of lesson 12). With more instruments than endogenous regressors the model is over-identified and 2SLS uses them all optimally, and the surplus lets you test the instruments (below).

Pause and predict
In the Wald estimator for a binary instrument z, the denominator is
05
Checking an instrument

Weak instruments and the tests

  • Weak instruments. If z barely moves x, Cov(z, x) is near zero and the IV estimator, which divides by it, is erratic and biased towards OLS, and its standard errors cannot be trusted. The standard diagnostic is the first-stage F statistic for the excluded instruments: a rule of thumb says it should exceed about 10 (one instrument: t² above 10). The lab’s F readout shows what happens below it.
  • Hausman test for endogeneity. Is x endogenous at all? Compare OLS with IV: if x is exogenous, both are consistent and should be close; if not, they differ. A simple regression-based version adds the first-stage residual to the OLS regression and tests its coefficient: significance means x is endogenous. In simultaneous-equations language, the Hausman specification test checks whether an endogenous variable is correlated with the error term.
  • Sargan (over-identification) test. With more instruments than endogenous regressors, regress the 2SLS residuals on all the instruments: n × R² is chi-square with (instruments − endogenous regressors) degrees of freedom under the null that all the instruments are valid. A rejection says at least one instrument is correlated with the error. It cannot be run on a just-identified equation.

Remember what an instrument cannot do: it cannot create information. Without a credible instrument the honest statement is the one from lesson 1: the coefficient is a partial association, and a causal reading needs an argument about why the error is unrelated to x.

In economics

Correlation against causation is the heart of this lesson. A regression of y on x measures how y differs across values of x. It measures the effect of x only if the other determinants of y are unrelated to x. When they are not, you need either a randomised experiment (which makes x unrelated to everything by design), controls for every relevant variable (which you rarely have), or an instrument (which needs an assumption you cannot test).

What to say in an exam

If a regressor is correlated with the error, OLS is biased and inconsistent. An instrument must be relevant (correlated with the regressor) and exogenous (uncorrelated with the error). IV estimates the effect through the instrument; with a binary instrument it is the Wald ratio of the differences in y and in x. Two-stage least squares is the general version. A weak instrument makes IV unreliable.

06
Solving the opening question

The opening question, solved

GATE Economics (XH-C1) 2021 · hard
y = β₀ + βx + u with x a 0/1 dummy and z a 0/1 instrument for x. What is the IV estimate of β in terms of the group means?
  1. 1
    Write the IV formula.
    With one instrument, β̂ = Cov(z, y) ÷ Cov(z, x).
  2. 2
    Use the binary instrument.
    For a 0/1 variable z, Cov(z, y) = p(1 − p)(ȳ₁ − ȳ₀), where p is the share with z = 1 and ȳ₁, ȳ₀ are the means of y in the two z groups. Likewise Cov(z, x) = p(1 − p)(x̄₁ − x̄₀). The p(1 − p) factors cancel.
  3. 3
    Read off the ratio.
    β̂ = (ȳ₁ − ȳ₀) ÷ (x̄₁ − x̄₀): the differences are between the z groups, in the numerator and the denominator. Option A divides by a difference in y between the x groups, not a difference in x; D divides by a difference in z between the x groups, which is the wrong way round; B is not a ratio of differences at all.
Answer
(C) (ȳ₁ − ȳ₀) ÷ (x̄₁ − x̄₀), the Wald estimator.
07
Revise

The lesson on one screen

The lesson on one screen
Endogeneity
Cov(x, u) ≠ 0. Sources: omitted variable, measurement error, simultaneity. OLS converges to β + Cov(x, u) ÷ Var(x).
Valid instrument
Relevant: Cov(z, x) ≠ 0 (testable). Exogenous: Cov(z, u) = 0 (not testable with exactly one instrument).
IV estimator
Cov(z, y) ÷ Cov(z, x). Consistent for β. Larger variance than OLS.
Wald estimator
Binary z: (ȳ₁ − ȳ₀) ÷ (x̄₁ − x̄₀), the differences between the z groups.
2SLS
Stage 1: regress x on the instruments and controls, keep x̂. Stage 2: regress y on x̂ and the controls. Use software for the standard errors.
Identification
At least as many instruments as endogenous regressors. More: over-identified, testable by Sargan.
Weak instruments
First-stage F below about 10: IV is noisy, biased towards OLS, with unreliable standard errors.
Hausman test
Tests whether x is endogenous: compares OLS with IV, or tests the first-stage residual in the OLS regression.
08
Practice

Check yourself

0 of 13 correct so far

Compute

The size of the OLS bias
x has variance 1.5 and covariance 0.3 with the error. By how much does OLS over- or under-state β in large samples?
The Wald estimator
Mean y is 12 when z = 1 and 8 when z = 0. Mean x is 0.6 when z = 1 and 0.2 when z = 0. Find the IV estimate of the slope.
The IV ratio of covariances
Cov(z, y) = 0.9 and Cov(z, x) = 0.3. Find the IV slope.
Reduced form over first stage
The regression of y on the instrument z has slope 0.8 and the regression of x on z has slope 0.5. Find the IV estimate of the effect of x on y.
A first-stage F
With one instrument, the first-stage t statistic for z is 2.5. Find the first-stage F statistic. Is it above the rule-of-thumb 10?
Degrees of freedom of the over-identification test
An equation has one endogenous regressor and three instruments. Find the degrees of freedom of the Sargan test.
The Sargan statistic
The 2SLS residuals are regressed on all the instruments and controls, from 200 observations, with R² = 0.03. Find n R². (The 5% chi-square critical value for 2 df is 5.99.)
The price of IV
The correlation between x and the instrument z is 0.5. By what factor is the IV standard error larger than the OLS standard error for the same data? (The IV variance is the OLS variance divided by the squared correlation.)

Quick questions

1A regressor correlated with the error term makes OLS
2A valid instrument must be
3In two-stage least squares the first stage regresses
4Hausman's specification test is used to test whether
5A weak instrument
09
Real questions

Past papers, by level

Standard

Restricted against unrestricted regressions, reading output, and statement questions, up to GATE and IIT JAM level.

3 questionsPractise →
All 3 past-paper questions for this lesson, easiest first: practise the full set →

✦These are questions from the TestStop bank. A free account answers 10 a day, each with its worked solution; All-Access opens every set with no daily limit.

This lesson’s set is short because few papers ask about instruments; the exercises above cover the calculations. The simultaneous-equations version of the problem, and its identification conditions, is in lesson 12.

← Lesson 10Autocorrelation and the Durbin-Watson statisticLesson 12 →Simultaneous equations and identification

Read next

All resources →
EconometricsEconometrics 12: simultaneous equations, identification, order and rank conditionsStructural and reduced forms, why OLS fails when variables are determined together, the order and rank conditions with an interactive counter, exactly and over-identified equations, indirect least squares, 2SLS and recursive systems, with a supply-and-demand lab.Complete guide · 55 minEconometricsEconometrics 7: omitted variable bias, irrelevant variables, measurement error and RESETThe omitted-variable bias formula and its sign, why an irrelevant variable costs precision and not bias, attenuation from measurement error, a wrong functional form and Ramsey's RESET test, with a lab that breaks each assumption on purpose.Complete guide · 55 minEconometricsEconometrics for economics students, from multiple regression to time seriesA module in eighteen lessons, built on data where the truth is known: multiple regression, OLS in matrix form and the Gauss-Markov theorem, t and F tests, R squared, dummies, functional form and specification error, multicollinearity, heteroscedasticity and autocorrelation, endogeneity and instruments, simultaneous equations, panel data, binary outcomes, unit roots, ARMA, VAR and cointegration, then a test atlas that says which test fits which problem and the Delhi School's hardest questions, with graded past papers from every exam.Module · 935 min