You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P1 #1 (Wooldridge Poisson estimand wording):
The guide §4.11 and §5.3 worked example described
`WooldridgeDiD(method="poisson")`'s `overall_att` as a
"multiplicative effect" / "log-link effect" / "proportional change"
to be reported. Verified against `wooldridge.py:1225`
(`att = _avg(mu_1 - mu_0, cell_mask)`) and
`_reporting_helpers.py:262-281` (registered estimand: "ASF-based
average from Wooldridge ETWFE ... average-structural-function (ASF)
contrast between treated and counterfactual untreated outcomes ...
on the natural outcome scale"): the actual quantity is
`E[exp(η_1)] - E[exp(η_0)]`, an outcome-scale DIFFERENCE, not a
multiplicative ratio. An agent following the previous wording would
misreport the headline scalar.
Rewrote both surfaces to:
- Describe the estimand as an ASF-based outcome-scale difference,
citing `wooldridge.py:1225` and Wooldridge (2023) +
REGISTRY.md §WooldridgeDiD nonlinear / ASF path.
- Explicitly note the headline `overall_att` is a difference on the
natural outcome scale, NOT a multiplicative ratio.
- Mention that a proportional / percent-change interpretation can
be derived post-hoc as `overall_att / E[Y_0]` but is not the
estimator's reported scalar.
Added `test_autonomous_count_outcome_uses_asf_outcome_scale_estimand`
in `tests/test_guides.py`: extracts §4.11 and §5.3 blocks, asserts
forbidden phrases ("multiplicative effect under qmle", "estimates
the multiplicative effect", "multiplicative (log-link) effect",
"report the multiplicative effect", "report the multiplicative")
do NOT appear, and asserts §5.3 explicitly contains "ASF" and
"outcome scale" so future edits cannot silently weaken the
description.
P1 #2 (`is_count_like` non-negativity guard):
The `is_count_like` heuristic gated on integer-valued + has-zeros +
right-skewed + > 2 distinct values, but did NOT exclude negative
support. Verified against `wooldridge.py:1105-1109`: Poisson method
hard-rejects `y < 0` with `ValueError`. Without a value_min >= 0
guard, a right-skewed integer outcome with zeros and some negatives
would set `is_count_like=True` and steer an agent toward an
estimator that then refuses to fit.
Added `value_min >= 0.0` to the heuristic and explained the
non-negativity gate in the docstring + autonomous guide §2 field
reference (now reads
"is_integer_valued AND pct_zeros > 0 AND skewness > 0.5 AND
n_distinct_values > 2 AND value_min >= 0"). The guide also notes
that the gate exists specifically to align the routing signal with
WooldridgeDiD Poisson's hard non-negativity requirement.
Added `test_outcome_shape_count_like_excludes_negative_support` in
`tests/test_profile_panel.py` covering a Poisson-distributed outcome
with a small share of negative integers spliced in: asserts
`is_count_like=False` despite the other four conditions firing.
P2 (test coverage for both P1s):
Both regressions above guard the new contracts. The guide test
guards the wording surface; the profile test guards the heuristic.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments