Skip to content

Commit e405aaf

Browse files
igerberclaude
andcommitted
Address PR #371 AI review R1: REGISTRY contradiction + surface tightening
P3 fixes from CI reviewer round 1: - REGISTRY.md `Note (Phase 3 by_path ...)`: drop "Placebos" from the "remain sample-level summaries" sentence (TWFE diagnostic stays sample-level; placebos are now per-path under the new sub-bullet). Resolves the in-note contradiction the reviewer flagged. - ChaisemartinDHaultfoeuilleResults docstring: add the `path_placebo_event_study` Attributes block entry alongside `path_effects`, documenting the negative-int inner-key convention and the inherited cross-path cohort-sharing deviation. - TestByPathPlacebo.test_attr_is_none_when_placebo_false: use the same `_by_path_placebo_data()` fixture for both placebo-off and placebo-on branches, so the difference is attributable solely to the `placebo` flag (not a fixture swap). - TestByPathPlacebo.test_path_placebo_point_estimate_within_path_mean: replace the finiteness-only check with an explicit recomputation of the within-path-mean DID^pl identity from the raw data, asserting equality at atol=1e-10 / rtol=1e-10. Pins the estimand identity against silent regressions in the per-path IF construction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ed7acc3 commit e405aaf

3 files changed

Lines changed: 105 additions & 15 deletions

File tree

diff_diff/chaisemartin_dhaultfoeuille_results.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,20 @@ class ChaisemartinDHaultfoeuilleResults:
374374
``{"n_groups": int, "frequency_rank": int,
375375
"horizons": {l: {"effect", "se", "t_stat", "p_value",
376376
"conf_int", "n_obs"}}}`` for ``l = 1..L_max``.
377+
path_placebo_event_study : dict, optional
378+
Per-path backward-horizon placebos ``DID^{pl}_{path, l}`` for
379+
``l = 1..L_max``, keyed by observed treatment trajectory (tuple
380+
of int). Inner dict keys are **negative** ints (``-l`` for lag
381+
``l``) to mirror the ``placebo_event_study`` convention so a
382+
unified ``{**path_effects[p]["horizons"],
383+
**path_placebo_event_study[p]}`` view is well-formed across
384+
forward and backward horizons. Each inner entry holds
385+
``{"effect", "se", "t_stat", "p_value", "conf_int", "n_obs"}``.
386+
Populated when ``by_path`` is a positive int AND
387+
``placebo=True`` AND ``L_max >= 1``; ``None`` otherwise.
388+
Inherits the cross-path cohort-sharing SE deviation from R
389+
documented for ``path_effects``. See REGISTRY.md
390+
``Note (Phase 3 by_path ...)`` → "Per-path placebos".
377391
honest_did_results : HonestDiDResults, optional
378392
HonestDiD sensitivity analysis bounds (Rambachan & Roth 2023).
379393
Populated when ``honest_did=True`` in ``fit()`` or by calling

0 commit comments

Comments
 (0)