Live notebooks

Run Python in the lesson

These JupyterLite-style notebooks are real `.ipynb` files students can download. They also run in the browser with Python, pandas, NumPy, and matplotlib so learners can execute cells and see results without installing anything.

Official Data

Official Data Observatory

Data structures, trends, and evidence

Python

Load official economic indicators from Ceteris Lab's server export endpoint, plot a time series, calculate growth rates, and discuss limitations.

Intermediate25 to 40 minRelated dataset: Official economic indicatorpandas, numpy, matplotlib
official datatime series plotgrowth rateslimitations

Module 0

Loading CSV Data in Python

Loading CSV data in Python

Python

Load wage_sample.csv, inspect rows, and identify variables in a DataFrame.

Beginner15 to 25 minRelated dataset: wage_sample.csvpandas, numpy
pandasCSV loadingDataFrame preview

Module 0

Descriptive Statistics in Python

Descriptive statistics in Python

Python

Calculate means, medians, standard deviations, and grouped wage summaries.

Beginner15 to 25 minRelated dataset: wage_sample.csvpandas, numpy
summary statisticsgroupbyinterpretation

Module 0

Creating Simple Graphs in Python

Creating simple graphs in Python

Python

Create a scatter plot that compares education and wages.

Beginner15 to 25 minRelated dataset: wage_sample.csvpandas, numpy, matplotlib
matplotlibscatter plotsvisual interpretation

Module 0

Mini Python Practice Lab

Mini Python practice lab

Python

Run a full beginner workflow: load, inspect, summarize, graph, and interpret.

Beginner15 to 25 minRelated dataset: wage_sample.csvpandas, numpy, matplotlib
workflowsummariesgraphs

Module 1

First Python Data Example

First Python data example

Python

Use Python to describe the wage and education relationship without overclaiming causality.

Intermediate25 to 40 minRelated dataset: wage_sample.csvpandas, numpy
correlationgrouped meanscareful interpretation

Module 2

Simple Regression in Python

Regression in Python

Python

Estimate wage on education, draw the fitted line, and read the coefficient output with a statsmodels-compatible fallback.

Intermediate25 to 40 minRelated dataset: wage_sample.csvpandas, numpy, statsmodels, patsy
OLSstatsmodels-readyfitted line

Module 2

Fitted Values and Residuals

Fitted values and residuals

Python

Calculate fitted wages, residuals, squared residuals, and residual plots from the wage regression.

Intermediate25 to 40 minRelated dataset: wage_sample.csvpandas, numpy, matplotlib
fitted valuesresidualsdiagnostic plots

Module 2

OLS and R-squared by Formula

Ordinary Least Squares intuition

Python

Compute the OLS slope, intercept, residual sum of squares, and R-squared step by step.

Intermediate25 to 40 minRelated dataset: wage_sample.csvpandas, numpy, statsmodels, patsy
OLS formulasSSRR-squared

Module 2

Module 2 Regression Project Template

Practice regression project

Python

A reusable project notebook students can edit to choose y and x, estimate the model, and write an interpretation.

Applied35 to 55 minRelated dataset: wage_sample.csvpandas, numpy
project workflowstudent templateinterpretation

Module 3

WAGE1 Multiple Regression

Multiple Regression in Python

Python

Estimate log wage on education, experience, and tenure when the WAGE1 file is installed.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
multiple regressionWAGE1statsmodels

Module 3

GPA1 Multiple Regression

Holding Other Factors Fixed

Python

Estimate college GPA on high-school GPA and ACT when the GPA1 file is installed.

Intermediate25 to 40 minRelated dataset: GPA1pandas, numpy, statsmodels, patsy
controlsGPA1coefficient interpretation

Module 3

Simple vs Multiple Regression

Simple Regression versus Multiple Regression

Python

Compare the education coefficient before and after adding experience and tenure controls.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
simple regressioncontrolscoefficient comparison

Module 3

Partialling-Out Demonstration

The Partialling-Out Interpretation

Python

Recover a multiple-regression coefficient by using the leftover part of education after controls.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, matplotlib
partialling outresidualsceteris paribus

Module 3

Omitted-Variable Bias Example

Omitted-Variable Bias

Python

Compare a short wage model with a controlled model and discuss the direction of omitted-variable bias.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
omitted-variable biascontrolsinterpretation

Module 3

VIF Calculation

Multicollinearity and VIF

Python

Calculate variance inflation factors for education, experience, and tenure.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
VIFmulticollinearityprecision

Module 3

Residuals and Fitted Values

Fitted Values and Residuals

Python

Create fitted values and residuals from a multiple-regression wage model.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, matplotlib
fitted valuesresidualsdiagnostics

Module 3

R-squared Comparison

Goodness of Fit in Multiple Regression

Python

Compare R-squared across nested models and separate fit from causal interpretation.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy
R-squaredmodel comparisonfit

Module 4

T Tests with WAGE1

Testing a Single Coefficient Against Zero

Python

Estimate a wage equation and test education, experience, and tenure with real t statistics.

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
t testsWAGE1statsmodels

Module 4

One-Sided and Two-Sided Tests

One-Sided and Two-Sided Tests

Python

Compare tail choices and hypothesis wording using GPA1.

Intermediate25 to 40 minRelated dataset: GPA1pandas, numpy, scipy
one-sided teststwo-sided testsp-values

Module 4

p-Values and Critical Values

p-Values for t Tests

Python

Use scipy to compute p-values and critical values from the t distribution.

Intermediate25 to 40 minRelated dataset: GPA1pandas, numpy, scipy
p-valuescritical valuesscipy

Module 4

Confidence Intervals

Confidence Intervals for Regression Coefficients

Python

Build confidence intervals from estimates, standard errors, and t critical values.

Applied35 to 55 minRelated dataset: WAGE1pandas, numpy, statsmodels, patsy
confidence intervalsWAGE1inference

Module 4

Linear Combinations

Testing One Linear Combination of Parameters

Python

Test whether two coefficients are equal using WAGE2.

Intermediate25 to 40 minRelated dataset: WAGE2pandas, numpy, statsmodels, patsy
linear combinationscoefficient equalityt_test

Module 4

F Tests for Exclusion Restrictions

F Tests for Exclusion Restrictions

Python

Compare restricted and unrestricted models and compute an F statistic.

Intermediate25 to 40 minRelated dataset: BWGHTpandas, numpy, statsmodels, patsy
F testsrestricted modelunrestricted model

Module 4

R-Squared F Test

R-Squared Form of the F Statistic

Python

Use R-squared values to compute the F statistic for valid exclusion restrictions.

Intermediate25 to 40 minRelated dataset: BWGHTpandas, numpy
R-squaredF statisticnested models

Module 4

General Linear Restrictions

General Linear Restrictions

Python

Use statsmodels f_test for restrictions beyond simple variable exclusion.

Intermediate25 to 40 minRelated dataset: HPRICE1pandas, numpy
general restrictionsf_testhousing data

Module 4

Reporting Regression Results

Reporting Regression Results Professionally

Python

Assemble coefficient, uncertainty, p-value, fit, and interpretation into a report table.

Intermediate25 to 40 minRelated dataset: CEOSAL2pandas, numpy, statsmodels, patsy
reportingregression tableprofessional interpretation

Module 4

Applied Inference Project

Applied Inference Project

Python

Run a complete inference workflow and draft a concise empirical report.

Applied35 to 55 minRelated dataset: WAGE1pandas, numpy
applied projectinference workflowreporting

Module 5

Consistency Simulation

What Consistency Means

Python

Simulate OLS under exogeneity and watch estimates concentrate as n grows.

Intermediate25 to 40 minRelated dataset: SIMULATIONpandas, numpy, scipy
consistencysimulationlarge samples

Module 5

OLS Inconsistency from Endogeneity

Inconsistency and Asymptotic Bias

Python

Show estimates converging to the wrong target when x and u are correlated.

Intermediate25 to 40 minRelated dataset: SIMULATIONpandas, numpy, scipy
inconsistencyendogeneitysimulation

Module 5

Omitted-Variable Inconsistency

Omitted Variable Inconsistency

Python

Compare true and omitted models as sample size grows.

Intermediate25 to 40 minRelated dataset: SIMULATIONpandas, numpy, scipy
omitted variablesprobability limitssimulation

Module 5

Asymptotic Normality

Large-Sample Inference without Normal Errors

Python

Show coefficient distributions becoming approximately normal under several error distributions.

Applied35 to 55 minRelated dataset: SIMULATIONpandas, numpy, scipy
asymptotic normalityCLTsimulation

Module 5

Nonnormal Errors and Large-Sample Inference

Large-Sample t and F Tests

Python

Use 401K to discuss bounded, nonnormal outcomes and approximate inference.

Applied35 to 55 minRelated dataset: 401Kpandas, numpy, scipy
nonnormalitylarge-sample tests401K

Module 5

Standard Errors Shrink with n

Asymptotic Standard Errors

Python

Estimate growing GPA2 subsamples and compare standard errors.

Intermediate25 to 40 minRelated dataset: GPA2pandas, numpy
standard errorssample sizeGPA2

Module 5

Histograms, Skewness, and Transformations

Histograms, Normality, and Transformations

Python

Compare WAGE1 residual histograms for wage and log(wage).

Intermediate25 to 40 minRelated dataset: WAGE1pandas, numpy, matplotlib
histogramsskewnesslog transformations

Module 5

LM Test with CRIME1

The Lagrange Multiplier Test

Python

Compute the n-R-squared LM statistic and compare it with exclusion-test logic.

Intermediate25 to 40 minRelated dataset: CRIME1pandas, numpy, statsmodels, patsy
LM testauxiliary regressionCRIME1

Module 5

Asymptotic Efficiency Simulation

Asymptotic Efficiency of OLS

Python

Compare OLS with an alternative consistent estimator in simulation.

Applied35 to 55 minRelated dataset: SIMULATIONpandas, numpy, scipy
asymptotic efficiencysimulationestimator comparison

Module 5

Applied Asymptotics Project

Module 5 Applied Project

Python

Plan a complete large-sample inference workflow with simulations, diagnostics, and limitations.

Applied35 to 55 minRelated dataset: WAGE1pandas, numpy, scipy
applied projectasymptoticsreporting

Module 6

Scaling and Coefficient Interpretation

Why Units Matter in Multiple Regression

Python

Convert slopes across wage units and confirm that fitted relationships do not change when units are handled correctly.

Intermediate25 to 40 minRelated dataset: M6_WAGE_SCALINGpandas, numpy
scalingunit conversioncoefficient interpretation

Module 6

Standardized Betas

Standardized Coefficients

Python

Compare raw and standardized coefficients while avoiding causal importance rankings.

Intermediate25 to 40 minRelated dataset: M6_GPA_INTERACTIONSpandas, numpy
standardized betacomparisoninterpretation

Module 6

Log Models and Percent Changes

Level-Log and Log-Level Models

Python

Practice level-log, log-level, and log-log interpretations with exact percentage conversions.

Intermediate25 to 40 minRelated dataset: M6_SALES_ADVERTISINGpandas, numpy
log modelspercent changeselasticity

Module 6

Quadratic Turning Points

Quadratic Terms and Turning Points

Python

Estimate a quadratic model and calculate turning points and marginal effects.

Intermediate25 to 40 minRelated dataset: M6_HOUSING_LOGSpandas, numpy
quadraticsturning pointsmarginal effects

Module 6

Interaction Effects

Interactions between Continuous Variables

Python

Calculate interaction-based marginal effects at meaningful values.

Intermediate25 to 40 minRelated dataset: M6_GPA_INTERACTIONSpandas, numpy
interactionsdummy variablesmarginal effects

Module 6

Centering Interactions

Centering Variables before Interactions

Python

Show how centering changes coefficient meaning while preserving fitted values.

Intermediate25 to 40 minRelated dataset: M6_GPA_INTERACTIONSpandas, numpy
centeringinteractionscollinearity

Module 6

Adjusted R-Squared and Model Comparison

Adjusted R-Squared and Model Size

Python

Compare candidate specifications using adjusted R-squared and modeling logic.

Intermediate25 to 40 minRelated dataset: M6_POLICY_CONTROLSpandas, numpy, statsmodels, patsy
adjusted R-squaredmodel comparisoncontrols

Module 6

Bad Controls and Precision Controls

Over-Control and Bad Controls

Python

Distinguish harmful controls from safe precision controls.

Intermediate25 to 40 minRelated dataset: M6_POLICY_CONTROLSpandas, numpy, statsmodels, patsy
bad controlsprecision controlsdesign

Module 6

Prediction and Prediction Intervals

Prediction with Multiple Regression

Python

Create fitted predictions and compare mean and individual prediction intervals.

Intermediate25 to 40 minRelated dataset: M6_STARTUP_PREDICTIONpandas, numpy
predictionprediction intervalsuncertainty

Module 6

Log Prediction and Smearing

Predictions when the Dependent Variable Is Logged

Python

Compare naive and smearing-adjusted retransformation from log outcomes.

Intermediate25 to 40 minRelated dataset: M6_HOUSING_LOGSpandas, numpy
log predictionsmearingretransformation

Module 6

Bootstrap Standard Errors Project

Module 6 Applied Forecasting Project

Python

Bootstrap a coefficient and write a careful interpretation with uncertainty.

Applied35 to 55 minRelated dataset: M6_WAGE_SCALINGpandas, numpy
bootstrapstandard errorsproject

Module 7

Binary Variables

Creating Binary Variables

Python

Create and audit binary indicators from transparent rules.

Intermediate25 to 40 minRelated dataset: MODULE7_STUDENT_COMPLETION_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Group Mean Comparisons

Comparing Two Means with Regression

Python

Show how a dummy-only regression reproduces a two-group mean difference.

Intermediate25 to 40 minRelated dataset: MODULE7_WAGE_GROUPS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Dummy Variables in Log Models

Dummy Variables in Log-Dependent Models

Python

Convert log-dummy coefficients using approximate and exact percentages.

Intermediate25 to 40 minRelated dataset: MODULE7_WAGE_GROUPS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Multiple Categories

Multiple Categories

Python

Encode categories with a base group and compare coefficient meanings.

Intermediate25 to 40 minRelated dataset: MODULE7_CATEGORY_EFFECTS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Dummy Interactions

Binary by Binary Interactions

Python

Interpret binary-by-binary interactions as conditional group differences.

Intermediate25 to 40 minRelated dataset: MODULE7_WAGE_GROUPS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Different Slopes and Centering

Binary by Continuous Interactions

Python

Estimate group-specific slopes and show how centering changes the reference point.

Intermediate25 to 40 minRelated dataset: MODULE7_WAGE_GROUPS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Chow-Style Group Difference Tests

Full Regression Differences Across Groups

Python

Use interaction restrictions to test full group differences.

Intermediate25 to 40 minRelated dataset: MODULE7_WAGE_GROUPS_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Linear Probability Model

Linear Probability Model

Python

Estimate an LPM and interpret coefficients as probability-point changes.

Intermediate25 to 40 minRelated dataset: MODULE7_STUDENT_COMPLETION_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

LPM Robust Standard Errors

Limitations of the Linear Probability Model

Python

Inspect fitted probabilities and use HC1 robust standard errors.

Intermediate25 to 40 minRelated dataset: MODULE7_LOAN_APPROVAL_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Policy Evaluation and Self-Selection

Policy Evaluation and Self-Selection

Python

Compare randomized and self-selected treatment comparisons.

Intermediate25 to 40 minRelated dataset: MODULE7_PROGRAM_EVALUATION_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Discrete Dependent Variables

Discrete Dependent Variables

Python

Describe count outcomes and explain why discrete models may be needed later.

Intermediate25 to 40 minRelated dataset: MODULE7_DISCRETE_OUTCOME_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 7

Module 7 Capstone

Module 7 Capstone

Python

Complete a full qualitative-variable modeling checklist.

Intermediate25 to 40 minRelated dataset: MODULE7_STUDENT_COMPLETION_SYNTHETICpandas, numpy, statsmodels, patsy
dummy variablesqualitative informationPythonstatsmodels

Module 8

Simulating Heteroskedasticity

What Is Heteroskedasticity?

Python

Generate and visualize changing variance.

Intermediate25 to 40 minRelated dataset: MODULE8_INCOME_SAVINGS_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Conventional versus Robust Standard Errors

Robust Standard Errors

Python

Compare conventional, HC0, HC1, HC2, and HC3 standard errors.

Intermediate25 to 40 minRelated dataset: MODULE8_ROBUST_SE_DEMOpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Breusch-Pagan Test

The Breusch-Pagan Test

Python

Run and manually audit the Breusch-Pagan workflow.

Intermediate25 to 40 minRelated dataset: MODULE8_INCOME_SAVINGS_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

White Test

The White Test

Python

Use full and fitted-value White diagnostics.

Intermediate25 to 40 minRelated dataset: MODULE8_HOUSING_VARIANCE_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Robust Joint Tests

Robust Joint Tests

Python

Test multiple restrictions with robust covariance.

Intermediate25 to 40 minRelated dataset: MODULE8_ROBUST_SE_DEMOpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Weighted Least Squares

Weighted Least Squares Intuition

Python

Choose inverse-variance weights and compare OLS with WLS.

Intermediate25 to 40 minRelated dataset: MODULE8_INCOME_SAVINGS_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Population and Group-Size Weights

Group Means, Population Weights, and Aggregated Data

Python

Use group size as a precision weight.

Intermediate25 to 40 minRelated dataset: MODULE8_WLS_GROUP_MEANSpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Feasible GLS

Feasible GLS

Python

Estimate a variance function and fit FGLS.

Intermediate25 to 40 minRelated dataset: MODULE8_FGLS_DEMOpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Robust Standard Errors after WLS

What If the WLS Variance Model Is Wrong?

Python

Compare WLS conventional and robust standard errors.

Intermediate25 to 40 minRelated dataset: MODULE8_FGLS_DEMOpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Prediction Intervals with Changing Variance

Prediction under Heteroskedasticity

Python

Plot prediction intervals under changing variance.

Intermediate25 to 40 minRelated dataset: MODULE8_HOUSING_VARIANCE_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

LPM Robust Inference

The Linear Probability Model Revisited

Python

Estimate a linear probability model with HC1 robust standard errors.

Applied35 to 55 minRelated dataset: MODULE8_BINARY_OUTCOME_LPMpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels

Module 8

Module 8 Capstone

Module 8 Capstone

Python

Complete a full diagnostic and correction workflow.

Intermediate25 to 40 minRelated dataset: MODULE8_INCOME_SAVINGS_SYNTHETICpandas, numpy, statsmodels, patsy
heteroskedasticityrobust standard errorsPythonstatsmodels