Skip to content

Commit dc443d5

Browse files
igerberclaude
andcommitted
Address PR #372 R1 review (2 P1, 2 P2, 1 P3)
P1 - docs/references.rst incomplete (5 missing citations) - Add Baker, Larcker, Wang & Wang (2025) - "Difference-in-Differences Designs: A Practitioner's Guide" arXiv:2503.13323; backs the 8-step Practitioner Workflow now surfaced in README and llms-practitioner.txt. - Add Callaway, Goodman-Bacon & Sant'Anna (2024) - "Difference-in-Differences with a Continuous Treatment" NBER WP 32117; backs ContinuousDiD (under new "Continuous Treatment DiD" section). - Add Chen, Sant'Anna & Xie (2025) - "Efficient Difference-in-Differences and Event Study Estimators"; backs EfficientDiD. - Add de Chaisemartin & D'Haultfoeuille (2022, revised 2024) NBER WP 29873; dynamic companion to dCDH 2020, backs the cohort-recentered plug-in variance formula. - Add Wooldridge (2025) Empirical Economics + Wooldridge (2023) Econometrics Journal under new "Wooldridge ETWFE" sub-section; backs WooldridgeDiD's saturated OLS and logit/Poisson QMLE paths. P1 - .claude/commands/docs-check.md - Replace broken `awk '/^## Estimators/,/^## /'` (self-terminates on opening H2) with a flag-based extractor that skips the heading and stops at the next H2. - Special-case diagnostic-class items (HonestDiD): the workflow text now routes them to `## Diagnostics & Sensitivity` in both llms.txt and README, matching the existing table. P2 - docs/doc-deps.yaml - Retarget HonestDiD's README entry from "Estimators (one-line catalog entry)" to "Diagnostics & Sensitivity (one-line entry)" so /docs-impact flags the correct README section. - Add `- path: docs/references.rst` (type: user_guide) to all 18 method- backed source modules so /docs-impact and /pre-merge-check warnings surface bibliography updates when source code changes. P2 - README.md absolute links - L83 docs/methodology/REPORTING.md, L182 CITATION.cff, L184 CONTRIBUTORS.md switched to absolute https://github.com/igerber/diff-diff/blob/main/... URLs so they resolve on PyPI (which does not auto-resolve relative paths). P3 - README.md tutorial count - Drop the "18" hard-coded count in the Tutorials bullet to prevent future drift; repo currently has 19 notebooks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f82d3b5 commit dc443d5

4 files changed

Lines changed: 97 additions & 11 deletions

File tree

.claude/commands/docs-check.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,38 @@ Determine which checks to run based on `$ARGUMENTS`.
115115

116116
### 2. llms.txt + README Catalog Check
117117

118-
For each estimator in the table above:
119-
1. Read `diff_diff/guides/llms.txt` and verify the estimator name appears under `## Estimators`
120-
2. Read `README.md` and verify the estimator name appears in the `## Estimators` flat catalog (one-line entry)
118+
For each estimator/diagnostic in the table above:
119+
120+
1. Read `diff_diff/guides/llms.txt` and verify the name appears under the right section:
121+
- **Estimators** (e.g. CallawaySantAnna, SunAbraham, TROP, BaconDecomposition): under `## Estimators`
122+
- **Diagnostics-class** (HonestDiD, and any future diagnostic-only entries): under `## Diagnostics and Sensitivity Analysis`
123+
2. Read `README.md` and verify the name appears in the matching flat catalog:
124+
- **Estimators**: in the `## Estimators` section
125+
- **Diagnostics-class** (HonestDiD): in the `## Diagnostics & Sensitivity` section
121126
3. Report missing entries
122127

123128
```bash
124-
# Example: Check that "CallawaySantAnna" appears in both llms.txt and the README catalog
129+
# Extract the README ## Estimators section. Use a flag-based awk because the
130+
# range form `awk '/^## Estimators/,/^## /'` self-terminates on the opening H2.
131+
extract_section() {
132+
awk -v target="$1" '
133+
$0 == "## " target { flag=1; next }
134+
flag && /^## / { flag=0 }
135+
flag { print }
136+
' README.md
137+
}
138+
139+
# Example: an estimator (lives in ## Estimators)
140+
extract_section "Estimators" | grep -c 'CallawaySantAnna'
141+
142+
# Example: a diagnostic (lives in ## Diagnostics & Sensitivity)
143+
extract_section "Diagnostics & Sensitivity" | grep -c 'Honest DiD'
144+
145+
# Always verify both surfaces
125146
grep -c 'CallawaySantAnna' diff_diff/guides/llms.txt
126-
awk '/^## Estimators/,/^## /' README.md | grep -c 'CallawaySantAnna'
127147
```
128148

129-
Do NOT search for per-estimator README sections - they were intentionally removed in the 2026-04 docs refresh. The README's `## Estimators` heading is the only valid catalog surface.
149+
Do NOT search for per-estimator README sections - they were intentionally removed in the 2026-04 docs refresh. The README's `## Estimators` and `## Diagnostics & Sensitivity` headings are the only valid catalog surfaces.
130150

131151
### 3. Scholarly References Check
132152

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ results.print_summary() # full statsmodels-style table
5151

5252
- [Quickstart](https://diff-diff.readthedocs.io/en/stable/quickstart.html) - basic 2x2 DiD with column-name and formula interfaces, covariates, fixed effects, cluster-robust SEs
5353
- [Choosing an Estimator](https://diff-diff.readthedocs.io/en/stable/choosing_estimator.html) - decision flowchart for picking the right estimator
54-
- [Tutorials](https://diff-diff.readthedocs.io/en/stable/tutorials/01_basic_did.html) - 18 hands-on Jupyter notebooks covering every estimator and design pattern
54+
- [Tutorials](https://diff-diff.readthedocs.io/en/stable/tutorials/01_basic_did.html) - hands-on Jupyter notebooks covering every estimator and design pattern
5555
- [Troubleshooting](https://diff-diff.readthedocs.io/en/stable/troubleshooting.html) - common issues and solutions
5656
- [R Comparison](https://diff-diff.readthedocs.io/en/stable/r_comparison.html) | [Python Comparison](https://diff-diff.readthedocs.io/en/stable/python_comparison.html) | [Benchmarks](https://diff-diff.readthedocs.io/en/stable/benchmarks.html) - validation results vs `did`, `synthdid`, `fixest`
5757
- [API Reference](https://diff-diff.readthedocs.io/en/stable/api/index.html) - full API for all estimators, results classes, diagnostics, utilities
@@ -80,7 +80,7 @@ Measuring campaign lift? Evaluating a product launch? Rolling out a policy in wa
8080
- [Brand awareness survey tutorial](https://diff-diff.readthedocs.io/en/stable/tutorials/17_brand_awareness_survey.html) - full example with complex survey design, brand funnel analysis, and staggered rollouts
8181
- Have BRFSS/ACS/CPS individual records? Use [`aggregate_survey()`](https://diff-diff.readthedocs.io/en/stable/api/prep.html) to roll respondent-level microdata into a geographic-period panel with inverse-variance precision weights for second-stage DiD
8282

83-
`BusinessReport` and `DiagnosticReport` are experimental preview classes that produce plain-English output and a structured `to_dict()` schema from any fitted result - wording and schema will evolve. See [docs/methodology/REPORTING.md](docs/methodology/REPORTING.md) for usage and stability notes.
83+
`BusinessReport` and `DiagnosticReport` are experimental preview classes that produce plain-English output and a structured `to_dict()` schema from any fitted result - wording and schema will evolve. See [docs/methodology/REPORTING.md](https://github.com/igerber/diff-diff/blob/main/docs/methodology/REPORTING.md) for usage and stability notes.
8484

8585
## Practitioner Workflow (Baker et al. 2025)
8686

@@ -179,9 +179,9 @@ If you use diff-diff in your research, please cite it:
179179

180180
The DOI above is the Zenodo concept DOI - it always resolves to the latest release. To cite a specific version, look up its versioned DOI on [the Zenodo project page](https://doi.org/10.5281/zenodo.19646175).
181181

182-
See [`CITATION.cff`](CITATION.cff) for the full citation metadata.
182+
See [`CITATION.cff`](https://github.com/igerber/diff-diff/blob/main/CITATION.cff) for the full citation metadata.
183183

184-
**Note on authorship**: academic citation (`CITATION.cff`, the BibTeX above) lists individual authors with ORCIDs per scholarly convention. Package metadata surfaces (`pyproject.toml`, Sphinx docs) list "diff-diff contributors" to acknowledge the collective - see [`CONTRIBUTORS.md`](CONTRIBUTORS.md) for the full list.
184+
**Note on authorship**: academic citation (`CITATION.cff`, the BibTeX above) lists individual authors with ORCIDs per scholarly convention. Package metadata surfaces (`pyproject.toml`, Sphinx docs) list "diff-diff contributors" to acknowledge the collective - see [`CONTRIBUTORS.md`](https://github.com/igerber/diff-diff/blob/main/CONTRIBUTORS.md) for the full list.
185185

186186
## License
187187

docs/doc-deps.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ sources:
9696
- path: README.md
9797
section: "Estimators (one-line catalog entry)"
9898
type: user_guide
99+
- path: docs/references.rst
100+
type: user_guide
99101
- path: diff_diff/guides/llms-full.txt
100102
section: "DifferenceInDifferences"
101103
type: user_guide
@@ -137,6 +139,8 @@ sources:
137139
- path: README.md
138140
section: "Estimators (one-line catalog entry)"
139141
type: user_guide
142+
- path: docs/references.rst
143+
type: user_guide
140144
- path: diff_diff/guides/llms-full.txt
141145
section: "CallawaySantAnna"
142146
type: user_guide
@@ -183,6 +187,8 @@ sources:
183187
- path: README.md
184188
section: "Estimators (one-line catalog entry)"
185189
type: user_guide
190+
- path: docs/references.rst
191+
type: user_guide
186192
- path: diff_diff/guides/llms-full.txt
187193
section: "SunAbraham"
188194
type: user_guide
@@ -206,6 +212,8 @@ sources:
206212
- path: README.md
207213
section: "Estimators (one-line catalog entry)"
208214
type: user_guide
215+
- path: docs/references.rst
216+
type: user_guide
209217
- path: diff_diff/guides/llms-full.txt
210218
section: "ImputationDiD"
211219
type: user_guide
@@ -227,6 +235,8 @@ sources:
227235
- path: README.md
228236
section: "Estimators (one-line catalog entry)"
229237
type: user_guide
238+
- path: docs/references.rst
239+
type: user_guide
230240
- path: diff_diff/guides/llms-full.txt
231241
section: "TwoStageDiD"
232242
type: user_guide
@@ -248,6 +258,8 @@ sources:
248258
- path: README.md
249259
section: "Estimators (one-line catalog entry)"
250260
type: user_guide
261+
- path: docs/references.rst
262+
type: user_guide
251263
- path: diff_diff/guides/llms-full.txt
252264
section: "EfficientDiD"
253265
type: user_guide
@@ -270,6 +282,8 @@ sources:
270282
- path: README.md
271283
section: "Estimators (one-line catalog entry)"
272284
type: user_guide
285+
- path: docs/references.rst
286+
type: user_guide
273287
- path: diff_diff/guides/llms-full.txt
274288
section: "ChaisemartinDHaultfoeuille"
275289
type: user_guide
@@ -302,6 +316,8 @@ sources:
302316
- path: README.md
303317
section: "Estimators (one-line catalog entry)"
304318
type: user_guide
319+
- path: docs/references.rst
320+
type: user_guide
305321
- path: diff_diff/guides/llms-full.txt
306322
section: "ContinuousDiD"
307323
type: user_guide
@@ -326,6 +342,8 @@ sources:
326342
- path: README.md
327343
section: "Estimators (one-line catalog entry)"
328344
type: user_guide
345+
- path: docs/references.rst
346+
type: user_guide
329347
- path: diff_diff/guides/llms-full.txt
330348
section: "SyntheticDiD"
331349
type: user_guide
@@ -352,6 +370,8 @@ sources:
352370
- path: README.md
353371
section: "Estimators (one-line catalog entry)"
354372
type: user_guide
373+
- path: docs/references.rst
374+
type: user_guide
355375
- path: diff_diff/guides/llms-full.txt
356376
section: "TripleDifference"
357377
type: user_guide
@@ -373,6 +393,8 @@ sources:
373393
- path: README.md
374394
section: "Estimators (one-line catalog entry)"
375395
type: user_guide
396+
- path: docs/references.rst
397+
type: user_guide
376398
- path: diff_diff/guides/llms-full.txt
377399
section: "StackedDiD"
378400
type: user_guide
@@ -394,6 +416,8 @@ sources:
394416
- path: README.md
395417
section: "Estimators (one-line catalog entry)"
396418
type: user_guide
419+
- path: docs/references.rst
420+
type: user_guide
397421
- path: diff_diff/guides/llms-full.txt
398422
section: "WooldridgeDiD"
399423
type: user_guide
@@ -415,6 +439,8 @@ sources:
415439
- path: README.md
416440
section: "Estimators (one-line catalog entry)"
417441
type: user_guide
442+
- path: docs/references.rst
443+
type: user_guide
418444
- path: diff_diff/guides/llms-full.txt
419445
section: "TROP"
420446
type: user_guide
@@ -436,7 +462,9 @@ sources:
436462
- path: docs/tutorials/05_honest_did.ipynb
437463
type: tutorial
438464
- path: README.md
439-
section: "Estimators (one-line catalog entry)"
465+
section: "Diagnostics & Sensitivity (one-line entry)"
466+
type: user_guide
467+
- path: docs/references.rst
440468
type: user_guide
441469
- path: diff_diff/guides/llms-full.txt
442470
section: "HonestDiD"
@@ -455,6 +483,8 @@ sources:
455483
- path: README.md
456484
section: "Estimators (one-line catalog entry)"
457485
type: user_guide
486+
- path: docs/references.rst
487+
type: user_guide
458488

459489
# ── Diagnostics & analysis ───────���─────────────────────────────────
460490

@@ -493,6 +523,8 @@ sources:
493523
- path: README.md
494524
section: "For Data Scientists (one-line mention)"
495525
type: user_guide
526+
- path: docs/references.rst
527+
type: user_guide
496528
- path: diff_diff/guides/llms-full.txt
497529
section: "BusinessReport"
498530
type: user_guide
@@ -508,6 +540,8 @@ sources:
508540
- path: README.md
509541
section: "For Data Scientists (one-line mention)"
510542
type: user_guide
543+
- path: docs/references.rst
544+
type: user_guide
511545
- path: diff_diff/guides/llms-full.txt
512546
section: "DiagnosticReport"
513547
type: user_guide
@@ -543,6 +577,8 @@ sources:
543577
- path: README.md
544578
section: "Survey Support"
545579
type: user_guide
580+
- path: docs/references.rst
581+
type: user_guide
546582
- path: diff_diff/guides/llms-full.txt
547583
section: "Survey"
548584
type: user_guide

docs/references.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,17 @@ Two-Way Fixed Effects
1919

2020
- **Imai, K., & Kim, I. S. (2021).** "On the Use of Two-Way Fixed Effects Regression Models for Causal Inference with Panel Data." *Political Analysis*, 29(3), 405-415. https://doi.org/10.1017/pan.2020.33
2121

22+
Wooldridge ETWFE
23+
----------------
24+
25+
- **Wooldridge, J. M. (2025).** "Two-Way Fixed Effects, the Two-Way Mundlak Regression, and Difference-in-Differences Estimators." *Empirical Economics*, 69(5), 2545-2587. (Published version of NBER Working Paper 29154.)
26+
27+
Primary source for the saturated OLS ETWFE design implemented in our ``WooldridgeDiD`` class.
28+
29+
- **Wooldridge, J. M. (2023).** "Simple Approaches to Nonlinear Difference-in-Differences with Panel Data." *The Econometrics Journal*, 26(3), C31-C66. https://doi.org/10.1093/ectj/utad016
30+
31+
Secondary source for the logit/Poisson QMLE (ASF-based ATT) extensions in ``WooldridgeDiD``.
32+
2233
Robust Standard Errors
2334
----------------------
2435

@@ -131,10 +142,29 @@ Multi-Period and Staggered Adoption
131142

132143
- **de Chaisemartin, C., & D'Haultfœuille, X. (2020).** "Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects." *American Economic Review*, 110(9), 2964-2996. https://doi.org/10.1257/aer.20181169
133144

145+
- **de Chaisemartin, C., & D'Haultfœuille, X. (2022, revised 2024).** "Difference-in-Differences Estimators of Intertemporal Treatment Effects." *NBER Working Paper* 29873. https://www.nber.org/papers/w29873
146+
147+
Dynamic companion to the 2020 paper. Web Appendix Section 3.7.3 contains the cohort-recentered plug-in variance formula implemented in our ``ChaisemartinDHaultfoeuille`` class.
148+
134149
- **Goodman-Bacon, A. (2021).** "Difference-in-Differences with Variation in Treatment Timing." *Journal of Econometrics*, 225(2), 254-277. https://doi.org/10.1016/j.jeconom.2021.03.014
135150

136151
- **Wing, C., Freedman, S. M., & Hollingsworth, A. (2024).** "Stacked Difference-in-Differences." *NBER Working Paper* 32054. https://www.nber.org/papers/w32054
137152

153+
- **Chen, X., Sant'Anna, P. H. C., & Xie, H. (2025).** "Efficient Difference-in-Differences and Event Study Estimators." *Working Paper*.
154+
155+
Primary source for the optimal-weighting / PT-All / PT-Post efficient DiD implemented in our ``EfficientDiD`` class.
156+
157+
- **Baker, A. C., Larcker, D. F., Wang, C. C. Y., & Wang, X. (2025).** "Difference-in-Differences Designs: A Practitioner's Guide." *arXiv preprint* arXiv:2503.13323. https://arxiv.org/abs/2503.13323
158+
159+
Source for the 8-step practitioner workflow surfaced via ``diff_diff.get_llm_guide("practitioner")`` and the README ``## Practitioner Workflow`` section. See ``docs/methodology/REGISTRY.md`` for the diff-diff renumbering and per-step deviations.
160+
161+
Continuous Treatment DiD
162+
------------------------
163+
164+
- **Callaway, B., Goodman-Bacon, A., & Sant'Anna, P. H. C. (2024).** "Difference-in-Differences with a Continuous Treatment." *NBER Working Paper* 32117. https://www.nber.org/papers/w32117
165+
166+
Primary source for ATT(d), ACRT, dose-response curves, and B-spline flexibility implemented in our ``ContinuousDiD`` class.
167+
138168
Power Analysis
139169
--------------
140170

0 commit comments

Comments
 (0)