Skip to content

Commit d20988d

Browse files
igerberclaude
andcommitted
dCDH heterogeneity: align fit() docstring + summary note with new contract
Two stale in-code documentation surfaces from the latest review: 1. `chaisemartin_dhaultfoeuille.py:980-989` — the `heterogeneity` parameter docstring on `fit()` still said "post-treatment regressions only (no placebo regressions)". Updated to document the post-#422 contract: per-horizon OLS regressions on forward AND backward (placebo) horizons when `placebo=True`; survey_design composes with forward horizons but warns + skips backward horizons until the pre-period cell allocator is derived. 2. `chaisemartin_dhaultfoeuille_results.py:1279-1286` — the heterogeneity summary note didn't mention the survey forward-only fallback. Extended the note to cover the gating semantics so users reading `result.summary()` under `survey_design + heterogeneity` know what they're getting. Both surfaces now match the contract already documented in the API rst, REGISTRY, and CHANGELOG. No behavior change. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent bcdb00a commit d20988d

2 files changed

Lines changed: 23 additions & 9 deletions

File tree

diff_diff/chaisemartin_dhaultfoeuille.py

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -980,14 +980,25 @@ def fit(
980980
heterogeneity : str, optional
981981
Column name for a time-invariant covariate to test for
982982
heterogeneous effects (Web Appendix Section 1.5, Lemma 7).
983-
Partial implementation: post-treatment regressions only
984-
(no placebo regressions or joint null test). Cannot be
985-
combined with ``controls``, ``trends_linear``, or
986-
``trends_nonparam``. Requires ``L_max >= 1``. Under
987-
``by_path`` / ``paths_of_interest``, per-path
988-
heterogeneity coefficients also surface on
989-
``results.path_heterogeneity_effects`` and on
990-
``to_dataframe(level="by_path")`` via ``het_*`` columns.
983+
Per-horizon OLS regressions are computed for forward
984+
horizons (1..L_max), and ALSO for backward (placebo)
985+
horizons (-1..-L_max) when ``placebo=True`` is set
986+
(post-2026-05-15: per-path placebo predict_het R-parity
987+
against ``did_multiplegt_dyn(by_path, predict_het, placebo)``).
988+
Joint Wald F-test across rows is NOT computed
989+
(per-horizon inference only). Cannot be combined with
990+
``controls``, ``trends_linear``, or ``trends_nonparam``.
991+
Requires ``L_max >= 1``. Under ``by_path`` /
992+
``paths_of_interest``, per-path heterogeneity coefficients
993+
also surface on ``results.path_heterogeneity_effects`` and
994+
on ``to_dataframe(level="by_path")`` via ``het_*`` columns
995+
(positive AND negative-horizon rows populated when
996+
``placebo=True``). Under ``survey_design``, backward-
997+
horizon (placebo) heterogeneity is NOT computed (the pre-
998+
period Binder TSL cell allocator is deferred to a follow-
999+
up methodology PR); a ``UserWarning`` fires at fit-time
1000+
and forward-horizon heterogeneity continues to compute
1001+
normally.
9911002
design2 : bool, default=False
9921003
If ``True``, identify and report switch-in/switch-out
9931004
(Design-2) groups. Convenience wrapper (descriptive summary,

diff_diff/chaisemartin_dhaultfoeuille_results.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,10 @@ def _render_heterogeneity_section(self, lines: List[str], width: int, thin: str)
12801280
[
12811281
thin,
12821282
"Note: Per-horizon regressions only (no joint F-test). "
1283-
"Negative l = placebo (backward) horizon when placebo=True.",
1283+
"Negative l = placebo (backward) horizon when "
1284+
"placebo=True. Under survey_design, only forward "
1285+
"horizons are computed (backward-horizon survey "
1286+
"heterogeneity is deferred — see REGISTRY note).",
12841287
"",
12851288
]
12861289
)

0 commit comments

Comments
 (0)