Non-FictionStudent's ShortcutInstrumental Variables

Instrumental Variables Excel Guide eBook

Uses two-stage least squares approximations in Exc

by Neil Vernon

  • English
  • 146 pages
  • 2026
  • SamEnrico

Uses two-stage least squares approximations in Excel to address endogeneity in economics exam regression questions.

Formats

Free sample

Chapter 1: The Broken Slope...--–- It was 2:47 AM when Sarah, a third-year economics student, stared at her Excel screen and wondered if she had chosen the wrong major. Her regression output looked beautiful – an R-squared of 0.82, t-statistics above 3, and a coefficient on "years of education" that suggested each additional year of schooling increased wages by 14 percent. The problem? Her professor had just returned a practice exam with a single, devastating comment scrawled in red pen: "OLS is inconsistent here. You've estimated correlation, not causation.

The unobserved 'ability' variable is correlated with education. Your entire answer is wrong."Sarah had done everything right. She had run Data Analysis > Regression. She had checked residuals. She had even added control variables for age, gender, and parental education.

But none of that mattered because she had violated the most fundamental assumption of ordinary least squares: that the error term is uncorrelated with the independent variable. In econometrics jargon, she had an endogeneity problem. In plain English, her regression had lied to her.This chapter is for every student who has ever felt like Sarah. You will learn why OLS fails when causality runs both directions, why "controlling for everything" doesn't solve the problem, and – most importantly – how a clever tool called an Instrumental Variable (IV) can rescue your analysis. By the end of this chapter, you will have simulated endogeneity in Excel, watched OLS fail in real-time, and understood exactly why you need the two-stage least squares (2SLS) method that the rest of this book will teach you, step by step, click by click.1.1 The Exam Question That Started It All Every economics student encounters some version of this exam prompt:"You want to estimate the causal effect of years of education on annual wages.

However, you cannot observe 'innate ability' in your dataset. Ability is correlated with both education (smarter people stay in school longer) and wages (smarter people earn more). Explain why OLS will produce biased estimates. Then propose a solution."This question appears on exams at Harvard, the London School of Economics, the University of Chicago, and thousands of other institutions worldwide. It is the cockroach of econometrics – impossible to kill and always showing up when you least expect it.

The reason it persists is that it exposes the central tension of empirical economics: we want causal estimates, but we usually only have correlational data.Let's break down exactly what the prompt is telling you.The True Relationship You Want to Estimate Imagine, for a moment, that you lived in a perfect world where you could observe everything. You would write the following regression:Wagei=β0+β1Educationi+β2Abilityi+εi Wage_i = \beta_0 + \beta_1 Education_i + \beta_2 Ability_i + \varepsilon_i Wagei​=β0​+β1​Educationi​+β2​Abilityi​+εi​Where:Wagei Wage_i Wagei​ is person iii's annual earnings Educationi Education_i Educationi​ is years of schooling Abilityi Ability_i Abilityi​ is their innate cognitive ability (which you cannot see)εi\varepsilon_iεi​ is random error (luck, health shocks, etc.)In this perfect world, β1\beta_1β1​ is the causal effect of education on wages: holding ability constant, how much more does an additional year of school earn you?The Problem: You Cannot See Ability But you do not live in a perfect world. Your dataset contains Wagei Wage_i Wagei​ and Educationi Education_i Educationi​, but Abilityi Ability_i Abilityi​ is unobserved. So you run the regression you can run:Wagei=β0+β1Educationi+ui Wage_i = \beta_0 + \beta_1 Education_i + u_i Wagei​=β0​+β1​Educationi​+ui​Where ui=β2Abilityi+εiu_i = \beta_2 Ability_i + \varepsilon_iui​=β2​Abilityi​+εi​ (the error term now contains ability).The critical question: Is Educationi Education_i Educationi​ correlated with uiu_iui​?Common sense says yes. Students with higher ability tend to enjoy school more, get better grades, and stay enrolled longer.

So Cov(Education,Ability)>0Cov(Education, Ability) > 0Cov(Education,Ability)>0. Since uuu contains Ability Ability Ability, this means Cov(Education,u)>0Cov(Education, u) > 0Cov(Education,u)>0.The Mathematical Consequence When Cov(X,u)≠0Cov(X, u) \neq 0Cov(X,u)=0, OLS becomes inconsistent. The bias does not disappear as your sample size grows. In fact, the OLS estimator converges to:β^OLS→pβ1+Cov(Education,Ability)Var(Education)⋅β2\hat{\beta}_{OLS} \xrightarrow{p} \beta_1 + \frac{Cov(Education, Ability)}{Var(Education)} \cdot \beta_2β^​OLS​p​β1​+Var(Education)Cov(Education,Ability)​⋅β2​This is called omitted variable bias. The sign and magnitude depend on the correlation between the omitted variable and the included variable, and the effect of the omitted variable on the outcome.

In the education-wage case, both correlations are positive, so OLS overestimates the true return to education.Sarah's beautiful regression output that showed a 14% return? The true causal return might be only 8%. She had overestimated by 6 percentage points – a 75% bias. That's the difference between passing and failing an exam.1.2 Seeing Is Believing: Simulating Endogeneity in Excel Theory is important, but you will not truly understand endogeneity until you see it happen with your own eyes, in your own spreadsheet. This section walks you through a simulation that demonstrates exactly how OLS fails.Step 1: Set Up Your Simulation Parameters Open a new Excel workbook.

In cells A1 through A5, enter the following parameters:Cell Value Description A1"True Beta (Education)"B10.08True causal effect (8% return)A2"True Beta (Ability)"B20.05Effect of ability on wages A3"Correlation (Ed, Ability)"B30.6How correlated are education and ability?A4"Sample Size"B4500Number of observations A5"Standard Deviation (Error)"B50.5Random noise in wages These parameters describe the true data-generating process. The world works like this, but you – the econometrician – only see part of it.Step 2: Generate Three Correlated Variables We need to create Education, Ability, and Wage such that:Education and Ability have correlation 0.6Wage = 0.08 * Education + 0.05 * Ability + random error Excel does not have a built-in function to generate correlated random variables, but we can use a simple method called the Cholesky approach. Enter these formulas:Column A (ID): In A8, enter 1. In A9, enter =A8+1 and drag down to row 508 (for 500 observations).Column B (Random Standard Normal 1): In B8, enter =NORM.S.INV(RAND()). Drag down to B508.Column C (Random Standard Normal 2): In C8, enter =NORM.S.INV(RAND()).

Drag down to C508.Column D (Ability): In D8, enter =B8. (We will leave ability as pure random for now.) Drag down.Column E (Education): This is where the correlation happens. In E8, enter:text Copy Download=B3*B8 + SQRT(1-B3^2)*C8This creates a variable that has correlation B3 (0.6) with ability. Drag down.Column F (Random Error): In F8, enter =NORM.S.INV(RAND())*$B$5. Drag down.Column G (Wage): In G8, enter:text Copy Download=$B$1*E8 + $B$2*D8 + F8Drag down.What you have just created: A dataset where the true causal effect of education on wage is 8%, but education and ability are correlated at 0.6.

You know the truth because you designed it. Now watch OLS get it wrong.Step 3: Run OLS and Watch It Fail You will run two regressions:First, the "full" regression (which you cannot actually run in reality because you lack ability data):Dependent variable (Y): Wage (Column G)Independent variables (X): Education (Column E) and Ability (Column D)Second, the "restricted" regression (what you can actually run):Dependent variable (Y): Wage…

This is the end of the free sample. Get the eBook to keep going. Buy now

About this book

Uses two-stage least squares approximations in Excel to address endogeneity in economics exam regression questions.

Details

Author
Neil Vernon
Publisher
SamEnrico
Language
English
Genre
Non-Fiction, Student's Shortcut, Instrumental Variables
Released
2026-05-29
Pages (approx.)
146
Available as
eBook, Audiobook

Read better in the ZLOADR app

Your eBooks on your phone or tablet. Sign in with your SamEnrico account and start reading.

More by Neil Vernon

See all

You may also like

See all