Commit 421eaa2
committed
docs(lwdid): tutorial 31 - rolling-transformation DiD (numbers-locked)
Replaces the tutorial withdrawn from PR #588, authored via the
numbers-locked workflow: every cited number prototyped and locked in
scripts first, the notebook assembled and executed once per revision
(per-worktree kernel; committed kernelspec python3).
Content: the TWFE failure mode via Goodman-Bacon decomposition on a
synthetic staggered panel (static TWFE 2.00 vs true 2.87, 21%
forbidden-comparison weight); demeaning with exact T_{N-2} inference on
a 12-unit panel (full classical-model conditions stated); detrending
under treatment-related heterogeneous trends; Prop 99 replicating LW
2026 Table 3 exactly (demean -0.4222/0.1208, detrend -0.2270/0.0941,
exact p 0.021, df 37) with the per-period trajectory and RI as a test
of Fisher's sharp null under the documented package convention (0.054
at 9999 reps; as-printed 0.020 discrepancy noted); Walmart fitted as
the honest staggered design with real first-entry cohorts (WATT(1)
0.0322/0.0051 vs Appendix Table A4, near-lead placebos < 0.006 with
the single-cohort far-lead 0.033 read against its support); cluster +
wild-bootstrap replay on a DGP whose region-post shock survives
demeaning (naive 0.131 vs CR1 0.237); transformation diagnostics
framed as descriptive sensitivity information.
Methodology accuracy: estimand labels
match the default not-yet-treated pool (cell-mass aggregate, with the
complete tau_omega composite gate stated); identification stacks
(NAC/CPTC/OVLC common timing, CNAS/CHT/OVLS staggered) and cross-unit
independence stated for exact inference; t_{G-1} CR1 reference; ETWFE
equivalence scoped to the impact cell (calendar t=g / event r=0);
LWDiD-vs-CS efficiency framed as the paper's complementarity; replay
helpers scoped to common-timing reg fits; paper titles per the
registry artifacts.
Guards: tests/test_t31_lwdid_drift.py (22 tests) pins the rendered
surface (markdown AND outputs) for every load-bearing number, hash-pins
all 13 code cells (stale-output contract with a negative control),
re-derives all four synthetic DGPs against the library, and pins the
corrected methodological wording. REGISTRY staggered-replication note
amended (castle NT-only vs Walmart default-pool goldens); tutorial
registered in docs/tutorials/index.rst + doc-deps (six source entries);
TODO row retired; CHANGELOG entry added.1 parent 4acd102 commit 421eaa2
7 files changed
Lines changed: 1486 additions & 2 deletions
File tree
- docs
- methodology
- tutorials
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
867 | 867 | | |
868 | 868 | | |
869 | 869 | | |
| 870 | + | |
| 871 | + | |
870 | 872 | | |
871 | 873 | | |
872 | 874 | | |
873 | 875 | | |
874 | 876 | | |
875 | 877 | | |
| 878 | + | |
| 879 | + | |
876 | 880 | | |
877 | 881 | | |
878 | 882 | | |
| |||
885 | 889 | | |
886 | 890 | | |
887 | 891 | | |
| 892 | + | |
| 893 | + | |
888 | 894 | | |
889 | 895 | | |
890 | 896 | | |
| |||
894 | 900 | | |
895 | 901 | | |
896 | 902 | | |
| 903 | + | |
| 904 | + | |
897 | 905 | | |
898 | 906 | | |
899 | 907 | | |
| |||
910 | 918 | | |
911 | 919 | | |
912 | 920 | | |
| 921 | + | |
| 922 | + | |
913 | 923 | | |
914 | 924 | | |
915 | 925 | | |
| |||
1043 | 1053 | | |
1044 | 1054 | | |
1045 | 1055 | | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1046 | 1059 | | |
1047 | 1060 | | |
1048 | 1061 | | |
| |||
1381 | 1394 | | |
1382 | 1395 | | |
1383 | 1396 | | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1384 | 1400 | | |
1385 | 1401 | | |
1386 | 1402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2551 | 2551 | | |
2552 | 2552 | | |
2553 | 2553 | | |
2554 | | - | |
| 2554 | + | |
2555 | 2555 | | |
2556 | 2556 | | |
2557 | 2557 | | |
| |||
0 commit comments