Skip to content

Commit 3de72d1

Browse files
igerberclaude
andcommitted
Add EfficientDiD estimator (Chen, Sant'Anna & Xie 2025, Phase 1)
Implement the semiparametrically efficient ATT estimator for DiD with staggered treatment adoption (no-covariates path). The estimator achieves the efficiency bound by optimally weighting across pre-treatment periods and comparison groups via the inverse of the within-group covariance matrix Omega*. Under PT-All the model is overidentified and EDiD exploits this for tighter inference; under PT-Post it reduces to standard CS. New files: - efficient_did.py: main EfficientDiD class with sklearn-like API - efficient_did_weights.py: Omega* matrix, efficient weights, EIF - efficient_did_bootstrap.py: multiplier bootstrap mixin - efficient_did_results.py: EfficientDiDResults dataclass - tests/test_efficient_did.py: 42 tests across 4 tiers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent bf4389a commit 3de72d1

7 files changed

Lines changed: 2738 additions & 0 deletions

File tree

diff_diff/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@
128128
ContinuousDiDResults,
129129
DoseResponseCurve,
130130
)
131+
from diff_diff.efficient_did import (
132+
EfficientDiD,
133+
EfficientDiDResults,
134+
EDiDBootstrapResults,
135+
)
131136
from diff_diff.trop import (
132137
TROP,
133138
TROPResults,
@@ -172,6 +177,7 @@
172177
DDD = TripleDifference
173178
Stacked = StackedDiD
174179
Bacon = BaconDecomposition
180+
EDiD = EfficientDiD
175181

176182
__version__ = "2.6.1"
177183
__all__ = [
@@ -231,6 +237,11 @@
231237
"trop",
232238
"StackedDiDResults",
233239
"stacked_did",
240+
# EfficientDiD
241+
"EfficientDiD",
242+
"EfficientDiDResults",
243+
"EDiDBootstrapResults",
244+
"EDiD",
234245
# Visualization
235246
"plot_event_study",
236247
"plot_group_effects",

0 commit comments

Comments
 (0)