Skip to content

fix(lwdid): preserve fitted overall inference - #1

Open
shawcharles wants to merge 2 commits into
gorgeousfish:feature/lwdid-estimatorfrom
shawcharles:fix/lwdid-preserve-canonical-aggregation
Open

fix(lwdid): preserve fitted overall inference#1
shawcharles wants to merge 2 commits into
gorgeousfish:feature/lwdid-estimatorfrom
shawcharles:fix/lwdid-preserve-canonical-aggregation

Conversation

@shawcharles

@shawcharles shawcharles commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Implements the bounded result-provenance fix in igerber#733.

LWDiD.fit() already computes and stores the canonical overall ATT and its inference. LWDiDResults.aggregate(\"overall\") previously replaced that result with a separate aggregation built from marginal cohort effects and their standard errors. That could change the point estimate and discarded the composite-regression joint inference where it was available.

This change returns an equivalent result object containing the fitted canonical result instead of reconstructing a second estimator.

This does not establish the validity of the non-composite delta-method variance used by fit() for other staggered paths. That path still omits cross-cohort covariance; this PR ensures aggregate() no longer hides its provenance by replacing it with a different calculation. The remaining statistical work is tracked in igerber#735.

Test

  • Adds an end-to-end staggered regression test for the RA/classical/never-treated composite path.
  • The test asserts exact agreement of ATT, SE, t-statistic, p-value, confidence interval, and df_inference between fit() and aggregate(\"overall\").
  • Adds a slow, strict-xfail unit-cluster-bootstrap concordance test for non-composite staggered inference. It documents the covariance-aware target for LWDiD: use covariance-aware inference for staggered overall ATT igerber/diff-diff#735 and must be removed when that implementation passes it.
  • tests/test_lwdid.py: 64 passed.
  • The covariance test: expected xfail.
  • Black check passed for touched files.

This PR targets the source branch of igerber#588 so it can be merged there directly.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants