Commit a214168
WooldridgeDiD: outcome-fit hint for OLS on binary/count outcomes
Add a non-fatal UserWarning when WooldridgeDiD(method="ols") is used on a
binary ({0,1}) or non-negative integer-count outcome. Following Wooldridge
(2023), the warning notes that a matching nonlinear model (logit / Poisson)
is often the MORE APPROPRIATE specification for such outcomes: it imposes
parallel trends on the link/index scale rather than in levels (level-PT is
only valid for continuous/unbounded outcomes), and the paper's Section 5
simulations show the linear model both biased and less precise where the
nonlinear mean holds. It is a different identifying assumption than linear
OLS -- which fits depends on which parallel-trends restriction holds -- so
the hint is a recommended comparison, not an automatic switch or a free
efficiency upgrade. OLS remains a valid QMLE for any response (Table 1).
- _suggest_nonlinear_method: pure, non-fatal detector (binary -> logit,
non-negative count with >2 distinct -> poisson; fractional/continuous/
negative/non-numeric -> None). Bounded binomial-style integers are not
separately distinguished from unbounded counts (documented heuristic).
- fit() gate 0g (OLS-only, stacklevel=2) emits the hint on the full
outcome column before sample filtering; never alters the fit or raises
- TestOutcomeFitHint: detector units (incl. the bounded-support case) +
gate behavior + suppression + paper-faithful framing guard
(more-appropriate / biased / different assumption / recommended-comparison)
- Docs: REGISTRY Note (LPT-vs-IPT + Section 5 evidence + two-sided framing
provenance), method docstring, llms-full.txt, wooldridge_etwfe.rst, CHANGELOG
- TODO: remove the Tier A + Methodology/Correctness rows (#216)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2cc3962 commit a214168
7 files changed
Lines changed: 244 additions & 5 deletions
File tree
- diff_diff
- guides
- docs
- api
- methodology
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
| |||
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1084 | 1084 | | |
1085 | 1085 | | |
1086 | 1086 | | |
1087 | | - | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1088 | 1091 | | |
1089 | 1092 | | |
1090 | 1093 | | |
| |||
0 commit comments