The full academy launches January 2027. Join the waitlist for the $179 founding price.
Waldbauer Academy of Economics

Courses › Graduate Econometrics

Graduate · Module 8 of 15

Instrumental variables and two-stage least squares

Endogeneity and identification, 2SLS in matrix form, overidentification, weak instruments and robust inference, many-instrument bias, and how to argue for an exclusion restriction.

By Maximus S. Waldbauer · About 6 to 7 hours, including the problem set and quiz.

OLS consistently estimates the best linear predictor, but many economic questions are about structural or causal parameters: how much quantity demanded falls when a café raises its price, how much an extra year of school raises earnings. When the regressor of interest is correlated with the structural error, OLS converges to the wrong number. Instrumental variables (IV) use a source of variation in the regressor that is unrelated to the error to recover the parameter.

Statistics and Econometrics introduced IV with one instrument and the Wald ratio. This module treats IV as a GMM estimator in matrix form: identification, two-stage least squares, overidentification tests, and the problems that dominate modern practice, namely weak instruments, many instruments, and the credibility of exclusion restrictions. Module 12 returns to IV when effects differ across people.

By the end of this module you will be able to

What this module covers

  1. Endogeneity
  2. Instruments and identification
  3. Two-stage least squares
  4. Weak instruments
  5. Many instruments and the credibility of exclusion
  6. Problem set with step-by-step solutions
  7. Module quiz

Lesson 8.1 Free lesson

Endogeneity

Write the structural equation y = x′β + u, where β is the parameter we care about and u collects everything else that affects y. A regressor is endogenous if it is correlated with u. Then E[xu] ≠ 0 and OLS converges to β + E[xx′]−1E[xu] ≠ β. Three mechanisms produce endogeneity.

Omitted variables

If ability raises both schooling and earnings and is not measured, it sits in u and is correlated with schooling. Module 1’s omitted-variable formula gives the probability limit of OLS.

Simultaneity

Prices and quantities are set together by supply and demand. Suppose demand for lattes is q = α − βp + ud and supply is q = γ + δp + us. A demand shock ud raises both quantity and price, so p is positively correlated with ud. Regressing q on p traces out neither curve: it mixes the demand slope with the supply slope, weighted by the relative variances of the two shocks.

Measurement error

Suppose the true regressor x* is measured with classical error, x = x* + e with e independent of everything else. Then y = βx* + u = βx + (u − βe), and the composite error is negatively correlated with x. OLS is attenuated toward zero:

plim β̂OLS = β × σx*2 / (σx*2 + σe2)

Worked example: Self-reported hours

Weekly hours of piano practice x* raise exam scores by β = 2 points per hour. Hours are self-reported with error: Var(x*) = 4 and Var(e) = 1.

Reliability ratio λ = 4/(4 + 1) = 0.8, so OLS converges to 0.8 × 2 = 1.6. More data do not help: the bias is in the probability limit.

Adding controls that are correlated with x* but not with e makes things worse: they absorb some of the true signal, and the share of what is left that is noise rises.

Key ideas

  • Endogeneity means E[xu] ≠ 0 for the structural error, making OLS inconsistent for β.
  • Sources: omitted variables, simultaneity and measurement error.
  • Classical measurement error in x attenuates OLS by the reliability ratio σx*2/(σx*2 + σe2).

Practice questions: Instrumental variables and two-stage least squares

Try these, then open each answer to check your work.

  1. 1.Classical measurement error in a regressor with reliability ratio 0.75 and true slope 2 makes OLS converge to
    1. 0.5
    2. 1.5
    3. 2
    4. 2.67
    Show answer

    Answer: B. Attenuation: 0.75 × 2 = 1.5.

  2. 2.Which condition for a valid instrument can be checked in the data?
    1. Exclusion from the structural equation
    2. Zero correlation with the structural error
    3. Monotonicity
    4. Relevance: correlation with the endogenous regressor
    Show answer

    Answer: D. Relevance shows up in the first stage; exclusion is an untestable assumption when there is one instrument per regressor.

  3. 3.Winning a lottery raises program enrolment by 0.4 and annual earnings by $800. What is the IV estimate of the effect of enrolment on earnings?
    1. $320
    2. $800
    3. $1,200
    4. $2,000
    Show answer

    Answer: D. Reduced form ÷ first stage = 800/0.4 = $2,000.

Problems with step-by-step solutions

  1. 4.A regressor is measured with error: Var(x*) = 9, Var(e) = 3, true β = 1.2. What does OLS converge to?
    Show step-by-step solution
    1. Reliability ratio 9/(9 + 3) = 0.75.
    2. plim β̂ = 0.75 × 1.2 = 0.9.
  2. 5.Demand q = 10 − p + ud, supply q = 2 + p + us, with independent shocks of variances σd2 and σs2. Solve for equilibrium p and find the probability limit of the OLS slope of q on p.
    Show step-by-step solution
    1. Equating: 10 − p + ud = 2 + p + us ⇒ p = 4 + (ud − us)/2 and q = 6 + (ud + us)/2.
    2. Cov(q, p) = (σd2 − σs2)/4 and Var(p) = (σd2 + σs2)/4.
    3. OLS slope → (σd2 − σs2)/(σd2 + σs2): −1 (demand) only if σd = 0, +1 (supply) only if σs = 0, and 0 with equal variances.

Get the full module

The complete module adds every lesson, interactive graphs, a full problem set with step-by-step solutions, and a quiz. The academy opens in January 2027: join the waitlist for the founding price (lifetime access for $179).

Join the waitlist Try a full module free

More practice: free practice questions for this course.