OpenEconometrics

Teaching labs

80 English labs in four courses. Each lab pairs an economic question with equations, a synthetic Excel dataset and a complete Python analysis you can run in OpenEconometrics. All material is original and free under Apache 2.0.

  1. Download the lab's Excel workbook and keep its file name.
  2. Import the workbook into OpenEconometrics.
  3. Open the lab's Python file in a new document and run the whole file.

Student editions include an offline course, a reading PDF, workbooks, scripts, figures and LaTeX tables. Instructor editions add worked answers. See the release on GitHub

Econometrics

Regression, policy evaluation and introductory time series. 20 labs.

  1. 01

    The Economic Question Comes First

    Research questions, observational units, data types and study design.

    HandoutPythonExcel
  2. 02

    A First Look at Wages

    Descriptive statistics, distributions and clear exploratory plots.

    HandoutPythonExcel
  3. 03

    What Changes Across Random Samples?

    Sampling variation, standard errors and the central limit theorem.

    HandoutPython
  4. 04

    Does Class Size Predict Test Scores?

    Simple OLS with robust inference.

    HandoutPythonExcel
  5. 05

    How Precise Is Our Estimate?

    Confidence intervals, t tests and the difference between precision and importance.

    HandoutPythonExcel
  6. 06

    What Changes When We Add Controls?

    Multiple regression, omitted variable bias and same-sample comparisons.

    HandoutPythonExcel
  7. 07

    Do Groups Have Different Wage Profiles?

    Indicator variables, interactions and conditional comparisons.

    HandoutPythonExcel
  8. 08

    Modeling Percentage Changes and Curvature

    Log transformations, polynomial terms and interpretation.

    HandoutPythonExcel
  9. 09

    Same Coefficient, Different Standard Error?

    Heteroskedasticity and robust covariance estimation.

    HandoutPythonExcel
  10. 10

    Testing Several Claims Together

    Joint restrictions, F/Wald tests and specification questions.

    HandoutPythonExcel
  11. 11

    Comparing Firms to Themselves

    Panel data, fixed effects and cluster-robust uncertainty.

    HandoutPythonExcel
  12. 12

    Explaining Labor-Force Participation

    Linear probability, logit/probit models and marginal effects.

    HandoutPythonExcel
  13. 13

    Estimating Effects with an Instrument

    IV/2SLS, relevance, exclusion and weak-instrument limitations.

    HandoutPythonExcel
  14. 14

    Evaluating a Randomized Training Program

    Random assignment, treatment contrasts and uncertainty.

    HandoutPythonExcel
  15. 15

    Before and After a Policy Reform

    Difference-in-Differences, parallel trends and treatment-unit clustering.

    HandoutPythonExcel
  16. 16

    What Happens Around an Eligibility Cutoff?

    Regression discontinuity, bandwidths, continuity and local effects.

    HandoutPythonExcel
  17. 17

    The Trap of Trending Series

    Stationarity, unit roots and spurious regression.

    HandoutPythonExcel
  18. 18

    Accounting for Persistent Shocks

    Serial correlation and HAC inference.

    HandoutPythonExcel
  19. 19

    Forecasting Inflation Without Looking Ahead

    Autoregressive models, time-ordered evaluation and forecast errors.

    HandoutPythonExcel
  20. 20

    From Research Question to Finished Report

    Capstone: design, data, estimation, diagnostics and reproducible reporting.

    HandoutPythonExcel

Statistics

Data, probability, sampling, intervals, tests and reporting. 20 labs.

  1. 01

    What Does One Row Represent?

    Observational units, measurement scales and missing values.

    HandoutPythonExcel
  2. 02

    Which Average Answers the Question?

    Mean, median, geometric mean and the influence of a tail.

    HandoutPythonExcel
  3. 03

    How Variable Are Delivery Times?

    Sample variance, standard deviation, IQR and rescaling.

    HandoutPythonExcel
  4. 04

    Which Denominator Belongs in a Probability?

    Joint, marginal and conditional event frequencies.

    HandoutPythonExcel
  5. 05

    What Does a Quality Alert Tell Us?

    Bayes theorem, sensitivity, specificity and base rates.

    HandoutPythonExcel
  6. 06

    How Many Orders Arrive in Ten Offers?

    Binomial probabilities, expectation and variance.

    HandoutPythonExcel
  7. 07

    From Parcel Weights to Standard Scores

    Normal models, standardization and model versus observed tails.

    HandoutPythonExcel
  8. 08

    Why Do Averages Vary Less Than Observations?

    Repeated sampling, standard errors and the CLT.

    HandoutPythonExcel
  9. 09

    What Does a Confidence Interval Cover?

    Student-t intervals, coverage and interval width.

    HandoutPythonExcel
  10. 10

    Is the Filling Process Centered on Its Target?

    Null hypotheses, t statistics, p values and practical importance.

    HandoutPythonExcel
  11. 11

    How Uncertain Is an Opt-In Rate?

    Proportion z tests, Wald and Wilson intervals.

    HandoutPythonExcel
  12. 12

    Comparing Two Delivery Methods

    Independent samples, Welch uncertainty and group order.

    HandoutPythonExcel
  13. 13

    The Same Workers Before and After

    Pairing, complete pairs and the variance of differences.

    HandoutPythonExcel
  14. 14

    Did Two Messages Produce Different Response Rates?

    Pooled null tests, unpooled intervals and percentage points.

    HandoutPythonExcel
  15. 15

    Do Study Hours and Scores Move Together?

    Pearson correlation, common samples and noncausal association.

    HandoutPythonExcel
  16. 16

    Are Shopping Channels and Membership Independent?

    Expected counts, Pearson chi-square and association size.

    HandoutPythonExcel
  17. 17

    Comparing Three Training Formats

    Between/within variation, ANOVA F and adjusted comparisons.

    HandoutPythonExcel
  18. 18

    Comparing Ordinal Customer Ratings

    Midranks, ties, rank-sum tests and probability of superiority.

    HandoutPythonExcel
  19. 19

    Resampling the Observed Baskets

    Nonparametric bootstrap, Monte Carlo error and percentile intervals.

    HandoutPythonExcel
  20. 20

    From a Question to a Statistical Report

    Primary outcomes, missingness, uncertainty and multiple testing.

    HandoutPythonExcel

Microeconomics

Consumer choice, production, markets, strategic interaction and welfare. 20 labs.

  1. 01

    Scarcity and Increasing Opportunity Cost

    Why does producing more of X require an increasing sacrifice of Y?

    HandoutPythonExcel
  2. 02

    Comparative Advantage and Trading Prices

    Can both economies gain from trade even when productivity comparisons differ by good?

    HandoutPythonExcel
  3. 03

    Market Equilibrium and a Demand Shift

    How does a demand shift differ from moving along a demand curve?

    HandoutPythonExcel
  4. 04

    Point Elasticity and Total Revenue

    When does raising price increase revenue?

    HandoutPythonExcel
  5. 05

    A Budget Line and Cobb–Douglas Choice

    How do preferences and a budget determine a consumption bundle?

    HandoutPythonExcel
  6. 06

    Income and Price Comparative Statics

    What changes when income rises, and what changes when only one price rises?

    HandoutPythonExcel
  7. 07

    Separating Substitution and Income Effects

    How much of a price response reflects substitution rather than lost purchasing power?

    HandoutPythonExcel
  8. 08

    Affordability and Revealed Preference

    What can observed choices reveal when another bundle was affordable?

    HandoutPythonExcel
  9. 09

    Marginal Product and Labor Demand

    When should a firm stop adding labor to a fixed technology?

    HandoutPythonExcel
  10. 10

    Total, Average and Marginal Cost

    Why does marginal cost cross average cost at its minimum?

    HandoutPythonExcel
  11. 11

    Cost Minimization with Two Inputs

    How can a firm produce a fixed output at minimum cost?

    HandoutPythonExcel
  12. 12

    Competitive Supply and Shutdown

    Why might a firm produce while making a loss?

    HandoutPythonExcel
  13. 13

    Monopoly Output, Markup and Welfare

    Why does a monopolist restrict output relative to a competitive benchmark?

    HandoutPythonExcel
  14. 14

    A Binding Price Ceiling and Rationing

    How can a lower legal price reduce total gains from trade?

    HandoutPythonExcel
  15. 15

    A Unit Tax: Incidence and Deadweight Loss

    Who bears a tax when the legal remitter is the seller?

    HandoutPythonExcel
  16. 16

    A Producer Subsidy and Overproduction

    Can buyers and sellers both gain while total surplus falls?

    HandoutPythonExcel
  17. 17

    An External Cost and a Corrective Tax

    How does an unpriced external cost change efficient output?

    HandoutPythonExcel
  18. 18

    Vertical Summation for a Public Good

    Why are public-good marginal benefits added vertically?

    HandoutPythonExcel
  19. 19

    Cournot Competition and the Number of Firms

    How does strategic quantity competition change with the number of firms?

    HandoutPythonExcel
  20. 20

    From a Demand Model to an Estimated Elasticity

    How can a log-demand coefficient be interpreted without confusing identification and fit?

    HandoutPythonExcel

Advanced Econometrics

Projection algebra, covariance, panel transformations, IV, likelihood and dynamic responses. 20 labs.

  1. 01

    The Frisch–Waugh–Lovell Identity

    Why can residualizing both outcome and exposure recover a controlled regression slope?

    HandoutPythonExcel
  2. 02

    An Exact Sample Omitted-Variable Decomposition

    How does omitting a correlated control change a regression coefficient?

    HandoutPythonExcel
  3. 03

    Measurement Error and Attenuation

    Why can noisy exposure measurement shrink an ordinary regression slope?

    HandoutPythonExcel
  4. 04

    Collinearity, Coefficients and Stable Combinations

    Why can individual slopes be uncertain while their sum is estimated well?

    HandoutPythonExcel
  5. 05

    Leverage and Leave-One-Out Sensitivity

    How do unusual predictor values affect a fit and its uncertainty?

    HandoutPythonExcel
  6. 06

    Known Variance Weights and WLS

    How do inverse-variance weights change a least-squares fit?

    HandoutPythonExcel
  7. 07

    Clustered Errors and the Sampling Unit

    Which observations provide independent information when errors share a group shock?

    HandoutPythonExcel
  8. 08

    Serial Dependence and HAC Covariance

    How can uncertainty account for correlated scores over time?

    HandoutPythonExcel
  9. 09

    Joint Wald Restrictions with Robust Covariance

    Why is a joint test different from reading two individual p values?

    HandoutPythonExcel
  10. 10

    Delta-Method Inference for a Coefficient Ratio

    How should uncertainty be propagated through a nonlinear function of coefficients?

    HandoutPythonExcel
  11. 11

    Specification Changes and Common Samples

    When coefficients change after adding a control, how much came from changing rows?

    HandoutPythonExcel
  12. 12

    Centering a Polynomial without Changing Its Fit

    Why does centering change coefficients while leaving a polynomial fit unchanged?

    HandoutPythonExcel
  13. 13

    Fixed Effects as Dummies and Within Variation

    How do unit dummies recover the same slope as within-unit demeaning?

    HandoutPythonExcel
  14. 14

    First Differences and Their Error Structure

    What does differencing remove, and what dependence can it introduce?

    HandoutPythonExcel
  15. 15

    Instrumental Variables and the Projection Formula

    How does an instrument isolate exposure variation that is orthogonal to the structural error?

    HandoutPythonExcel
  16. 16

    Weak Relevance and IV Sensitivity

    What changes when an otherwise valid instrument barely predicts exposure?

    HandoutPythonExcel
  17. 17

    Logit Probabilities, Odds and Marginal Effects

    Why is a logit coefficient not a probability change?

    HandoutPythonExcel
  18. 18

    Poisson Rates with an Exposure Offset

    How can counts from different observation exposures be compared?

    HandoutPythonExcel
  19. 19

    Local Projections over Several Horizons

    How can horizon-specific regressions trace the response to an exogenous shock?

    HandoutPythonExcel
  20. 20

    A Reproducible Treatment-Effect Report

    How should a report retain its estimand, sensitivity specifications and full evidence?

    HandoutPythonExcel