diff-diff

# Difference-in-
Differences.
Now in Python.

Up to 2,000x faster than R

$ pip install diff-diff

# DiD in Python
Was Broken

X Fragmented packages
X Missing modern methods
X Slow performance
X R required for serious work

Researchers deserved better.

# Introducing
diff-diff

OK Complete DiD toolkit
OK sklearn-like API
OK All modern methods
OK Blazing fast

One library. Everything you need.

# R: 24 minutes
diff-diff: 2.6 seconds

Synthetic DiD
2,234x faster
Basic DiD
18x faster
Callaway-SA
14x faster

Benchmarked at 10K unit scale against R packages

# Every Method
You Need

Basic DiD / TWFE
Classic 2x2 and panel designs
Callaway-Sant'Anna
Staggered adoption (2021)
Sun-Abraham
Interaction-weighted (2021)
Synthetic DiD
Arkhangelsky et al. (2021)
Triple Difference
DDD with proper covariates
Honest DiD
Rambachan-Roth sensitivity

# Clean, Pythonic API

from diff_diff import CallawaySantAnna
# Staggered DiD in 5 lines
cs = CallawaySantAnna()
results = cs.fit(
data,
outcome='sales',
unit='firm_id',
time='year',
first_treat='first_treat'
)
results.print_summary()

sklearn-like fit() + statsmodels-style output

# Validated.
Trusted.
Production-Ready.

Comparison | Result
--- | ---
Point estimates vs R | Identical (10+ decimals)
Standard errors | Within 1-3%
R packages tested | did, synthdid, fixest
Real-world validation | MPDTA dataset

Academic-grade accuracy. No compromises.

# Everything
Included

* Robust & Cluster SEs
* Wild Bootstrap
* Event Study Plots
* Parallel Trends Tests
* Bacon Decomposition
* Power Analysis
* Pre-trends Power
* Placebo Tests

Publication-ready visualizations included

# Built for
Researchers

|||
Applied Economists
^^^
Policy Researchers
oOo
Data Scientists
>_
Python-First Teams

Finally escape R for your causal inference work

# Get Started in
30 Seconds

$ pip install diff-diff

github.com/igerber/diff-diff

Full documentation & tutorials included
MIT Licensed | Open Source

diff-diff

Difference-in-Differences for Python