Open-Source Methods

Python tutorials for researchers transitioning from licensed software. The same econometrics, spatial analysis, and machine learning, implemented with free tools. Public materials are labeled at the study level.

Why Python for Applied Economics

Most applied economists learn Stata in graduate school. It works, it is well-documented, and departments often have site licenses. The constraint often appears after graduation: Stata is commercially licensed, prices vary by edition and eligibility, research assistants need access, and collaborators at different institutions may not share the same license [1].

Python removes the proprietary-license requirement for the workflows taught here. pandas handles data manipulation, statsmodels estimates regression models [2], scikit-learn and XGBoost support machine learning [3], and GeoPandas supplies spatial-analysis tools.

The transition has costs. Python requires more boilerplate, error messages can be less informative than Stata's, and the ecosystem spans many packages. These tutorials document the edge cases, hard-to-detect failures, and workarounds that matter in applied work.

Each tutorial teaches a concrete problem from applied economics: validating GTFS feeds before routing, checking the geometries lost in a spatial join, or choosing a metric for an imbalanced classifier. Each named case states whether its numbers have a public reproduction package. Some pages provide instructional excerpts or article-reported examples rather than runnable study packages.

One rule governs this library. A named numerical case counts as reproduced only when public materials derive it. The article cards label other cases as instructional, article-reported, or under reconciliation.

[1] StataCorp. "Explore Stata products." Accessed July 21, 2026.
[2] Seabold, S. and Perktold, J. (2010). "Statsmodels: Econometric and statistical modeling with Python." Proceedings of the 9th Python in Science Conference.
[3] Pedregosa, F. et al. (2011). "Scikit-learn: Machine learning in Python." Journal of Machine Learning Research, 12, 2825-2830.
[4] Esri. "ArcGIS Pro pricing and licensing options." Accessed July 21, 2026.

Python vs. Licensed Software for Applied Economics

Capability Python (Free) Stata 19 (commercial) ArcGIS (commercial)
OLS / IV / Panel regression statsmodels, linearmodels Built-in N/A
Difference-in-differences statsmodels + manual event study Built-in + csdid N/A
Machine learning (RF, XGBoost, SHAP) scikit-learn, xgboost, shap Lasso and H2O integration, including tree models and explainability tools N/A
Spatial joins & analysis GeoPandas, shapely, scipy Limited (spmap) Built-in
Census API integration requests + custom pipeline URL import/download plus custom parsing Living Atlas ACS layers or hosted feature services
Transit routing (GTFS) r5py, gtfs-kit N/A Network Analyst ($$$)
Annual cost (single user) $0 Varies by edition and eligibility Varies by user type and deployment

Python Tutorials

Tutorial

Difference-in-Differences in Python: When TWFE Misleads

A statsmodels workflow for event study estimation, with the diagnostics that separate credible estimates from noise.

February 2026
Tutorial

How to Build a Census Data Pipeline

A Python workflow for pulling ACS data from the Census API, with the validation checks that prevent bad data from reaching the analysis.

February 2026
Tutorial

GeoPandas Spatial Joins: An Illustrative Workflow

An illustrative workflow from point-to-polygon joins to local cluster diagnostics. The empirical values and named implementation are not publicly reproduced.

February 2026
Tutorial

SHAP Classifier Interpretation: An Article-Reported Example

An instructional SHAP workflow. The model metrics, importance shares, runtime, and named implementation are not publicly reproduced.

February 2026
Tutorial

Imbalanced Classification: An Article-Reported Example

An instructional workflow for class imbalance and rare-class metrics. Dataset counts, model results, and the named implementation are not publicly reproduced.

February 2026
Tutorial

GTFS Validation in Python: An Article-Reported Workflow

Six instructional validation layers. The named project inputs, failure counts, and implementation are not publicly reproduced.

February 2026
Tutorial

Build Transit Travel-Time Matrices with Free Tools

Step-by-step guide to r5py, GTFS data, and multimodal accessibility analysis. The project-specific pair count is under reconciliation.

November 2025

Data Collection & Validation

Robust API Collection: Pagination, Rate Limits, Failure Recovery

The collection safeguards are documented. The article-reported record total, cost, retry log, and zero-loss claim remain under reconciliation.

November 2025

The Retail Density Paradox: Why More Stores Mean Worse Data

Cross-validating SNAP retailer data against multiple authoritative sources.

October 2025

Grocery Store Classifier Results Under Review

The article reports an iterative labeling result. Its full-population classification remains under reconciliation with the related policy pages.

October 2025

A Proxy Method for Classifying Grocery Stores at Scale

An article-reported proxy classification. The source data, classification tables, code, and matched outputs are not public.

October 2025

Spatial & Geographic Methods

Residualized Accessibility Index: An Article-Reported Case

A regression-residual lesson built around article-reported coefficients and ranks that are not publicly reproduced.

November 2025

County Rankings and Policy Context: An Article-Reported Case

The article reports a 2.3-fold county comparison. No matching public script, run record, or saved output currently reproduces the rankings.

July 2025

Crime Geography Precision: An Article-Reported Case

The article reports a 22-fold crime range. No matching public script, run record, or saved output currently reproduces the geographic case.

July 2025

Causal Inference & Evaluation

Parallel-Trends Sensitivity: An Article-Reported Case

A sensitivity-analysis lesson built around bank-closure estimates and diagnostics that are not publicly reproduced.

September 2025

Scaling Statewide: An Article-Reported Case

The pilot and statewide counts, timings, classifications, and findings are article-reported. The original repository no longer resolves.

September 2025

Key takeaways

  • Open-source tools remove proprietary software-license fees for the workflows taught here. Stata and ArcGIS licensing costs vary by product, user type, deployment, and educational eligibility [1, 4].
  • Every tutorial teaches a concrete research problem and labels whether the named numerical case has a public reproduction package.
  • Selected public materials are available through GitHub. Coverage varies by study and source license.
  • Stata and R knowledge transfers: several tutorials map familiar econometric operations to their Python implementations, while each page states its own prerequisites.

Frequently Asked Questions

What Python version do the tutorials use?

Version requirements vary by tutorial. Where a public package is available, its requirements file records the dependencies for that study.

Can I follow these if I only know Stata or R?

Several tutorials begin from familiar Stata or R operations and show a Python implementation. Check the named packages and prerequisites on the individual page before starting.

Which studies have public materials?

The public repository contains code and documentation for selected studies. Availability varies by study, and source licenses determine whether data can be redistributed.

How are these different from documentation?

Each tutorial teaches a problem from applied economics and states whether its named numerical case has a public reproduction package. Some pages provide instructional excerpts or article-reported examples rather than runnable study packages.