Fixed Effects and TWFE

Regional Inequality from Outer Space: Predicting GDP from Nighttime Lights and Building Inequality Indices in Python

Learn how to turn satellite images of nighttime lights into estimates of regional income, then measure how unequal regions are within each country. Step by step in Python, we test whether regional inequality first rises and then falls as countries develop.

Spatial Inequality and the Kuznets Curve: Parametric and Semiparametric Estimates in R

Do gaps between rich and poor regions within a country first widen and then narrow as the country develops? Using simulated data for 56 countries that mirrors a published study, we measure regional inequality and trace how it rises and falls with income, from simple to more flexible methods. This R tutorial comes with an interactive app that runs in your web browser.

MGWFER: Causal Spatially Varying Coefficients via Panel Fixed Effects

When we measure how a relationship changes from place to place, hidden features of each place can distort the answer. This Python tutorial follows a 2026 study by Li and Fotheringham and uses simulated data on 225 places over three periods to show how following the same places over time removes that distortion. 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.

What Does TWFE Actually Do? Manual Demeaning and the FWL Theorem

What does a regression that adjusts for country and year differences actually do to the data? Using simulated data for 150 countries in R, we show step by step that it equals subtracting country and year averages before a simple regression, and why the usual margins of error then need a fix. 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.