Python

Introduction to Difference-in-Differences (DiD) in Python

Did an after-school tutoring program really raise student grades, or were grades rising everywhere? This Python tutorial compares 10 tutored high schools with 25 others, before and after the program, to separate its effect from the general upward trend. It comes with an interactive app that runs in your web browser.

Regional Inequality and the Kuznets Curve: Panel Fixed Effects in Python

As countries grow richer, do the gaps between their regions first widen and then narrow, or do they widen again at the top? This Python tutorial uses satellite images of night lights for about 180 countries and compares each country with itself over time, finding an N-shaped pattern. It comes with an interactive app that runs in your web browser.

Standard Errors in Panel Data: A Beginner's Guide in Python

How sure can we be about an estimate when the same firms are observed year after year? Using simulated data for 100 firms in Python, we compare several ways of measuring the margin of error and show that no margin of error can fix an estimate that is biased to begin with. It includes an interactive app that runs in your web browser.

Exploratory Spatial Data Analysis: Spatial Clusters and Dynamics of Human Development in South America

Do regions with high or low human development cluster together on the map of South America, and did those clusters shift between 2013 and 2019? This Python tutorial maps 153 regions and uses spatial statistics to test whether neighbors are more alike than chance would suggest. It comes with an interactive app that runs in your web browser.

Multiscale Geographically Weighted Regression: Spatially Varying Economic Convergence in Indonesia

Do poorer districts in Indonesia catch up with richer ones at the same pace everywhere? This Python tutorial uses a map-based regression that lets each relationship change from place to place, each at its own geographic scale, across 514 districts. It comes with an interactive app that runs in your web browser.

Synthetic Control with Prediction Intervals: Quantifying Uncertainty in Germany's Reunification Impact

Did German reunification in 1990 lower income in West Germany, and how sure can we be? This Python tutorial builds a look-alike West Germany from other wealthy countries and adds a range of likely values around the estimate, showing income per person about 11 percent below the comparison by 2003. It comes with an interactive app that runs in your web browser.

Introduction to PCA Analysis for Building Development Indicators

How can two health measures, life expectancy and infant mortality, be combined into one fair health score? Using simulated data for 50 countries, this Python tutorial builds the index step by step with principal component analysis, a method that finds the single direction capturing most of the shared information. It comes with an interactive app that runs in your web browser.

Pooled PCA for Building Development Indicators Across Time

How can we tell whether regions are developing over time when the measuring stick itself must stay the same? Using education, health and income data for 153 South American regions in 2013 and 2019, this Python tutorial builds one development index from both years together so that scores can be compared across time. It comes with an interactive app that runs in your web browser.

High-Dimensional Fixed Effects Regression: An Introduction in Python

How much of the higher pay of union workers comes from the union itself, and how much from who joins? This Python tutorial shows how fixed effects, which compare each worker only with the same worker over time, remove hidden differences and cut the apparent union pay gain from about 18 to 8 percent. It comes with an interactive app that runs in your web browser.

Introduction to Difference-in-Differences in Python

Did a new policy really change outcomes, or were things already improving? This Python tutorial introduces the difference-in-differences method, which compares changes over time between places that got the policy and places that did not, using simulated data, and checks how solid the answer is. It comes with an interactive app that runs in your web browser.