2026-09-10 –, Unconference
Two-way fixed effects (TWFE) models are a workhorse for analyzing large-scale panel data in applications such as pricing and demand modeling. In practice, running these models at scale in Python comes with challenges: high-dimensional fixed effects, clustering, memory constraints, and specification choices that can lead to different conclusions.
In this talk, we show how to use pyfixest to estimate TWFE models efficiently in Python, and what actually matters when moving from textbook examples to production settings. Using real-world airline pricing applications as a case study, we illustrate how to handle large numbers of fixed effects without exploding memory, how to specify clustered standard errors under temporal dependence, and how to avoid identification issues when fixed effects absorb key variation.
Attendees will leave with practical patterns for running fixed effects models in Python, along with a clear understanding of common failure modes and how to avoid them.
Two-way fixed effects (TWFE) models are widely used to analyze panel data in pricing, demand modeling, and experimentation. In small examples they appear straightforward. In real-world Python workflows they are often not.
This talk focuses on how to estimate TWFE models in practice using pyfixest, with an emphasis on scalability, correct specification, and interpretation.
We start with a brief recap of TWFE models and their role in panel data analysis. We then introduce pyfixest as a Python tool for estimating models with high-dimensional fixed effects, and show how it differs from more naive approaches. In particular, we discuss why explicitly constructing dummy variables is infeasible in large datasets, and how within-transformations allow estimation without exploding memory.
The core of the talk is a set of real-world airline pricing applications. These include both experimental settings and observational analyses used to estimate price elasticities from historical data. The data is structured along multiple dimensions (such as route, time, and booking horizon), which makes TWFE a natural modeling choice, but also exposes several practical challenges:
- high-dimensional fixed effects that make naive implementations computationally infeasible
- specification choices where fixed effects absorb the variation needed for identification
- clustered standard errors that depend critically on the correct level of aggregation
- temporal dependence that can lead to overconfident inference if not handled carefully
- data issues such as boundary effects or leakage across time periods
Using pyfixest, we show how to specify models for these settings, how to run them efficiently, and how to diagnose when results should not be trusted. The focus is on what practitioners actually encounter: models that run but give misleading answers due to subtle specification errors.
The talk concludes with a set of practical guidelines for applying TWFE models in Python: how to structure data, how to choose fixed effects and clustering levels, and what checks to perform before interpreting results.
The goal is not to present TWFE as a general solution, but to show how it can be applied in a controlled and reliable way in large-scale Python workflows.
Rutger Lit is a Lead Data Scientist at Amsterdam Data Collective (ADC), where he works on pricing, experimentation, and panel data modeling in complex, real-world systems. His work focuses on applying statistical models in Python at scale, with particular attention to high-dimensional data, temporal dependence, and model specification.