Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- **`LWDiD` (Lee & Wooldridge 2025, 2026 rolling-transformation DiD).** Unit-specific
demean/detrend converts panel to cross-section; supports staggered adoption with
never-treated / not-yet-treated control groups, RA/IPW/IPWRA estimation, and
cluster-robust inference. Alias `LW`.
- **`RegressionDiscontinuity` - sharp AND fuzzy regression discontinuity estimation
with robust bias-corrected inference (alias `RDD`).** Local-polynomial RD per
Calonico, Cattaneo & Titiunik (2014), parity-targeting R `rdrobust` 4.0.0
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Full guide: `diff_diff.get_llm_guide("practitioner")`.
- [WooldridgeDiD](https://diff-diff.readthedocs.io/en/stable/api/wooldridge_etwfe.html) - Wooldridge (2023, 2025) ETWFE: saturated OLS, logit/Poisson QMLE (ASF-based ATT). Alias `ETWFE`.
- [LPDiD](https://diff-diff.readthedocs.io/en/stable/api/lpdid.html) - Dube, Girardi, Jorda & Taylor (2025) Local Projections DiD: per-horizon long-difference event study on clean controls (no negative weighting), variance- or equally-weighted ATT, for absorbing or non-absorbing (reversible) treatment
- [ChangesInChanges](https://diff-diff.readthedocs.io/en/stable/api/changes_in_changes.html) - Athey & Imbens (2006) nonlinear/distributional DiD for the 2x2 design: full counterfactual distribution and quantile treatment effects via CDF transformation, plus the QDiD comparison estimator; bootstrap inference; R qte parity. Alias `CiC`
- [LWDiD](https://diff-diff.readthedocs.io/en/stable/api/lwdid.html) - Lee & Wooldridge (2025, 2026) rolling-transformation DiD: unit-specific demean/detrend converts panel to cross-section, staggered adoption, RA/IPW/IPWRA estimation. Alias `LW`.
- [BaconDecomposition](https://diff-diff.readthedocs.io/en/stable/api/bacon.html) - Goodman-Bacon (2021) decomposition for diagnosing TWFE bias in staggered settings

## Diagnostics & Sensitivity
Expand Down
88 changes: 88 additions & 0 deletions diff_diff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,53 @@
)
from diff_diff.lpdid import LPDiD
from diff_diff.lpdid_results import LPDiDResults
from diff_diff.lwdid import LWDiD, is_never_treated, lwdid, validate_staggered_data
from diff_diff.lwdid_clustering import (
ClusteringDiagnostics,
ClusteringRecommendation,
diagnose_clustering,
diagnose_clustering_from_data,
recommend_clustering_level,
)
from diff_diff.lwdid_exceptions import (
BootstrapConvergenceError,
DiagnosticError,
DiagnosticWarning,
InsufficientPrePeriodsError,
LWDIDError,
LWDIDInferenceError,
LWDIDWarning,
NumericalWarning,
RandomizationError,
RandomizationWarning,
SensitivityWarning,
VisualizationError,
VisualizationWarning,
)
from diff_diff.lwdid_randomization import RandomizationResult, randomization_inference
from diff_diff.lwdid_results import LWDiDResults
from diff_diff.lwdid_sensitivity import (
SensitivityResult,
robustness_pre_periods,
sensitivity_analysis,
sensitivity_no_anticipation,
)
from diff_diff.lwdid_trend_diagnostics import (
ParallelTrendsTestResult,
diagnose_heterogeneous_trends,
recommend_transformation,
test_parallel_trends,
)
from diff_diff.lwdid_visualization import (
plot_bootstrap_distribution,
plot_cohort_trends,
)
from diff_diff.lwdid_visualization import plot_event_study as plot_lwdid_event_study
from diff_diff.lwdid_visualization import plot_sensitivity as plot_lwdid_sensitivity
from diff_diff.lwdid_wild_bootstrap import (
WildClusterBootstrapResult,
wild_cluster_bootstrap,
)
from diff_diff.power import (
PowerAnalysis,
PowerResults,
Expand Down Expand Up @@ -315,6 +362,7 @@
HAD = HeterogeneousAdoptionDiD
CiC = ChangesInChanges
RDD = RegressionDiscontinuity
LW = LWDiD

__version__ = "3.7.0"
__all__ = [
Expand Down Expand Up @@ -406,6 +454,46 @@
# LPDiD (Local Projections DiD)
"LPDiD",
"LPDiDResults",
# LWDiD (Lee & Wooldridge rolling transformation DiD)
"LWDiD",
"LWDiDResults",
"LW",
"wild_cluster_bootstrap",
"WildClusterBootstrapResult",
"randomization_inference",
"RandomizationResult",
"test_parallel_trends",
"diagnose_heterogeneous_trends",
"recommend_transformation",
"ParallelTrendsTestResult",
"sensitivity_analysis",
"robustness_pre_periods",
"sensitivity_no_anticipation",
"SensitivityResult",
"lwdid",
"plot_cohort_trends",
"plot_lwdid_event_study",
"plot_lwdid_sensitivity",
"plot_bootstrap_distribution",
# LWDiD exceptions
"LWDIDError",
"LWDIDWarning",
"LWDIDInferenceError",
"RandomizationError",
"DiagnosticError",
"NumericalWarning",
"DiagnosticWarning",
"SensitivityWarning",
"VisualizationError",
# LWDiD clustering diagnostics
"diagnose_clustering",
"diagnose_clustering_from_data",
"recommend_clustering_level",
"ClusteringDiagnostics",
"ClusteringRecommendation",
# LWDiD utility functions
"validate_staggered_data",
"is_never_treated",
# Visualization
"plot_bacon",
"plot_event_study",
Expand Down
1 change: 1 addition & 0 deletions diff_diff/guides/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Full practitioner guide: call `diff_diff.get_llm_guide("practitioner")`
- [LPDiD](https://diff-diff.readthedocs.io/en/stable/api/lpdid.html): Dube, Girardi, Jorda & Taylor (2025) Local Projections DiD: per-horizon long-difference event study on clean controls (no negative weighting); variance- or equally-weighted ATT, premean differencing, pooled pre/post, fast. Absorbing by default; non-absorbing (reversible) treatment via `non_absorbing="first_entry"` (Eq. 12) or `"effect_stabilization"` (Eq. 13, window `L`). Complex-survey designs (pweight + stratified-PSU TSL SEs) on the default path via `fit(survey_design=...)`.
- [ChangesInChanges](https://diff-diff.readthedocs.io/en/stable/api/changes_in_changes.html): Athey & Imbens (2006) nonlinear/distributional DiD for the 2x2 design: recovers the treated group's full counterfactual outcome distribution and quantile treatment effects (ATT + QTE grid) via the CDF transformation `F_10(F_00^{-1}(F_01(y)))`; invariant to monotone outcome transformations (unconditional fits; the covariate QR branch is not); bootstrap inference (panel or repeated cross-section resampling); point parity with R `qte::CiC()`, including its covariate branch (`covariates=` -> per-cell linear quantile regression, Melly-Santangelo-style conditional CiC). Continuous outcomes, numeric covariates. Alias `CiC`.
- [QDiD](https://diff-diff.readthedocs.io/en/stable/api/changes_in_changes.html): Athey & Imbens (2006) quantile DiD comparison estimator (additive quantile-by-quantile DiD, matching R `qte::QDiD()` including its covariate branch via `covariates=`); same bootstrap machinery as ChangesInChanges. The paper recommends CiC over QDiD (scale-dependent model with testable restrictions; a non-monotonicity warning fires when violated - unconditional fits only, the covariate-path counterfactual quantile curve is monotone by construction).
- [LWDiD](https://diff-diff.readthedocs.io/en/stable/api/lwdid.html): Lee & Wooldridge (2025, 2026) rolling-transformation DiD — unit-specific demean/detrend converts panel to cross-section, supports staggered adoption with flexible control groups and estimation (RA/IPW/IPWRA). Alias: LW
- [BaconDecomposition](https://diff-diff.readthedocs.io/en/stable/api/bacon.html): Goodman-Bacon (2021) decomposition for diagnosing TWFE bias in staggered settings

## Diagnostics and Sensitivity Analysis
Expand Down
Loading
Loading