Business · A course in seventeen chapters

Econometrics: From Data to Cause and Effect

Does advertising raise sales, or do stores that sell more just advertise more? Does a training program raise wages? Will prices rise next quarter? Econometrics is the craft of answering questions like these with data. This course starts with a cloud of points and a straight line, and climbs, one chapter at a time, to the methods behind several Nobel prizes: instrumental variables, panel data, difference-in-differences, regression discontinuity, maximum likelihood, time series and modern causal inference. Every chapter opens with a live simulation you can break.

Start with Chapter 1 →The toolkit at a glance

Tap to drop a point into the fit.

What econometrics is for

Econometrics uses data to put numbers on economic relationships: how much demand falls when a price rises, how much a year of school adds to earnings, how fast inflation responds to interest rates. Its special strength is telling cause from coincidence when you can’t run an experiment, by finding comparisons that work like one. And it is honest about uncertainty: every estimate comes with a measure of how far off it could be.

The chapters

Each chapter starts with an interactive and a list of missions, then teaches the ideas from first principles with worked examples, practice problems with full answers and a short quiz. The course climbs in three stages, from a curious beginner to the level of a first-year graduate course.

  1. What Econometrics Is: Data, Models and Cause A beach town where ice cream seems to cause rescues, until you hold the weather fixed, and why a coin flip beats self-selection. ✓ Done
  2. Probability and Distributions Shape seven distributions, sample thousands of draws, and watch averages of lopsided data pile into a bell. ✓ Done
  3. Estimation and Inference A machine that builds 100 confidence intervals at a time, a dartboard of estimators, and p-values you can see. ✓ Done
  4. Simple Regression: Fitting a Line Drag points and watch least squares refit with every residual drawn as a square, then meet Galton’s regression to the mean. ✓ Done
  5. Inference in Regression Draw 20,000 samples, then break the assumptions one by one to see which cause bias and which only fool the standard errors. ✓ Done
  6. Multiple Regression and Omitted Variables Leave ability out of a wage regression and watch the bias match the omitted-variable formula, then turn a 3-D regression plane. ✓ Done
  7. Logs, Dummies and Interactions Fit four log and level models to one data set, read each slope in plain English, find a career’s peak and split lines with dummies. ✓ Done
  8. Heteroskedasticity and Robust Standard Errors Fan out the noise and run 2,000 samples: classic 95% intervals fall short while robust ones hold. ✓ Done
  9. Specification, Measurement Error and Outliers Blur a variable and watch the slope shrink, drag an outlier until it bends the line, and overfit a polynomial. ✓ Done
  10. Instrumental Variables and 2SLS Use college proximity to untangle schooling from ability, then weaken and break the instrument to see 2SLS fail. ✓ Done
  11. Panel Data: Fixed and Random Effects Follow cities over time: pooled OLS gets police and crime backward until fixed effects compares each city with itself. ✓ Done
  12. Difference-in-Differences and Event Studies Break parallel trends, read event studies, and watch two-way fixed effects get the sign wrong. ✓ Done
  13. Regression Discontinuity Measure the jump at a cutoff, balance bias against noise, and catch people gaming the line. ✓ Done
  14. Binary Outcomes: Logit, Probit and Maximum Likelihood Straight lines vs S-curves for yes-or-no data, and maximum likelihood climbed by hand. ✓ Done
  15. Time Series: Trends, Autocorrelation and Forecasting From white noise to random walks: memory, spurious regressions, forecasts and cointegration. ✓ Done
  16. VARs and GMM Shock a small economy, read impulse responses, and catch a bad instrument with GMM. ✓ Done
  17. Modern Causal Inference Causal diagrams, matching, synthetic twins and double machine learning. ✓ Done

The toolkit at a glance

The whole course on one sheet, in the notation of Wooldridge’s Introductory Econometrics: Greek letters are true values in the population, hats mark estimates from a sample, and û is a residual.

β̂₁ = Σ(xi − x̄)(yi − ȳ) ÷ Σ(xi − x̄)²
Ordinary least squares

The line that makes the sum of squared residuals as small as possible. With many regressors, β̂ = (X′X)⁻¹X′y.

Chapters 4 and 6
se(β̂₁) = σ̂ ÷ √SSTx
Standard error

How much the slope would wobble from sample to sample; σ̂² = SSR/(n − 2).

Chapter 5
t = (β̂j − βj) ÷ se(β̂j)
t statistic

How many standard errors an estimate is from a hypothesized value; beyond about ±2 is significant at 5%.

Chapter 5
R² = 1 − SSR ÷ SST
R-squared

The share of the variation in y the regression explains. A measure of fit, not of cause.

Chapter 4
E(β̃₁) = β₁ + β₂δ̃₁
Omitted-variable bias

Leave out x₂ and the slope on x₁ absorbs its effect β₂, times how x₂ moves with x₁ (δ̃₁).

Chapter 6
β̂IV = Cov(z, y) ÷ Cov(z, x)
Instrumental variables and 2SLS

Use only the part of x moved by an instrument z that affects y through x alone.

Chapter 10
ÿit = β₁ẍit + üit
Fixed effects

Subtract each unit’s own average over time, so every unit is compared only with itself.

Chapter 11
δ̂ = (ȳT,after − ȳT,before) − (ȳC,after − ȳC,before)
Difference-in-differences

The treated group’s change minus the comparison group’s change, assuming they would have trended alike.

Chapter 12
τ = limx↓c E(y | x) − limx↑c E(y | x)
Regression discontinuity

The jump in outcomes at a cutoff, comparing people just above it with people just below.

Chapter 13
P(y = 1 | x) = exβ ÷ (1 + exβ)
Logit

A model for yes-or-no outcomes that keeps probabilities between 0 and 1, fitted by maximum likelihood.

Chapter 14
yt = ρyt−1 + et, |ρ| < 1
AR(1)

Today depends on yesterday. With |ρ| < 1 shocks fade away; with ρ = 1 they last forever (a unit root).

Chapter 15

What to know first

To start: high-school algebra, comfort with a graph, and the summation sign Σ. Chapters 2 and 3 teach the probability and statistics the course needs from the beginning, so you don’t need a statistics class first. A little calculus helps in Chapter 4, where setting a derivative to zero finds the best-fitting line, but each step is shown.

For the later chapters: from Chapter 6 on, regressions with many variables are written with matrices, so some linear algebra pays off, and maximum likelihood in Chapter 14 uses logarithms and derivatives. For a refresher, the Math Ladder has courses on Probability and Statistics and Linear Algebra.

A short history

  1. 1805 and 1809

    Adrien-Marie Legendre published the method of least squares for fitting comets’ orbits; Carl Friedrich Gauss published it in 1809, said he had used it since 1795, and tied it to the normal curve of errors.

  2. 1886

    Francis Galton found that tall parents have children who are tall, but less so, and called it regression toward the mean. The method has been called regression ever since (Chapter 4).

  3. 1920s and 1930s

    R. A. Fisher developed maximum likelihood, popularized significance tests, and made random assignment the foundation of experiments in The Design of Experiments (1935). In 1930 Ragnar Frisch and others founded the Econometric Society; its journal, Econometrica, began in 1933.

  4. 1944

    Trygve Haavelmo’s “The Probability Approach in Econometrics” argued that economic data should be treated as draws from probability models, the basis of everything in this course. It earned him the Nobel prize in 1989.

  5. 1969

    The first Nobel memorial prize in economic sciences went to Ragnar Frisch and Jan Tinbergen “for having developed and applied dynamic models for the analysis of economic processes.”

  6. 2000

    James Heckman, “for his development of theory and methods for analyzing selective samples,” and Daniel McFadden, “for his development of theory and methods for analyzing discrete choice” (Chapter 14).

  7. 2003

    Robert Engle, “for methods of analyzing economic time series with time-varying volatility (ARCH),” and Clive Granger, “for methods of analyzing economic time series with common trends (cointegration)” (Chapter 15).

  8. 2011

    Thomas Sargent and Christopher Sims, “for their empirical research on cause and effect in the macroeconomy,” including the vector autoregressions of Chapter 16.

  9. 2021

    David Card, “for his empirical contributions to labour economics,” and Joshua Angrist and Guido Imbens, “for their methodological contributions to the analysis of causal relationships”: the natural experiments of Chapters 10 to 13.

To go further

Free courses and books

The standard textbooks

  • Introductory: J. M. Wooldridge, Introductory Econometrics: A Modern Approach (7th ed., 2020); J. H. Stock and M. W. Watson, Introduction to Econometrics (4th ed., 2019); J. D. Angrist and J.-S. Pischke, Mastering ’Metrics (2015).
  • Graduate: J. M. Wooldridge, Econometric Analysis of Cross Section and Panel Data (2nd ed., 2010); W. H. Greene, Econometric Analysis (8th ed., 2018); F. Hayashi, Econometrics (2000); J. D. Angrist and J.-S. Pischke, Mostly Harmless Econometrics (2009); J. D. Hamilton, Time Series Analysis (1994).
  • Causal inference: G. W. Imbens and D. B. Rubin, Causal Inference for Statistics, Social, and Biomedical Sciences (2015); S. Cunningham, Causal Inference: The Mixtape (2021) and N. Huntington-Klein, The Effect (2021), both also free to read online.

Sources

  • Wikipedia, List of Nobel Memorial Prize laureates in Economic Sciences (years and prize citations, as published by the Nobel Foundation).
  • S. M. Stigler, The History of Statistics: The Measurement of Uncertainty before 1900 (Harvard University Press, 1986): Legendre, Gauss and Galton.
  • F. Galton, “Regression Towards Mediocrity in Hereditary Stature,” Journal of the Anthropological Institute 15 (1886). R. A. Fisher, The Design of Experiments (1935). T. Haavelmo, “The Probability Approach in Econometrics,” Econometrica 12, supplement (1944).
  • J. M. Wooldridge, Introductory Econometrics: A Modern Approach, 7th ed. (Cengage, 2020), for the notation and the formulas on this page.
@teddyrookbook GitHub