Add R validation for 4 survey-enabled estimators#276
Conversation
…kedDiD, SunAbraham, TripleDifference) Expand survey R-validation coverage from 4 to 8 estimators. Each target estimator reduces to a WLS regression under survey weights, validated against R's survey::svyglm(). Point estimates match to <1e-10; SEs within 0.77% (tightest observed gap). Deliverables: - R benchmark script generating golden JSON (4 scenarios, 2 DGPs) - Python tests consuming golden values (5 tests, 1.5% SE tolerance) - Documentation in docs/benchmarks.rst Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Overall Assessment Executive Summary
Methodology Cross-check against the registry and estimator docstrings did not surface an undocumented deviation in the library estimators touched by this PR.
Code Quality
Performance
Maintainability
Tech Debt
Security
Documentation/Tests
Path to Approval
|
- Guard extract_svyglm_results for non-finite/zero SE (P1) - Assert S4 t_stat, CI lower/upper in Python test (P1) - Assert S2 event-study SEs and S3 cohort-effect SEs (P3) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
/ai-review |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall Assessment ✅ Looks good All previously raised P1+ issues are resolved. I found one new P3 test-harness gap, but no unmitigated P0/P1 issues. Executive Summary
Methodology No findings. The new R-side constructions match the documented estimator contracts: S1 uses Code Quality No findings. Performance No findings. Maintainability No findings. Tech Debt No findings. The remaining gap is a minor test-helper issue rather than untracked estimator debt. Security No findings. The committed JSON fixture appears synthetic; I did not see secrets or PII. Documentation/Tests
|
Summary
benchmark_survey_estimators.R) generating golden JSON for 4 survey-enabled estimators: ImputationDiD, StackedDiD, SunAbraham, TripleDifferencedocs/benchmarks.rstwith observed gaps and reproduction instructionsMethodology references (required if estimator / math changes)
survey::svyglm().Validation
tests/test_survey_estimator_validation.py(5 tests)Rscript benchmarks/R/benchmark_survey_estimators.RSecurity / privacy
Generated with Claude Code