Skip to content

Commit f9f951f

Browse files
igerberclaude
andcommitted
Fix did_had_pretest_workflow() docstring: paper Step 4 is the decision rule
Per REGISTRY's pretest workflow (lines 2482-2487 surrounding the four-step enumeration) and the same module's two correctly-framed docstrings (module-level at line 54, `_compose_verdict_event_study` at line 2735), paper Step 4 is the decision rule "use TWFE if none of the tests rejects" — NOT a test or assumption. The Yatchew-HR test is a Step 3 alternative (a single-horizon swap-in for Stute), and there is no joint Yatchew variant in the paper. The `did_had_pretest_workflow()` docstring at L4445-4446 was the only place in the file that mislabeled the Yatchew alternative as "Step 4". Reword to: - correctly tag Yatchew as a step-3 alternative - explicitly state Step 4 is the decision rule with no code path - cross-reference the two existing correctly-framed docstrings in the same file so future readers can confirm the convention is consistent Surfaced by PR #409 R6 review (T21 tutorial pre-test taxonomy work made the inconsistency visible). All 42 workflow-specific tests in `tests/test_had_pretests.py` still pass; T21 drift test (16 tests) still passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 162f45a commit f9f951f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

diff_diff/had_pretests.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4442,11 +4442,15 @@ def did_had_pretest_workflow(
44424442
44434443
``aggregate="event_study"`` (multi-period panel, >= 3 periods): runs
44444444
QUG + joint pre-trends Stute + joint homogeneity-linearity Stute,
4445-
covering paper Section 4 steps 1-3 together. Step 4 (Yatchew-style
4446-
linearity as an alternative to Stute) is subsumed by the joint Stute
4447-
in this path - the paper does not derive a joint Yatchew variant, so
4448-
users who need Yatchew robustness under multi-period data should
4449-
call :func:`yatchew_hr_test` on each (base, post) pair manually.
4445+
covering paper Section 4 steps 1-3 together. The step-3 Yatchew-HR
4446+
alternative (a single-horizon swap-in for Stute) is subsumed by joint
4447+
Stute on this path - the paper does not derive a joint Yatchew
4448+
variant, so users who need Yatchew robustness under multi-period
4449+
data should call :func:`yatchew_hr_test` on each ``(base, post)``
4450+
pair manually. (Paper step 4 is the decision itself - "use TWFE if
4451+
none of the tests rejects" - not a separate test, so it has no code
4452+
path here. Mirrors the framing in the module-level docstring at
4453+
line 54 and ``_compose_verdict_event_study`` at line 2735.)
44504454
44514455
Eq 17 / Eq 18 linear-trend detrending (paper Section 5.2 Pierce-
44524456
Schott application) is now SHIPPED on the event-study path via

0 commit comments

Comments
 (0)