Commit 89738b5
fix(lpdid): report survey PSU count as headline G for only_event survey fits
CI-codex P2: under a survey design the effective variance cluster is the PSU
(cluster_name reports the PSU column), but for only_event=True fits (pooled is
None) headline_n_clusters fell back to the panel unit count -- so an explicit
PSU design with n_psu != n_units could display the unit count mislabeled as
G=<psu>. Per-row event-study n_clusters and inference were already computed on
the realized survey design, so this was a metadata/labeling issue only, not a
wrong SE/p-value. Fix: when a survey design is active, seed headline_n_clusters
from the panel-level effective PSU count (the pooled-post override still prefers
the realized survey-sample count when available). Regression test added
(only_event=True, explicit PSU, n_psu != n_units).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ea9caf6 commit 89738b5
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1499 | 1499 | | |
1500 | 1500 | | |
1501 | 1501 | | |
1502 | | - | |
1503 | | - | |
| 1502 | + | |
| 1503 | + | |
1504 | 1504 | | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1505 | 1512 | | |
1506 | 1513 | | |
1507 | 1514 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1864 | 1864 | | |
1865 | 1865 | | |
1866 | 1866 | | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
1867 | 1883 | | |
1868 | 1884 | | |
1869 | 1885 | | |
| |||
0 commit comments