Skip to content

Commit 07d4741

Browse files
igerberclaude
andcommitted
Port R did package tests and fix not_yet_treated control group bugs
Port ~21 tests from R's `did` package (bcallaway11/did) to validate CallawaySantAnna estimator. Tests organized as Tier 1 (Python DGP, loose tolerance, always-run) and Tier 2 (R golden values, strict tolerance). Found and fixed two bugs via the ported tests: - not_yet_treated control group now works without never-treated units (requires ≥2 treatment cohorts) - not_yet_treated control mask now uses max(t, base_period) to prevent contamination when base_period="universal" exceeds evaluation period Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d7b394c commit 07d4741

8 files changed

Lines changed: 2399 additions & 17 deletions

File tree

TODO.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,18 @@ Spurious RuntimeWarnings ("divide by zero", "overflow", "invalid value") are emi
154154

155155
---
156156

157+
## Feature Gaps (from R `did` package comparison)
158+
159+
Features in R's `did` package that block porting additional tests:
160+
161+
| Feature | R tests blocked | Priority |
162+
|---------|----------------|----------|
163+
| Repeated cross-sections (`panel=FALSE`) | ~7 tests in test-att_gt.R + test-user_bug_fixes.R | Medium |
164+
| Sampling/population weights | 7 tests incl. all JEL replication | Medium |
165+
| Calendar time aggregation | 1 test in test-att_gt.R | Low |
166+
167+
---
168+
157169
## Performance Optimizations
158170

159171
Potential future optimizations:

0 commit comments

Comments
 (0)