You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: anchor ImputationDiD leave-one-out SE against Stata did_imputation (2nd Stata arm, 1st SSC-dependent)
The Borusyak-Jaravel-Spiess (2024) Supplementary Appendix A.9 leave-one-out
finite-sample variance (opt-in `leave_one_out=True`) is a shipped, user-facing
option that no independent implementation had ever confirmed: R `didimputation`
omits LOO, so REGISTRY validated it only by an internal psi-identity + hand-calc
+ MC coverage. The authors' own Stata `did_imputation` ships the same option
(`leaveout`); this turns that into a measured anchor.
benchmarks/stata/generate_imputation_loo_golden.do runs
`did_imputation y unit time Ei, [horizons(0/5)] leaveout avgeffectsby(Ei t)
cluster(unit)` on the committed R-arm panel didimputation_test_panel.csv (no
clean-sample reconstruction; the only mapping is Ei = first_treat, missing for
never-treated). Agreement is cross-implementation (did_imputation goes through
reghdfe, the library through its own sparse IF solver): the LOO SE matches to
~1e-9 and the point to ~2e-8 across the overall ATT and all 6 event-study
horizons; the parity test gates at abs=1e-7. The non-LOO cluster SE is confirmed
three-way (library = R = Stata on the same panel).
First SSC-dependent arm (LPDiD used native teffects). The chain
did_imputation -> reghdfe -> require + ftools is not pinned by `version 19` (SSC
has no version history), so: the generator does NOT auto-install (that would
fetch latest every run, breaking byte-identical regeneration) - install once via
benchmarks/stata/requirements.do - and it records each package's version/date in
meta.ssc_versions (asserted to be a real version line, not a description) for
drift detection. avgeffectsby(Ei t) is pinned explicitly (== library
aux_partition="cohort_horizon", also did_imputation's current default) to keep
the estimand self-describing and robust to a future default change.
tests/test_imputation_loo_stata_parity.py (23 cases) gates per horizon + overall
at abs=1e-7, rel=0 (the repo's imputation SE-parity tolerance): point, LOO SE
anchor, non-LOO SE, non-LOO three-way vs R, and a no-A.9-singleton-warning gate
proving the LOO rescale is genuinely exercised.
No diff_diff/ source changed. Docs: REGISTRY LOO note (inferred -> measured),
borusyak review, benchmarks.rst (+ SSC prerequisites), benchmarks/README,
benchmarks/stata/README, doc-deps (register the Stata README under imputation.py),
CHANGELOG, TODO.md (coarser aux_partition follow-up). Stata is node-locked so -
exactly like the R arm - the golden is committed and the test skips when absent.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X9m4hRxwqRnEJsv5ZhHY3i
| MMM interop PR-B: calibration tutorial notebook (fit DiD/CS -> scope -> `to_pymc_marketing_lift_test` / `to_meridian_roi_prior`) + a `llms-practitioner.txt` Step 8 pointer to the exporters as the MMM hand-off. |`docs/tutorials/`, `diff_diff/guides/llms-practitioner.txt`| mmm-interop | Mid | Low |
49
49
| Tracking-file contract guard test: reject NEW active deferred-work pointers at `TODO.md` (deferred rows live in `DEFERRED.md`; allowlist for historical/past-tense prose and actionable-row pointers) and assert rows cross-linking a `docs/v4-deprecations.yaml``M-xxx` id don't restate ledger status. Origin: tracking-split local review R2. |`tests/`, `TODO.md`, `DEFERRED.md`| tracking-split | Quick | Low |
50
50
| Real-data CI canary for dataset-backed replication tests: `test_methodology_lwdid.py`'s Prop 99 / Walmart goldens skip (visibly) when loaders fall back to synthetic; add a lane or canary asserting `df.attrs["source"] == "lwdid_ssc_ancillary"` in CI so network regressions cannot silently de-gate the replication tests. Pairs with the loader-fallback repair row above. |`tests/test_methodology_lwdid.py`, `.github/workflows/`| LWDiD validation suite | Quick | Low |
51
+
| Extend the ImputationDiD-LOO Stata anchor to the coarser `aux_partition ∈ {"cohort", "horizon"}` variants (Stata `did_imputation ..., leaveout avgeffectsby(Ei)` / `avgeffectsby(K)`, `K = t - Ei`). These differ from the default only at the *overall* aggregate (a no-op per-horizon) and are the least-validated surface — no R analogue, currently only hand-calc. Extends `benchmarks/stata/generate_imputation_loo_golden.do` + golden. |`benchmarks/stata/`, `tests/test_imputation_loo_stata_parity.py`| stata-arm | Mid | Low |
0 commit comments