Repository navigation
Conversation
Overall assessment✅ Looks good — no unmitigated P0 or P1 findings. One P3 documentation clarification. Executive summary
MethodologyP3 — Qualify the never-treated control advice as OLS-only. Location: Impact: The closing advice recommends This behavior is explicitly documented in Concrete fix: Label the control-group distinction and closing recommendation as applying to Code QualityNo findings. No new production inference calculations, parameter propagation, or NaN-handling paths are introduced. PerformanceNo findings. Expensive TROP re-derivations carry the MaintainabilityNo findings. The drift tests use the shared notebook helpers, and repaired notebooks leave the convention allowlist. Tech DebtNo new untracked concern identified. Existing TROP convergence-default limitations are tracked in SecurityNo findings in the reviewed changes. Documentation/TestsNo additional findings. Notebook code parses, execution counts are sequential, and committed outputs contain no errors. Static convention checks and output-quote checks passed; numerical re-derivation remains unverified in this environment. |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The prior ETWFE finding is resolved in the assumptions and closing guidance. The remaining findings concern documentation accuracy and are P2 or P3. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. The expensive TROP numerical checks are marked MaintainabilityNo findings. The drift tests reuse the shared notebook helpers, and the seven notebooks leave the convention allowlist. Tech Debt
SecurityNo findings in the reviewed changes. Documentation/Tests
The changelog fragment passed the repository’s fragment check. I used the supplied diff for scope because the checkout is shallow. The environment lacked pytest and the scientific Python dependencies, so verification covered notebook syntax, static conventions, prose assertions, and committed output quotes. |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment⛔ Blocker. A newly identified Stacked DiD control-selection bug can silently bias the ATT when Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. The expensive TROP re-derivations are marked MaintainabilityNo findings. Tech Debt
SecurityNo findings in the reviewed changes. Documentation/Tests
Path to Approval
I used the supplied diff for scope because the checkout lacks the prior reviewed commit. The Stacked DiD counterexample was verified from the current selection predicate and the weighted cell contrasts. Full estimator and notebook reruns remained unverified because the environment lacked pytest and the scientific Python dependencies. |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment⛔ Blocker. The prior Stacked DiD point-estimate bug is fixed. The new cutoff can also remove sampled primary sampling units (PSUs) from the survey variance calculation, producing incorrect standard errors and confidence intervals. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
Path to Approval
I used the supplied diff for review scope because the checkout is shallow. I verified both Stacked DiD cases by executing the selection predicates and calculating the weighted contrasts and survey variance independently. The checkout lacked pytest and the scientific Python dependencies, so full estimator and notebook runs remain unverified. The paper cross-check used the repository’s Methodology Registry and source reviews because the external paper host was unreachable. |
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment⛔ Blocker. The new guard rejects the strict-cutoff census case from the prior review. A related case still returns a zero standard error when StackedDiD uses unit-by-sub-experiment pairs as survey sampling units. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/TestsThe prior documentation findings are resolved. The ImputationDiD efficiency wording also matches Borusyak, Jaravel & Spiess’s Theorems 1–2, which establish minimum variance among linear unbiased estimators under spherical errors and allow unrestricted treatment-effect heterogeneity. docs/tutorials/14_continuous_did.ipynb:L323 · docs/tutorials/15_efficient_did.ipynb:L526 · changelog.d/20261125-tutorials-staggered-family.md:L14 · docs/methodology/papers/borusyak-jaravel-spiess-2024-review.md:L51 I verified the selection predicates and independently calculated the WLS contrast and survey variance. The checkout lacked pytest and the scientific Python dependencies, so the full fits and notebooks remain unverified. The paper cross-check used the Registry and repository source reviews because the external hosts were unreachable. Path to Approval
|
…0-15, 16 Wooldridge), with drift tests Imputation DiD efficiency condition corrected across the documentation (spherical errors, not homogeneous effects).
…d ETWFE parity statements; guard the event-study comparison in 16
…arry the ETWFE parity conditions into its summary and skip the mpdta fits on fallback data (16)
…t the slope (14); the default ETWFE precision gain is the tutorial panel's (16)
426b42b to
298cb46
Compare
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The current base resolves the prior StackedDiD survey blocker and includes a regression test for the reported panel. The remaining findings concern tutorial guidance. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I independently calculated the prior survey case’s expected SE as |
… the asymmetric window leaves the stacked estimate unchanged (13)
… unchanged, not the standard errors exactly (13); test the diagnostics guidance in 14 and 16
…tacked SE ratio above roundoff
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The prior findings are resolved. The diff changes tutorial examples, documentation, and tests, with no changes to estimator logic. The remaining findings are P2 or P3. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I ran the static checks directly and independently calculated the |
…eighted fit; describe TROP's factor matrix as an average; cluster the mpdta example by state as well (16)
…he individual fits (10); run the notebook's state-clustering cell in its drift test
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. No unmitigated P0 or P1 findings. The library changes are limited to docstrings. The remaining findings concern tutorial interpretation and test coverage. Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
The checkout lacked pytest and the scientific Python dependencies, so I did not rerun the notebooks or numerical drift suite. I used the Registry and in-repository paper reviews for source checks because external paper access was unavailable. |
…keep the TROP rank reading at the returned matrix (10); a fallback with the fixture present fails the mpdta drift tests
…e mpdta estimates are the same 20 counties (16)
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The prior findings are addressed. No unmitigated P0 or P1 findings remain. Executive summary
Methodology
Code QualityNo findings. Performance
MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I parsed all 99 code cells, matched all 43 committed output pins, and checked the changelog fragment. Source checks used the Registry and in-repository paper reviews. The checkout lacked pytest and the scientific Python dependencies, so the notebook and drift suites were not rerun. |
…are kept; say what a binary analysis retains (14); load mpdta once per test module
…ly output (14); assert which cells the cubic spline drops
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. No unmitigated P0 or P1 findings remain. Executive summary
Methodology
Code QualityNo findings. Performance
MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/TestsNo additional findings. I parsed 99 notebook code cells, matched all 43 committed output pins, verified the |
…cients is a balanced-panel one (16); copy the pinned mpdta file into the isolated Unix test lane
…ssingness unrelated to time-varying shocks (16); pin the mpdta file to LF and copy it into the Windows test lane
…ading does not hold, wherever the gaps are (16)
…anced, no-covariate case and say only that it does not carry over (16)
… case, what gaps and time-varying covariates change, and the missing-data condition (16)
…ng (16); test that a time-constant covariate keeps the reference-period reading
…ement (16); the drift test docstring says gaps can, not must
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. No unmitigated P0 or P1 findings. The two findings from the prior review are resolved. Executive summary
Methodology
Code QualityNo findings. PerformanceNo remaining findings. The committed CSV removes the prior download dependency for canonical-data checks in the isolated Rust jobs. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I used the supplied diff to scope this re-review because the checkout is shallow. I parsed 99 notebook code cells, matched all 43 committed output pins, and passed the changelog check. I inspected the Windows workflow without running it. The available Python environments lacked pytest and the scientific dependencies, so the notebook and drift suites remain unverified in this review. |
…nous (16); the mpdta fixture fails on a checksum mismatch
… and must not respond to treatment; describe the reference-move warning by the cohort's latest observed pre-period (16)
… effect; the two reference warnings can appear together (16)
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The prior blocking findings remain resolved. This re-review found no unmitigated P0 or P1 issues. Executive summary
Methodology
Code Quality
PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I used the supplied diff to scope the review because the checkout is shallow. I parsed all 99 notebook code cells, matched all 43 committed output pins, and passed the changelog check. The pytest and notebook execution suites and the Windows CI job remain unverified in this review. |
…ainst the log fit (16); guard the zero factor matrix in the singular-value cell (10); run the Rust suite when the pinned mpdta file changes
…ix; tie the quoted Poisson interval to the live fit
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. All prior actionable findings are resolved at Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I used the supplied diff to scope the review because the checkout is shallow. All 99 notebook code cells parsed, all 43 literal output pins matched, and the changelog check passed. Pytest, notebook execution, and the Windows CI job remain unverified in this review. |
…ted units (14); check the Poisson interval endpoints before reading the notebook
…e notebook-dependent assertions
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment✅ Looks good. The prior findings are resolved at Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/Tests
I used the supplied diff to scope the review because the checkout is shallow. The static convention checks passed for 35 notebooks, all 99 changed notebook code cells compiled, all 43 literal output pins matched, and the changelog check passed. The review environment lacked pytest and the scientific Python dependencies, so runtime tests, notebook execution, and the Windows CI job remain unverified in this review. |
…14); test it on a valid lowest-dose panel
|
🔁 AI review rerun (requested by @igerber) Head SHA: Overall assessment⛔ Blocker at Executive summary
Methodology
Code QualityNo findings. PerformanceNo findings. MaintainabilityNo findings. Tech Debt
SecurityNo findings. Documentation/TestsNo separate findings. The PR includes a documentation changelog fragment. Path to Approval
I scoped the review with the supplied diff because the checkout is shallow. Static checks passed for 35 notebook convention checks, 99 compiled notebook code cells, 43 literal output pins, the changelog, and the fixture checksum. I verified the covariance counterexample algebraically. The environment lacked pytest and the scientific Python dependencies, so runtime tests and Windows execution remain unverified. |
Summary
Fourth PR of the post-4.0 tutorial repair (after #906, #911 and #916). Documentation and tests, plus one CI workflow change (below): the
StackedDiDanticipation and survey fixes that were first folded in here landed separately in #923, and this branch is now rebuilt on top of it. Fixes the defects found in the staggered-estimator tutorials and brings each to the tutorial conventions in CONTRIBUTING.md, keeping each notebook's own narrative. Every notebook is committed with executed outputs (Rust backend) and has a drift test that pins the numbers its prose quotes.10_trop: the bias bound is scoped to a single treated block with fixed weights, no spillovers is stated as an assumption, and on/off treatment states its no-carryover requirement. Every fit used the default iteration cap and did not converge on the tutorial's data; the fits now converge and the cap is explained. The claim that TROP recovers the effect where Synthetic DiD is biased, which the notebook's own numbers contradicted, is replaced by a comparison across simulated panels: DiD is unreliable under factor confounding, and TROP and Synthetic DiD have similar observed errors in that design. The time weights are described as centred on the period of the observation being predicted, not on the adoption date, andeffective_rankandfactor_matrixas properties of the average of the per-observation fits, which says nothing about the rank of any single fit; the singular-value cell handles a factor matrix shrunk to zero.11,12,13: the simulated data used the generator's default of effects that grow over time while every table was labelled "True effect = 2.0" (the true average was about 2.42). The generator is now called with a constant effect, so the stated truth is the truth.11_imputation_did: no longer described as efficient "under homogeneous effects". It is unbiased under arbitrary effect heterogeneity, and efficient under spherical errors (equal variance, uncorrelated across units and periods). The pre-test result (Proposition 9) is stated for the pre-treatment coefficients, with independence only under normal errors, and the Callaway-Sant'Anna alternative for suspect early periods is named as the never-treated one.12_two_stage_did: the pre-treatment coefficients the prose described are now produced (pretrends=True); the comparison with Imputation DiD separates what is identical (the overall and post-treatment estimates) from what differs (standard errors, and the pre-treatment coefficients).13_stacked_did: the overall estimate is stated to be an average over the event window; the clustering section no longer claimsunit_subexpgives narrower standard errors (it gives wider ones in the example); clean-control definitions are no longer ranked by "strength of identification". The weighting section follows fix(stacked_did): complete event windows and equal cohort shares on both arms (all weightings, survey weights) #914: under"population"and"sample_share"treated rows are reweighted as well as controls, and the two estimates in that table are the corrected ones (1.960 and 1.939, previously 1.948 and 1.915). The population column is described as per-unit, with the implied cohort weights stated (24%, 61%, 15%). The clean-control section gives the rule under anticipation, as implemented in fix(stacked_did): anticipation-aware clean controls and survey-inference fixes #923, and the anticipation section says the event window grows by the anticipation periods and can trim a cohort.14_continuous_did: the removedoverall_attname is gone; strong parallel trends is described as an assumption about outcomes under treatment, which the old text mis-stated as the standard assumption. The claim that a binary Callaway-Sant'Anna fit returns the same overall ATT is limited to one cohort: on the notebook's two-cohort panel the two give 4.707 and 4.674, because they weight cohort-period effects differently, which is now shown. The Honest DiD pointer names a universal-base binary fit, since aContinuousDiDevent study is not accepted there. The identification table gains the own-dose effect ATT(d|d), which parallel trends alone identifies with an untreated comparison group, andcontrol_group="lowest_dose"is described with its requirements and with what it rebases (effect levels, not the slope). The overall ATT is said to be independent of the spline only while the same cohort-period cells are kept (a three-unit cohort is estimated under a linear spline and skipped under a cubic one, moving it from 4.638 to 4.608), and a binary analysis is said to keep its cohort-period and event-study summaries while losing the dose-response curve. Thenot_yet_treatedoption is said to still need never-treated units, andlowest_doseto needcovariatesleft atNone.15_efficient_did: the comparison set under PT-All is described correctly; the hard-coded "condition number > 100" flag, which marked most of the tutorial's own cells, is gone;EfficientDiD.hausman_pretestis shown; each PT-All comparison is described as two changes through a baseline period.16_wooldridge_etwfe: ETWFE and Callaway-Sant'Anna are compared on the same control group and the same pre-treatment reference period (base_period="universal"), where they coincide at every event time on a balanced panel without covariates (on an unbalanced version of the tutorial panel they differ by 0.004 at one event time); the comparison cell stops if the two event studies do not cover the same event times; thempdtasection prints the data's provenance and skips its fits when the loader returns simulated data, labels its intervals as county-clustered (thejwdidbenchmark) and adds a state-clustered fit, since minimum wages are set by states (same estimate, SE 0.019 against 0.013), and says which cohorts each event-study horizon averages (event times 2 and 3 are the 2004 cohort alone, 20 counties in one state); the Poisson and logit examples gain a truth check, and thempdtaPoisson result is stated with its county-clustered interval and no precision ranking against the log fit. Placebo coefficients and the never-treated advice are scoped to the linear model. The reading of a never-treated coefficient as a difference-in-differences against the reference period is stated for a balanced panel without covariates; gaps in the panel or time-varying covariates can let outcomes in other periods move the post-treatment coefficients (on a three-period example an early shock moves the estimate from 2.0 to -0.5 once one row is missing), and with gaps the fit needs missingness to be unrelated to the idiosyncratic outcome shocks. Time-varying covariates are said to need strict exogeneity and to be unaffected by treatment, with parallel trends then conditional on them; Poisson and logit are described with cohort and period effects; the reference period on an unbalanced panel is stated correctly.plot_event_study.CallawaySantAnna(base_period="universal")fit of the same data and say the result describes that fit.13explains why its asymmetric window leaves the point estimates unchanged (same treated units, clean controls, weights and reference period).llmsguides, the estimator-choice page, references, the API pages and theImputationDiDdocstring). The longer statements scope the guarantee to the unweighted fit: with survey weights the first stage is weighted least squares.did2sreference (Butts & Gardner 2022) is cited as The R Journal 14(3), not 14(1).tests/test_tutorial_conventions.py: the seven notebooks leave the ratchet allowlist..github/workflows/rust-test.ymlcopies the pinnedbenchmarks/data/real/mpdta.csvnext to the isolated tests (Unix and Windows), so the canonical-data tests run offline there, and the workflow now also triggers on changes to that file or to.gitattributes(a checksum mismatch on that file now fails the tutorial's drift tests instead of skipping them); a new.gitattributesentry pins that file to LF so its bytes match the loader's checksum on Windows. The Windows leg was not run locally.TODO.md: the TROP convergence row records that the two backends report cross-validation non-convergence differently (the pure-Python search warns about a candidate penalty, the Rust search does not; both select the same penalties).No library behavior changes:
diff_diff/imputation.pyanddiff_diff/two_stage.pychange in docstrings only.Methodology references (required if estimator / math changes)
docs/methodology/papers/borusyak-jaravel-spiess-2024-review.md.Validation
tests/test_t10_trop_drift.pythroughtests/test_t16_wooldridge_etwfe_drift.py;tests/test_tutorial_conventions.pyupdated. At the head, the drift tests, the conventions guard and the docs-structure, changelog, tracking, doc-snippet, workflow-guard and dataset tests pass on the Rust backend (905 passed, slow tests excluded) and the drift tests and the guard pass on the pure-Python backend (185 passed). The slow TROP re-derivations last ran on Rust a few prose and test commits earlier (907 passed with them). Thempdtadrift tests feed the loader the committed source file, so the canonical numbers are checked offline, and a checksum mismatch fails them.13_stacked_didwas re-executed on the Rust backend againstmainafter fix(stacked_did): anticipation-aware clean controls and survey-inference fixes #923 and its outputs are unchanged;16_wooldridge_etwfewas re-executed after its comparison andmpdtacells changed, including the new state-clustered cell.10_tropwas re-executed after its singular-value cell changed; every output is identical. Notebooks 11-15 and 16 (Wooldridge) passpytest --nbmakeon the pure-Python backend.10_tropis excluded from that CI job for runtime and was executed on the Rust backend. The Sphinx-Wbuild and the search-excerpt smoke test pass locally.Security / privacy
Changelog
changelog.d/20261125-tutorials-staggered-family.md,### Documentation)