Commit ad053ff
test(lpdid): R-parity validate complex-survey path vs survey::svyglm (Phase D2)
Pin the merged D1 LPDiD survey path end-to-end against survey::svyglm (Lumley)
goldens on a dedicated staggered-absorbing survey panel. Closes Phase D of the
LP-DiD salvage initiative. No diff_diff/ change (verify-and-document).
Three structurally-distinct survey variance paths are R-validated per-horizon
(point/SE/df) + pooled-post/pre:
* VW full design (strata + PSU + FPC) vs svyglm(ids=~psu, strata, fpc, weights);
df = n_PSU - n_strata = 10.
* weights-only, unit injected as PSU vs svyglm(ids=~unit, weights); df = n_PSU - 1.
* direct covariate inclusion vs svyglm(Dy ~ tr + x + factor(time)).
Each LP-DiD horizon uses a FRESH svydesign over that horizon's clean long-difference
sample (matching the library's per-sample resolution, not subset() of a full design).
svyglm is the reference implementation of the Binder TSL sandwich, so it anchors the
variance directly; the clean-sample construction is independently cross-checked against
alexCardazzi/lpdid (unweighted VW event study matches to <1e-8), and every svyglm WLS
point is gated == weighted feols on the same sample (<1e-7).
Tolerances: point abs=1e-6, SE rtol=1e-5/abs=1e-7, df exact. New
TestLPDiDSurveyParityR + generate_lpdid_survey_golden.R + lpdid_survey_panel.csv /
lpdid_survey_golden.json (own seed -> absorbing/non-absorbing goldens byte-identical).
REGISTRY Deviation #8 + checklist upgraded to "validated vs svyglm"; CHANGELOG; TODO row closed.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 193f0ea commit ad053ff
7 files changed
Lines changed: 2285 additions & 4 deletions
File tree
- benchmarks
- R
- data
- docs/methodology
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
25 | 38 | | |
26 | 39 | | |
27 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
0 commit comments