Skip to content

Commit e592a5b

Browse files
committed
PR #457 R9 polish: fix inverted-boundary wording in docstring example
R9 verdict was Looks good with 1 P3 informational item: the bacon_decompose docstring example said per-component parity holds "when first_treat is bounded below by min(time)" — that's the inverse of the correct condition. Under the library's `<= min(time)` remap rule, always-treated panels are exactly the ones WITH at least one non-sentinel `first_treat <= min(time)`, so per-component parity holds when all non-sentinel cohorts have `first_treat > min(time)` (i.e. bounded *above* by min(time), or equivalently "no first- period-treated cohorts"). Rephrased. Tests: 34/34 pass; no behavior change (docstring-only fix).
1 parent 9210aeb commit e592a5b

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

diff_diff/bacon.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1312,13 +1312,14 @@ def bacon_decompose(
13121312
>>> # Default: paper-faithful Goodman-Bacon (2021) Theorem 1 weights
13131313
>>> # (weights="exact"); matches R bacondecomp::bacon() at atol=1e-6 on
13141314
>>> # the aggregate (TWFE coefficient + weights-sum) across all panels,
1315-
>>> # and on the per-component breakdown when first_treat is bounded
1316-
>>> # below by min(time) (no always-treated). For panels with
1317-
>>> # always-treated units, the per-component breakdown diverges by
1318-
>>> # convention (Python remaps to U per paper footnote 11; R emits
1319-
>>> # `Later vs Always Treated`); see REGISTRY note on R parity
1320-
>>> # convention divergence. Validated via
1321-
>>> # tests/test_methodology_bacon.py::TestBaconParityR.
1315+
>>> # and on the per-component breakdown when there are no
1316+
>>> # always-treated / first-period-treated cohorts (i.e. all
1317+
>>> # non-sentinel first_treat values are strictly greater than
1318+
>>> # min(time)). For panels with always-treated units, the
1319+
>>> # per-component breakdown diverges by convention (Python remaps
1320+
>>> # to U per paper footnote 11; R emits `Later vs Always Treated`);
1321+
>>> # see REGISTRY note on R parity convention divergence. Validated
1322+
>>> # via tests/test_methodology_bacon.py::TestBaconParityR.
13221323
>>> results = bacon_decompose(
13231324
... data=panel_df,
13241325
... outcome='earnings',

0 commit comments

Comments
 (0)