Skip to content

Keep never-treated units in make_did_CS2021 with float time and anticipation - #437

Merged
SvenKlaassen merged 2 commits into
DoubleML:mainfrom
AsadGudzevic94:fix-did-cs2021-float-anticipation
Nov 2, 2026
Merged

SvenKlaassen merged 2 commits into
DoubleML:mainfrom
AsadGudzevic94:fix-did-cs2021-float-anticipation

Conversation

@AsadGudzevic94

Copy link
Copy Markdown
Contributor

Description

The anticipation filter now keeps the never-treated units of both time types (NaT for datetime, inf for float), so the duplicated filter in the datetime and float branches is no longer needed.

New test in doubleml/did/tests/test_datasets.py: the data contain never-treated units for both time types and 0, 1 and 2 anticipation periods. It fails on main for float with anticipation.

Reference to Issues or PRs

Fixes #432

PR Checklist

  • The title of the pull request summarizes the changes made.
  • The PR contains a detailed description of all changes and additions.
  • References to related issues or PRs are added.
  • The code passes all (unit) tests.
  • Enhancements or new feature are equipped with unit tests.
  • The changes adhere to the PEP8 standards.

@SvenKlaassen
SvenKlaassen self-requested a review November 2, 2026 16:44
@SvenKlaassen
SvenKlaassen merged commit dc9c649 into DoubleML:main Nov 2, 2026
9 checks passed
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.

make_did_CS2021 drops the never-treated units with time_type="float" and anticipation_periods > 0

2 participants