Examples

Each page goes with a script in the repository’s examples/ folder and shows its output. Every script runs on the American Community Survey: California’s people aged 25 to 64 in the 2023 Public Use Microdata Sample, about 200,000 people and 150,000 workers. The scripts’ acs_data.py downloads the file from the Census Bureau the first time (70 MB) and builds the columns they use; every predictor is a code, entered as a categorical (C(education)), so a model of wages has about 2,000 indicator columns.

Page

What it shows

Quickstart

A cross-validated lasso of wages, and the gender wage gap by post-double-selection. Start here.

Prediction

The lasso, ridge and elastic net on the same folds; lambda_min, lambda_1se and the BIC; held-out error; the group lasso; fixed effects; a table.

A binary outcome

A lasso logit of employment: the deviance, predicted probabilities, calibration, a fixed effect.

A count or other nonnegative outcome

A lasso Poisson regression of commute time: rate ratios, predicted minutes, calibration, a fixed effect.

The effect of a variable

The gender gap after selecting controls: post-double-selection, double machine learning, the debiased lasso.

Instruments

The return to schooling, instrumented by quarter of birth: selected instruments, two estimates, the first-stage F, the sup-score test.

Stability selection

Which factors predict wages reliably, with a bound on false selections.