Skip to content

Commit 4073fa8

Browse files
igerberclaude
andcommitted
HonestDiD: raise on no pre-period coefficients in CS path, remove overall_se fallback
Add ValueError when CallawaySantAnna event study has no finite pre-period coefficients after filtering (matching MultiPeriod path behavior at L596). Remove the invalid fallback that substituted overall_se as max_pre_violation when no pre-effects existed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 7dc09e8 commit 4073fa8

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

diff_diff/honest_did.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,13 @@ def _extract_event_study_params(
681681
pre_times = [t for t in rel_times if t < ref_period]
682682
post_times = [t for t in rel_times if t > ref_period]
683683

684+
if len(pre_times) == 0:
685+
raise ValueError(
686+
"No pre-period effects with finite estimates found in "
687+
"CallawaySantAnna event study. HonestDiD requires at "
688+
"least one identified pre-period coefficient."
689+
)
690+
684691
effects = []
685692
ses = []
686693
for t in rel_times:
@@ -1452,7 +1459,9 @@ def _estimate_max_pre_violation(self, results: Any, pre_periods: List) -> float:
14521459
]
14531460
if pre_effects:
14541461
return max(pre_effects)
1455-
return results.overall_se
1462+
# No valid pre-effects — should have been caught by
1463+
# _extract_event_study_params pre-period validation
1464+
return 0.0
14561465
except ImportError:
14571466
pass
14581467

0 commit comments

Comments
 (0)