From ca4eb427fb0015e9eb9bc8e527391df050c75da9 Mon Sep 17 00:00:00 2001 From: igerber Date: Sun, 15 Mar 2026 10:05:40 -0400 Subject: [PATCH 1/2] Document estimator aliases for user discoverability Add alias reference table to README, show alias comment in Quick Start import, upgrade quickstart.rst tip to RST admonition, add alias labels to API doc estimator headings, and fix wrong alias names in CHANGELOG. Co-Authored-By: Claude Opus 4.6 (1M context) --- CHANGELOG.md | 2 +- README.md | 24 +++++++++++++++++++++++- docs/api/estimators.rst | 20 ++++++++++---------- docs/quickstart.rst | 9 +++++++-- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4a7dc06..21f97c7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.6.1] - 2026-03-08 ### Added -- Short aliases for all estimators (e.g., `DID`, `TWFE`, `MPID`, `CSAN`, `SDID`) +- Short aliases for all estimators (e.g., `DiD`, `TWFE`, `EventStudy`, `CS`, `SDiD`) ### Changed - Update roadmap for v2.6.0: reflect completed work and refresh priorities diff --git a/README.md b/README.md index 8ea55cd5..fccc4dc3 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pip install -e . ```python import pandas as pd -from diff_diff import DifferenceInDifferences +from diff_diff import DifferenceInDifferences # or: DiD # Create sample data data = pd.DataFrame({ @@ -84,6 +84,28 @@ Signif. codes: '***' 0.001, '**' 0.01, '*' 0.05, '.' 0.1 - **Data prep utilities**: Helper functions for common data preparation tasks - **Validated against R**: Benchmarked against `did`, `synthdid`, and `fixest` packages (see [benchmarks](docs/benchmarks.rst)) +## Estimator Aliases + +All estimators have short aliases for convenience: + +| Alias | Full Name | Method | +|-------|-----------|--------| +| `DiD` | `DifferenceInDifferences` | Basic 2x2 DiD | +| `TWFE` | `TwoWayFixedEffects` | Two-way fixed effects | +| `EventStudy` | `MultiPeriodDiD` | Event study / multi-period | +| `CS` | `CallawaySantAnna` | Callaway & Sant'Anna (2021) | +| `SA` | `SunAbraham` | Sun & Abraham (2021) | +| `BJS` | `ImputationDiD` | Borusyak, Jaravel & Spiess (2024) | +| `Gardner` | `TwoStageDiD` | Gardner (2022) two-stage | +| `SDiD` | `SyntheticDiD` | Synthetic DiD | +| `DDD` | `TripleDifference` | Triple difference | +| `CDiD` | `ContinuousDiD` | Continuous treatment DiD | +| `Stacked` | `StackedDiD` | Stacked DiD | +| `Bacon` | `BaconDecomposition` | Goodman-Bacon decomposition | +| `EDiD` | `EfficientDiD` | Efficient DiD | + +`TROP` already uses its short canonical name and needs no alias. + ## Tutorials We provide Jupyter notebook tutorials in `docs/tutorials/`: diff --git a/docs/api/estimators.rst b/docs/api/estimators.rst index 92585015..e1480f96 100644 --- a/docs/api/estimators.rst +++ b/docs/api/estimators.rst @@ -25,8 +25,8 @@ Most estimators have short aliases (``TROP`` already uses its short canonical na .. module:: diff_diff.estimators -DifferenceInDifferences ------------------------ +DifferenceInDifferences (alias: ``DiD``) +---------------------------------------- Basic 2x2 DiD estimator. @@ -44,8 +44,8 @@ Basic 2x2 DiD estimator. ~DifferenceInDifferences.get_params ~DifferenceInDifferences.set_params -MultiPeriodDiD --------------- +MultiPeriodDiD (alias: ``EventStudy``) +-------------------------------------- Event study estimator with period-specific treatment effects. @@ -55,8 +55,8 @@ Event study estimator with period-specific treatment effects. :show-inheritance: :inherited-members: -TwoWayFixedEffects ------------------- +TwoWayFixedEffects (alias: ``TWFE``) +------------------------------------- Panel DiD with unit and time fixed effects. @@ -68,8 +68,8 @@ Panel DiD with unit and time fixed effects. :show-inheritance: :inherited-members: -SyntheticDiD ------------- +SyntheticDiD (alias: ``SDiD``) +------------------------------ Synthetic control combined with DiD (Arkhangelsky et al. 2021). @@ -81,8 +81,8 @@ Synthetic control combined with DiD (Arkhangelsky et al. 2021). :show-inheritance: :inherited-members: -TripleDifference ----------------- +TripleDifference (alias: ``DDD``) +---------------------------------- Triple Difference (DDD) estimator for settings where treatment requires two criteria (Ortiz-Villavicencio & Sant'Anna, 2025). diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 2ba32cec..3faef705 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -22,8 +22,13 @@ The simplest DiD design has two groups (treated/control) and two periods (pre/po import pandas as pd from diff_diff import DifferenceInDifferences, generate_did_data - # Tip: most estimators have short aliases, e.g. DiD, TWFE, CS, DDD - # from diff_diff import DiD +.. tip:: + + Most estimators have short aliases for convenience — e.g. + ``from diff_diff import DiD, TWFE, CS, DDD``. + See the :doc:`API reference ` for the full list. + +.. code-block:: python # Generate synthetic data with a known treatment effect data = generate_did_data( From 69574a644df8609fb9d1caf67979449b7b7dcb82 Mon Sep 17 00:00:00 2001 From: igerber Date: Sun, 15 Mar 2026 10:26:18 -0400 Subject: [PATCH 2/2] Trigger PR ref creation