Commit 6bd3c4e
Address PR #394 R1 review (1 P0, 2 P1, 1 P2)
DGP correctness (P0):
Replace post-hoc mutation of `dose` and `first_treat` for one DMA with
a Uniform[$5K, $50K] regional spend DGP where every DMA participates.
The previous DGP zeroed the dose for one DMA AFTER the generator had
baked the original positive-dose treatment effect into the outcome,
producing a "never-treated reference" that still carried treated
outcomes. The new DGP is internally consistent: outcomes are generated
from the dose values that HAD then sees, no relabeling.
Design 1 framing (P1):
HAD's auto-detection now resolves to `continuous_near_d_lower`
(Design 1) instead of `continuous_at_zero` (Design 1'), matching the
"every market got some treatment, no untreated comparison group"
narrative throughout. Target parameter is `WAS_d_lower` (per-$1K above
the boundary spend, ~$5K), not `WAS`. Notebook Section 3 now explains
the WAS_d_lower interpretation: multiply by `(actual_dose - d_lower)`
for per-DMA lift estimates (a DMA at $30K saw ~(30 - 5) * 100 = 2,500
extra weekly visits, not 30 * 100 = 3,000). Section 3 acknowledges
the Assumption 5/6 advisory the library fires for Design 1
(non-testable local linearity at the boundary) and explains why it
holds in this DGP (linear by construction). Section 4 event-study fit
filters the duplicate Assumption 5/6 warning. Stakeholder template
(Section 5) frames the result as "per-$1K above the $5K floor" and
flags the Assumption 6 caveat.
Pretest description (P1):
Section 6 extensions cell now describes the composite pretest workflow
accurately: QUG + linearity (Stute, Yatchew-HR) on the two-period
path. The notebook no longer claims this verifies parallel-trends;
that is closed by the multi-period joint variants
(`stute_joint_pretest`, `joint_pretrends_test`,
`joint_homogeneity_test`).
Drift test placebo-presence (P2):
New `test_event_study_horizons_complete` asserts all 7 expected
event-times (e=-4..-2, 0..3) are present, so per-horizon coverage
tests can drop the `if e in event_times` guard that would silently
pass on a truncated horizon list. Pre-placebo test no longer skips
silently.
Lock changes:
- MAIN_SEED: 126 -> 87 (cleanest seed in the new DGP's seed search).
- Locked numbers: overall att=100.0, SE=0.7, CI [98.6, 101.4],
d_lower=5.2, dose_mean=24.7, n_treated=59 (out of 60).
Docs synced:
- CHANGELOG entry rewritten for the new design path / target /
13-test count.
- Decision-tree code block updated to use the new DGP knobs (low=$5K,
seed=87) and describe the boundary-anchored interpretation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8e92902 commit 6bd3c4e
4 files changed
Lines changed: 196 additions & 145 deletions
File tree
- docs
- tutorials
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
258 | | - | |
259 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
260 | 261 | | |
261 | 262 | | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
265 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
269 | | - | |
270 | | - | |
| 272 | + | |
| 273 | + | |
271 | 274 | | |
272 | | - | |
| 275 | + | |
273 | 276 | | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
277 | 280 | | |
278 | 281 | | |
279 | | - | |
| 282 | + | |
280 | 283 | | |
281 | 284 | | |
282 | 285 | | |
| |||
0 commit comments