Marginal

Econometrics

Regression from OLS to causal designs: interpreting and testing coefficients, specification, omitted variables, heteroskedasticity, logit and maximum likelihood, experiments, instruments, difference-in-differences, discontinuities, panel data and time series.

40 lessons in 4 units

Start your free trial14 days free. No card needed.
What you'll learn

40 lessons, one small step at a time

Each lesson states its goal, then works up to it in short steps with practice after each. A placement test at the start skips what you already know.

Regression

7 lessons
  1. The OLS estimatorFit a least-squares line by computing its slope and intercept, use it to predict, and relate the slope to the correlation and the units of the variables.
  2. Interpreting coefficientsPredict y and changes in y from a fitted line, read coefficients in their units, and judge when a slope can be read as a causal effect.
  3. Residuals & R²Compute residuals and use their properties, compute R² from sums of squares or from a correlation, and explain what R² does and does not show.
  4. Inference on coefficientsTest whether a regression coefficient differs from a hypothesized value, build its confidence interval, and tell statistical from economic significance.
  5. Multiple regressionPredict with a multiple regression, interpret each coefficient holding the others constant, and judge which controls help a causal comparison.
  6. OLS assumptionsMatch each OLS assumption to the problems that violate it, state what the Gauss–Markov theorem adds, and diagnose whether a problem biases the coefficients or only the standard errors.
  7. Where standard errors come fromCompute the standard error of a regression slope, and predict how noise, sample size and the spread of x change it.

Specification

15 lessons
  1. Dummy variables & interactionsRead dummy-variable coefficients as differences from a base group, and use interactions to find how one variable's effect differs between groups.
  2. Log-level modelsRead a log-level coefficient as a percentage effect, use the exact formula when the change is large, and judge when to log a variable.
  3. Log-log & level-log modelsRead a slope in each combination of logged and unlogged variables, compute effects in level-log and log-log models, and choose the form that answers a given question.
  4. Quadratic termsPredict with a quadratic regression, find the marginal effect of x at any value, and locate the turning point.
  5. Joint hypotheses & F-testsCompute an F-statistic from restricted and unrestricted fits, decide whether to reject the restrictions, and explain why a joint test beats separate t-tests.
  6. Omitted variable biasCompute omitted variable bias from the formula, sign it without numbers, and choose designs that remove it when the variable can't be measured.
  7. Heteroskedasticity & robust SEsRecognize heteroskedastic errors from context or a residual plot, and choose robust or clustered standard errors, knowing what they change and what they don't.
  8. The linear probability modelPredict probabilities and changes in them with a linear probability model, and explain its two flaws.
  9. Adjusted R²Compute adjusted R², use it to compare models of different sizes, and explain why choosing controls by fit is rarely right for causal questions.
  10. MulticollinearityCompute a variance inflation factor and how much it inflates a standard error, and recognize the symptoms of multicollinearity and the remedies that work.
  11. Measurement errorCompute how much noise in a regressor attenuates its slope, correct a slope for a known reliability, and tell where noise biases a regression and where it only adds imprecision.
  12. Sample selectionRecognize survivorship, self-selection and attrition, and tell which kinds of sample selection bias a regression and which do no harm.
  13. Logit & probitCompute logit and probit probabilities from a linear index, find marginal effects at a point on the S-curve, and read logit coefficients as odds ratios.
  14. Prediction & overfittingTell prediction questions from causal ones, compare models by their error on test data, and explain how regularization guards against overfitting.
  15. Maximum likelihoodCompute a likelihood, find maximum-likelihood estimates for yes/no and count data, and explain why the method is used and where its standard errors come from.

Causal Inference

12 lessons
  1. Randomized experimentsSplit an observed difference into a treatment effect and selection bias, estimate an average treatment effect and its standard error from an experiment, and identify the threats to an experiment.
  2. Instrumental variablesJudge whether a candidate instrument is relevant and exogenous, compute the Wald IV estimate, and explain why IV removes omitted variable bias.
  3. Difference-in-differencesCompute a difference-in-differences estimate from four group means, explain why each single difference is biased, and judge the parallel-trends assumption.
  4. Regression discontinuityRecognize settings for a regression discontinuity design, measure the jump at the cutoff, and spot the warning signs that the design fails.
  5. Panel data & fixed effectsEstimate an effect from changes within units, say what unit and time fixed effects absorb, and identify the confounders fixed effects cannot remove.
  6. Two-stage least squaresCompute a 2SLS estimate from the first stage and the reduced form, judge instrument strength with the first-stage F, and use several instruments and controls correctly.
  7. Compliance & LATECompute the intent-to-treat effect and scale it into the local average treatment effect, and state whose effect it measures and the assumption behind it.
  8. DiD as a regressionRead the coefficients of a difference-in-differences regression, rebuild the group means and the counterfactual from them, and extend the regression beyond two groups and two periods.
  9. Event studies & pre-trendsCompute event-study coefficients relative to a baseline period, read dynamic effects from them, and use pre-period coefficients to check parallel trends.
  10. Synthetic controlBuild a synthetic control from weighted donors, estimate an effect with it, and judge its credibility with pre-treatment fit and placebo tests.
  11. Matching & propensity scoresEstimate the effect on the treated by exact matching, weight comparisons with propensity scores, and explain why matching cannot fix unobserved differences.
  12. Simultaneity biasPredict which curve market data trace out when supply or demand shifts, and estimate a demand or supply slope with an instrument that shifts the other curve.

Time Series

6 lessons
  1. Time series basicsCompute differences, log growth rates, trend growth and moving averages, and recognize trends, seasons and persistence in a series.
  2. Autoregressive modelsForecast with an AR(1) model one and several periods ahead, find its long-run mean, and measure how fast shocks fade.
  3. StationarityCompute how a random walk's spread grows over time, tell stationary from non-stationary series, and avoid spurious regression.
  4. Forecast evaluationCompute the bias, MAE and RMSE of a set of forecast errors, and judge a model by its out-of-sample accuracy against a benchmark.
  5. Serial correlationRecognize serially correlated residuals and compute the Durbin–Watson statistic, and explain what serial correlation does to OLS and the routine fix.
  6. Granger causalityRun a Granger causality test with an F-statistic, and explain why it shows predictive content rather than causation.
Sample lesson

The OLS estimator

Goal: Fit a least-squares line by computing its slope and intercept, use it to predict, and relate the slope to the correlation and the units of the variables.

How much do earnings rise with each year of schooling? How much does demand fall when price rises? Regression answers questions like these by fitting a line through data, and ordinary least squares (OLS), the standard way to fit it, is the foundation of almost all empirical economics.

We will see what makes a line fit best, compute the OLS slope and intercept, predict with the line, and finish with how the slope relates to correlation and units.

Step 1: The best-fitting line

OLS chooses the intercept b₀ and slope b₁ of ŷ = b₀ + b₁x that make the sum of squared residuals as small as possible. A residual is the vertical distance between a point and the line. Squaring means big misses count a lot, and positive and negative misses don't cancel.

ŷyx

For the five points shown, the OLS line is ŷ = 1.09 + 0.97x, with a sum of squared residuals of about 0.091. A simpler line, ŷ = 1 + x, misses by 0.1, −0.1, 0.2, −0.2 and 0, a sum of squares of 0.10: close, but worse. No other line does better than OLS.

Step 2: The OLS formulas

Minimizing the sum of squared residuals with calculus gives

b₁ = Σ(xi − x̄)(yi − ȳ) ÷ Σ(xi − x̄)² = sxy ÷ sx²
b₀ = ȳ − b₁·x̄

The slope is the covariance of x and y divided by the variance of x; the intercept makes the line pass through the point of means. For the plotted data, x̄ = 3 and ȳ = 4, the products of deviations add to 9.7 and the squared x-deviations to 10, so b₁ = 0.97 and b₀ = 4 − 0.97 × 3 = 1.09.

Step 3: Predicting with the line

With the two coefficients in hand, the fitted line predicts y for any x:

ŷ = b₀ + b₁·x

In the plotted data, x = 6 gives a prediction of 1.09 + 0.97 × 6 = 6.91. With Cov(x, y) = 30, Var(x) = 10, x̄ = 5 and ȳ = 20, the slope is 3 and the intercept 20 − 15 = 5, so the prediction at x = 7 is 26.

Step 4: Slope, correlation and spread

Since r = sxy ÷ (sxsy), the slope can also be written

b₁ = r × sy ÷ sx

Example: r = 0.5, sy = 12 and sx = 4 give b₁ = 1.5. The slope has the sign of the correlation, but a strong correlation doesn't imply a steep slope: steepness depends on the units and spreads of y and x. Measuring x in thousands of dollars instead of dollars divides every x by 1,000 and so multiplies the slope by 1,000.

In the app, each step ends with practice questions, new ones every time, and the lesson comes back later in spaced reviews.

Start Econometrics

Lessons that need something you haven't learned yet bring it in first, from any course.

Start your free trial14 days free. No card needed.