Skip to content

LWDiD: use covariance-aware inference for staggered overall ATT #735

Description

@shawcharles

Summary

For staggered LWDiD paths outside the composite-regression gate, _aggregate_cohort_effects() computes the overall standard error as a weighted sum of marginal cohort variances under an independence assumption. Cohorts can share control units, so their estimates need not be independent.

This is distinct from #733. That issue ensures aggregate(\"overall\") no longer replaces the inference produced by fit(). This issue concerns the statistical validity and provenance of the inference that fit() itself produces on the non-composite paths.

Evidence

On a fixed, staggered, never-treated synthetic panel with rolling=\"demean\", estimator=\"ra\", and vce=\"hc1\":

analytical delta SE:       0.0604633
unit-cluster bootstrap SE: 0.0740364
ratio:                     1.22448

The design uses three treated cohorts that share never-treated controls. A unit-cluster bootstrap is materially wider, consistent with positive cross-cohort covariance omitted by the current delta calculation.

Relevant implementation:

diff-diff/diff_diff/lwdid.py

Lines 1619 to 1625 in c2694ff

# SE via delta method (assuming independence across cohorts)
# Var(weighted_avg) = sum(w_g^2 * se_g^2)
valid_ses = np.isfinite(ses) & (ses > 0)
if valid_ses.all():
var_att = float(np.sum(weights**2 * ses**2))
se = float(np.sqrt(var_att))
else:

Proposed direction

  • Retain a joint covariance or influence-function representation for cohort effects and use it for overall aggregation.
  • Surface an explicit inference provenance field, for example composite_joint or cohort_independence_delta, in result serialisation and summaries.
  • Add a deterministic unit-cluster-bootstrap concordance test for the non-composite staggered path. Until covariance-aware inference is implemented, the test is expected to fail and documents the required target.

Acceptance criteria

  • Overall staggered inference accounts for covariance among cohort effects that share controls.
  • Result metadata identifies the inference basis.
  • The bootstrap-concordance test passes without an xfail marker.
  • The solution integrates with the shared result-object/event-study contract tracked in LWDiD event-study output needs the shared results contract #732.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions