Commit 085d8eb
Address PR #370 R2 review (2 P1 + 1 P3)
R2 P1 #1 (Code Quality) -- joint_pretrends_test and joint_homogeneity_test
direct calls still crashed on staggered panels because the staggered-
weights subset fix from R1 was only applied at the workflow level. The
wrappers run their own _validate_had_panel_event_study() and may filter
to data_filtered, then passed the original full-panel weights array to
_resolve_pretest_unit_weights(data_filtered, ...) which expects the
filtered row count. Fix: subset row-level weights to data_filtered.index
positions (via data.index.get_indexer) BEFORE _resolve_pretest_unit_weights,
mirroring the workflow fix.
R2 P1 #2 (Methodology) -- REGISTRY note documented the bootstrap
perturbation as `dy_b = fitted + eps * w * eta_obs`, but the code does
`dy_b = fitted + eps * eta_obs` (no `* w`). Code is correct: paper
Appendix D wild-bootstrap perturbs UNWEIGHTED residuals; weighting flows
through the OLS refit and the weighted CvM, not through the perturbation.
Adding `* w` would over-weight by w². Fix: update REGISTRY note to
remove the spurious `* w` and clarify the canonical form. Add a
regression that pins (a) bit-exact cvm_stat reduction at uniform weights,
(b) bootstrap p-value distributional agreement within Monte-Carlo noise.
R2 P3 -- in-code docstrings still referenced the pre-Phase-4.5-C contract:
- qug_test docstring said survey-aware Stute "admits a Rao-Wu rescaled
bootstrap" (PSU-level Mammen multiplier bootstrap is what shipped).
Updated to reflect the correct mechanism.
- HADPretestReport.all_pass docstring described the unweighted contract
only; survey/weights path drops the QUG-conclusiveness gate
(linearity-conditional admissibility per C0 deferral). Updated.
3 new regression tests in TestPhase45CR1Regressions:
- test_joint_pretrends_test_staggered_weights_subset
- test_joint_homogeneity_test_staggered_weights_subset
- test_stute_survey_perturbation_does_not_double_weight (locks the
perturbation form via cvm_stat bit-exact reduction + p-value MC bound)
168 pretest tests pass (was 165 after R1).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent fb03267 commit 085d8eb
3 files changed
Lines changed: 128 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
607 | 607 | | |
608 | 608 | | |
609 | 609 | | |
610 | | - | |
611 | | - | |
612 | | - | |
613 | | - | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
618 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
619 | 623 | | |
620 | 624 | | |
621 | 625 | | |
| |||
1202 | 1206 | | |
1203 | 1207 | | |
1204 | 1208 | | |
1205 | | - | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
1209 | | - | |
1210 | | - | |
1211 | | - | |
1212 | | - | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
1217 | 1221 | | |
1218 | 1222 | | |
1219 | 1223 | | |
| |||
3064 | 3068 | | |
3065 | 3069 | | |
3066 | 3070 | | |
| 3071 | + | |
| 3072 | + | |
| 3073 | + | |
| 3074 | + | |
| 3075 | + | |
| 3076 | + | |
| 3077 | + | |
| 3078 | + | |
| 3079 | + | |
| 3080 | + | |
| 3081 | + | |
| 3082 | + | |
| 3083 | + | |
| 3084 | + | |
| 3085 | + | |
| 3086 | + | |
3067 | 3087 | | |
3068 | | - | |
| 3088 | + | |
3069 | 3089 | | |
3070 | 3090 | | |
3071 | 3091 | | |
| |||
3265 | 3285 | | |
3266 | 3286 | | |
3267 | 3287 | | |
| 3288 | + | |
| 3289 | + | |
| 3290 | + | |
| 3291 | + | |
| 3292 | + | |
| 3293 | + | |
| 3294 | + | |
| 3295 | + | |
| 3296 | + | |
| 3297 | + | |
| 3298 | + | |
| 3299 | + | |
| 3300 | + | |
3268 | 3301 | | |
3269 | | - | |
| 3302 | + | |
3270 | 3303 | | |
3271 | 3304 | | |
3272 | 3305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2432 | 2432 | | |
2433 | 2433 | | |
2434 | 2434 | | |
2435 | | - | |
| 2435 | + | |
2436 | 2436 | | |
2437 | 2437 | | |
2438 | 2438 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3547 | 3547 | | |
3548 | 3548 | | |
3549 | 3549 | | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
| 3600 | + | |
| 3601 | + | |
| 3602 | + | |
| 3603 | + | |
| 3604 | + | |
| 3605 | + | |
| 3606 | + | |
| 3607 | + | |
| 3608 | + | |
| 3609 | + | |
| 3610 | + | |
| 3611 | + | |
| 3612 | + | |
| 3613 | + | |
| 3614 | + | |
| 3615 | + | |
| 3616 | + | |
| 3617 | + | |
| 3618 | + | |
| 3619 | + | |
| 3620 | + | |
| 3621 | + | |
| 3622 | + | |
| 3623 | + | |
0 commit comments