notebooks: event-study — pre/post windows around code-family exposures with control sets, plus market/industry series #696
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Spec docs/superpowers/specs/2026-09-09-code-family-longitudinal-design.md (§P50).
Notebook that, for each exposure in the calendar, builds pre/post windows on utilization, wages/employment, and industry series (sector ETFs; telehealth/RPM/care-management tickers ingested into
market.serieswith provenance), with never-treated control sets; reports effect sizes with confidence bands and always links back to the FR anchors that define the exposure. The chat never states causal conclusions from this; it links to the notebook.Done when the notebook runs in the nightly notebooks-integration job on the fixture exposures and the CCM 2015 / APCM 2025 panels render with anchors.
Merged to main as
8a0bedc(feature92ae58a). The notebook lives atnotebooks/event_study.py, so the nightly notebooks-integration run picks it up with everything else innotebooks/.Method (
src/pfs/event_study.py): for an exposure in year y (effective 1 January, so y is the first treated year) the window is the two file years before and the two from y on; the estimate is the treated code's log ratio of post-window to pre-window mean services minus the mean of the same quantity over its never-treated controls (pfs.exposure.control_codes: same RVU status and decile band, no exposure within ±2 years); the 95% interval is a percentile bootstrap over the control set with a fixed seed. A code with no pre-period of its own (a new code, or a successor) is measured through its family's summed series (scope="family"), so G2058 → 99439 is one continuous line rather than a birth. Wages and employment have no code-level control set, so they getpre_postwindow means only. Descriptive contrasts, stated as such; the chat never states causal conclusions from this and only links here.Live contrasts on the fixture exposures (services billed, 2-year windows):
Notebook sections: 1 exposure picker (nine fixtures), 2 utilization — treated series with the exposure rule, indexed control band (10th–90th pct) and the contrast table with anchor, 3 clinical-staff wages (31-9092, 29-2061, 29-1141, 29-1171) and CES employment window means, 4 every fixture contrast with anchors, 5 provenance (row counts +
cms.ingest_log).Not done here: the market/industry panel (sector ETFs, telehealth/RPM/care-management tickers) — no keyless quote source is reachable from the rack (Yahoo chart endpoint empty, stooq times out). Split to #797 with the
market.seriesdesign.Tests: 14 unit (
tests/pfs/test_event_study.py), notebook structure + headless + live CCM 2015 / APCM 2025 panels (tests/notebooks/test_event_study_nb.py); pre-commit suites (pfs, notebooks) green.