Add MultiPeriodDiD vs R (fixest) benchmark#135
Merged
Conversation
Add benchmark infrastructure to validate MultiPeriodDiD event-study estimation against R's fixest::feols with treatment × period interactions. Both implementations run identical OLS regressions with cluster-robust SEs, enabling exact coefficient-level matching. Results: ATT diff < 1e-11, SE diff 0.0%, period effects correlation 1.0 at both small (200 units) and 1k scales. Python pure is ~7x faster than R. New files: - benchmarks/python/benchmark_multiperiod.py - benchmarks/R/benchmark_multiperiod.R Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Overall assessment: Executive summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
P1: Add unit FE to match registry reference spec. R uses `| unit` (absorption), Python uses `absorb=["unit"]` (within-transformation) — both yield identical coefficients and SEs (0.0% diff). P2: Guard R script against non-finite avg_se by setting avg_t, avg_pval, and CI bounds to NA (matches REGISTRY.md convention). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment
Executive Summary
Methodology
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
outcome ~ treated * time_fwith cluster-robust SEsgenerate_multiperiod_data()to benchmark utilities for simultaneous-treatment panel datarun_benchmarks.pywith--estimator multiperiodCLI option (5 scale configs)Methodology references (required if estimator / math changes)
Validation
pytest tests/test_estimators.py)Security / privacy
Generated with Claude Code