-
Notifications
You must be signed in to change notification settings - Fork 7
Include reference period (e=-1) in CS event study for universal base period #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…period Add the reference period to Callaway-Sant'Anna event study output when using base_period="universal". This matches R `did` package behavior and provides visual clarity in event study plots by including the normalization point. Changes: - Add base_period type hint to CallawaySantAnnaAggregationMixin - Add reference period entry (effect=0, se=0, t_stat=NaN) in _aggregate_event_study - Add 3 tests for reference period behavior (universal, varying, anticipation) - Update REGISTRY.md documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Overall assessment: ⛔ Blocker Executive summary:
MethodologyAffected method(s): Callaway–Sant’Anna event study aggregation (base_period="universal").
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…fields - Change conf_int from (0.0, 0.0) to (np.nan, np.nan) for consistency with NaN-propagation policy (P0 fix) - Change se from 0.0 to np.nan since reference period is a normalization constraint, not an estimated effect - Add guard to only inject reference period when real effects exist (P1 fix) - Update tests to expect NaN for se and conf_int - Update REGISTRY.md to document NaN inference for reference period - Add launch/ and launch-video/ to .gitignore Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment: Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Address code review feedback: the reference period (e=-1) with NaN SE could contaminate vcov matrices in pretrends and HonestDiD consumers. Changes: - pretrends.py: Filter out entries with n_groups=0 or non-finite SE when extracting pre-period effects for CallawaySantAnna and SunAbraham results - honest_did.py: Filter out entries with n_groups=0 or non-finite SE when extracting event study effects for CallawaySantAnna results - Add tests verifying base_period="universal" works correctly with both PreTrendsPower and HonestDiD (reference period is properly excluded) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Addressed Code Review FeedbackCommit 1:
|
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment
Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…otting - Filter n_groups=0 entries in _estimate_max_pre_violation to prevent reference period (effect=0) from collapsing RM bounds - Allow NaN SE entries in event study plots (show point without error bars) - Add regression test for max_pre_violation exclusion behavior - Add visualization tests for reference period with NaN SE Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment
Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
…cipation Fix _extract_plot_data() to detect reference period from n_groups=0 marker instead of hardcoding -1. This correctly handles anticipation > 0 where the reference period is at e = -1 - anticipation (e.g., e=-2 when anticipation=1). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment: ✅ Looks good Executive summary:
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
Summary
base_period="universal"didpackage behavior and provides visual clarity in event study plotsMethodology references (required if estimator / math changes)
didpackagedidpackage behaviorValidation
test_event_study_universal_includes_reference_period- verifies e=-1 included with effect=0test_event_study_varying_excludes_reference_period- verifies varying mode unaffectedtest_event_study_universal_with_anticipation- verifies e=-2 reference with anticipation=1Security / privacy
Generated with Claude Code