From cf71da1df33f19439d7f588718fafdcb445d5c53 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 15 Jan 2026 11:45:23 +0000 Subject: [PATCH] Prepare v2.0.2 release: SE accuracy improvements Update version to 2.0.2 and document the CallawaySantAnna SE computation fix that now exactly matches R's did package. The weight influence function (wif) formula was corrected to use n_g / n_all for pg computation and iterate over keepers with individual ATT(g,t) values, reducing SE difference from ~2.5% to <0.01% vs R. --- CHANGELOG.md | 11 +++++++++++ diff_diff/__init__.py | 2 +- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 872c482..fa0672e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.2] - 2026-01-15 + +### Fixed +- **CallawaySantAnna SE computation** now exactly matches R's `did` package + - Fixed weight influence function (wif) formula for "simple" aggregation + - Corrected `pg` computation: uses `n_g / n_all` (matching R) instead of `n_g / total_treated` + - Fixed wif iteration: iterates over keepers (post-treatment pairs) with individual ATT(g,t) values + - SE difference reduced from ~2.5% to <0.01% vs R's `did` package (essentially exact match) + - Point estimates unchanged; all existing tests pass + ## [2.0.1] - 2026-01-13 ### Added @@ -358,6 +368,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `to_dict()` and `to_dataframe()` export methods - `is_significant` and `significance_stars` properties +[2.0.2]: https://github.com/igerber/diff-diff/compare/v2.0.1...v2.0.2 [2.0.1]: https://github.com/igerber/diff-diff/compare/v2.0.0...v2.0.1 [2.0.0]: https://github.com/igerber/diff-diff/compare/v1.4.0...v2.0.0 [1.4.0]: https://github.com/igerber/diff-diff/compare/v1.3.1...v1.4.0 diff --git a/diff_diff/__init__.py b/diff_diff/__init__.py index ba5ef51..920891d 100644 --- a/diff_diff/__init__.py +++ b/diff_diff/__init__.py @@ -113,7 +113,7 @@ plot_sensitivity, ) -__version__ = "2.0.1" +__version__ = "2.0.2" __all__ = [ # Estimators "DifferenceInDifferences", diff --git a/pyproject.toml b/pyproject.toml index 6ab44de..53702f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "maturin" [project] name = "diff-diff" -version = "2.0.1" +version = "2.0.2" description = "A library for Difference-in-Differences causal inference analysis" readme = "README.md" license = "MIT"