Skip to content

Commit 9d5f8f9

Browse files
igerberclaude
andcommitted
Address PR #356 CI review round 15 (1 P1 guide)
§4.10 repeated-cross-section wording tightened. The earlier text ("most estimators remain applicable") overstated the RCS support surface: only CallawaySantAnna(panel=False), TripleDifference, and StaggeredTripleDifference have documented RCS-capable contracts (REGISTRY.md §CallawaySantAnna; docs/choosing_estimator.rst DDD cross-sectional use cases). EfficientDiD and HeterogeneousAdoptionDiD explicitly reject RCS per REGISTRY.md. SyntheticDiD and ContinuousDiD are panel-only by construction. Under the old wording an autonomous agent could silently route RCS data to a panel-only estimator. Rewrote §4.10 into three explicit blocks: - "Explicit RCS support": the three RCS-capable estimators. - "Explicitly rejected for RCS (panel-only)": names EfficientDiD, HeterogeneousAdoptionDiD, SyntheticDiD, ContinuousDiD. - "Treat other estimators in this guide as panel-only unless their own docs explicitly say otherwise." Kept the clustered-SE note and added a cluster-vs-respondent treatment-assignment check. Regression test: asserts the guide does not contain the "most estimators remain applicable" phrase, names `panel=False` as the explicit CS RCS mode, and that the §4.10 section explicitly lists both EfficientDiD and HeterogeneousAdoptionDiD as panel-only rejected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 889b24a commit 9d5f8f9

2 files changed

Lines changed: 57 additions & 7 deletions

File tree

diff_diff/guides/llms-autonomous.txt

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,39 @@ intensity of exposure differs):
500500
### §4.10 Repeated cross-sections (no panel structure)
501501

502502
`profile_panel` assumes long-format panel data. When the same units are
503-
not observed across time (true repeated cross-sections), most estimators
504-
remain applicable but:
505-
506-
- Clustered SE must cluster on the unit proxy (state, region) rather
507-
than individual.
508-
- The `CallawaySantAnna` estimator has an explicit repeated-cross-
509-
section mode; see its `panel` kwarg.
503+
not observed across time (true repeated cross-sections), only the
504+
estimators whose documented contract explicitly admits RCS are
505+
applicable. Do not route RCS data to any other estimator in the suite -
506+
most of them are panel-only by construction and will either raise at
507+
fit time or estimate under a misspecified identifying assumption.
508+
509+
Explicit RCS support in this library:
510+
511+
- `CallawaySantAnna(panel=False)` - repeated-cross-section mode per
512+
REGISTRY.md §CallawaySantAnna; use this variant on RCS data.
513+
- `TripleDifference` / `StaggeredTripleDifference` - DDD cross-sectional
514+
use cases are documented in `docs/choosing_estimator.rst`; the DDD
515+
estimators do not require within-unit tracking when the third
516+
comparison axis carries the identification.
517+
518+
Explicitly rejected for RCS (panel-only):
519+
520+
- `EfficientDiD` - REGISTRY notes "does not handle ... repeated
521+
cross-sections."
522+
- `HeterogeneousAdoptionDiD` - panel-only (requires a balanced panel
523+
with per-unit adoption timing).
524+
- `SyntheticDiD` - requires balanced panel with per-unit donor matching.
525+
- `ContinuousDiD` - requires balanced panel with per-unit constant
526+
dose.
527+
528+
Treat other estimators in this guide as panel-only unless their own
529+
docs explicitly say otherwise. When routing, also:
530+
531+
- Cluster SE on the unit proxy (state, region) rather than the
532+
individual cross-section respondent.
533+
- Confirm the treatment assignment is at the cluster level, not at
534+
the individual-respondent level, before interpreting the estimate
535+
as a group-time ATT.
510536

511537

512538
## §5. Post-fit validation utilities

tests/test_profile_panel.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,30 @@ def test_guide_api_strings_resolve_against_public_api():
745745
f"{phrase!r}: SUTVA is assumed across the estimator suite."
746746
)
747747

748+
# Repeated-cross-section (§4.10) must not claim broad
749+
# applicability. The documented RCS-capable estimators are
750+
# CallawaySantAnna(panel=False), TripleDifference, and
751+
# StaggeredTripleDifference; EfficientDiD and
752+
# HeterogeneousAdoptionDiD explicitly reject RCS per REGISTRY.md.
753+
assert "most estimators remain applicable" not in text, (
754+
"§4.10 must not claim broad RCS applicability; only the "
755+
"explicitly documented RCS-capable subset is applicable."
756+
)
757+
assert "panel=False" in text, (
758+
"§4.10 must point at CallawaySantAnna(panel=False) as the " "explicit RCS mode"
759+
)
760+
# The section must explicitly name at least one panel-only
761+
# estimator as rejected for RCS, so agents do not silently route
762+
# RCS data to it.
763+
rcs_section_start = text.find("§4.10 Repeated cross-sections")
764+
assert rcs_section_start >= 0
765+
rcs_section = text[rcs_section_start : rcs_section_start + 2500]
766+
for panel_only in ("EfficientDiD", "HeterogeneousAdoptionDiD"):
767+
assert panel_only in rcs_section, (
768+
f"§4.10 must explicitly name {panel_only!r} as panel-only "
769+
"so RCS data is not routed to it"
770+
)
771+
748772

749773
def test_min_pre_post_use_per_unit_observed_support():
750774
"""On an unbalanced panel where one treated unit is missing its

0 commit comments

Comments
 (0)