Skip to content

Commit c58ee71

Browse files
authored
Merge pull request #198 from igerber/docs/estimator-alias-discoverability
Document estimator aliases for user discoverability
2 parents 34f6c22 + 69574a6 commit c58ee71

4 files changed

Lines changed: 41 additions & 14 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2121
## [2.6.1] - 2026-03-08
2222

2323
### Added
24-
- Short aliases for all estimators (e.g., `DID`, `TWFE`, `MPID`, `CSAN`, `SDID`)
24+
- Short aliases for all estimators (e.g., `DiD`, `TWFE`, `EventStudy`, `CS`, `SDiD`)
2525

2626
### Changed
2727
- Update roadmap for v2.6.0: reflect completed work and refresh priorities

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pip install -e .
2020

2121
```python
2222
import pandas as pd
23-
from diff_diff import DifferenceInDifferences
23+
from diff_diff import DifferenceInDifferences # or: DiD
2424

2525
# Create sample data
2626
data = pd.DataFrame({
@@ -84,6 +84,28 @@ Signif. codes: '***' 0.001, '**' 0.01, '*' 0.05, '.' 0.1
8484
- **Data prep utilities**: Helper functions for common data preparation tasks
8585
- **Validated against R**: Benchmarked against `did`, `synthdid`, and `fixest` packages (see [benchmarks](docs/benchmarks.rst))
8686

87+
## Estimator Aliases
88+
89+
All estimators have short aliases for convenience:
90+
91+
| Alias | Full Name | Method |
92+
|-------|-----------|--------|
93+
| `DiD` | `DifferenceInDifferences` | Basic 2x2 DiD |
94+
| `TWFE` | `TwoWayFixedEffects` | Two-way fixed effects |
95+
| `EventStudy` | `MultiPeriodDiD` | Event study / multi-period |
96+
| `CS` | `CallawaySantAnna` | Callaway & Sant'Anna (2021) |
97+
| `SA` | `SunAbraham` | Sun & Abraham (2021) |
98+
| `BJS` | `ImputationDiD` | Borusyak, Jaravel & Spiess (2024) |
99+
| `Gardner` | `TwoStageDiD` | Gardner (2022) two-stage |
100+
| `SDiD` | `SyntheticDiD` | Synthetic DiD |
101+
| `DDD` | `TripleDifference` | Triple difference |
102+
| `CDiD` | `ContinuousDiD` | Continuous treatment DiD |
103+
| `Stacked` | `StackedDiD` | Stacked DiD |
104+
| `Bacon` | `BaconDecomposition` | Goodman-Bacon decomposition |
105+
| `EDiD` | `EfficientDiD` | Efficient DiD |
106+
107+
`TROP` already uses its short canonical name and needs no alias.
108+
87109
## Tutorials
88110

89111
We provide Jupyter notebook tutorials in `docs/tutorials/`:

docs/api/estimators.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Most estimators have short aliases (``TROP`` already uses its short canonical na
2525
2626
.. module:: diff_diff.estimators
2727

28-
DifferenceInDifferences
29-
-----------------------
28+
DifferenceInDifferences (alias: ``DiD``)
29+
----------------------------------------
3030

3131
Basic 2x2 DiD estimator.
3232

@@ -44,8 +44,8 @@ Basic 2x2 DiD estimator.
4444
~DifferenceInDifferences.get_params
4545
~DifferenceInDifferences.set_params
4646

47-
MultiPeriodDiD
48-
--------------
47+
MultiPeriodDiD (alias: ``EventStudy``)
48+
--------------------------------------
4949

5050
Event study estimator with period-specific treatment effects.
5151

@@ -55,8 +55,8 @@ Event study estimator with period-specific treatment effects.
5555
:show-inheritance:
5656
:inherited-members:
5757

58-
TwoWayFixedEffects
59-
------------------
58+
TwoWayFixedEffects (alias: ``TWFE``)
59+
-------------------------------------
6060

6161
Panel DiD with unit and time fixed effects.
6262

@@ -68,8 +68,8 @@ Panel DiD with unit and time fixed effects.
6868
:show-inheritance:
6969
:inherited-members:
7070

71-
SyntheticDiD
72-
------------
71+
SyntheticDiD (alias: ``SDiD``)
72+
------------------------------
7373

7474
Synthetic control combined with DiD (Arkhangelsky et al. 2021).
7575

@@ -81,8 +81,8 @@ Synthetic control combined with DiD (Arkhangelsky et al. 2021).
8181
:show-inheritance:
8282
:inherited-members:
8383

84-
TripleDifference
85-
----------------
84+
TripleDifference (alias: ``DDD``)
85+
----------------------------------
8686

8787
Triple Difference (DDD) estimator for settings where treatment requires two criteria
8888
(Ortiz-Villavicencio & Sant'Anna, 2025).

docs/quickstart.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ The simplest DiD design has two groups (treated/control) and two periods (pre/po
2222
import pandas as pd
2323
from diff_diff import DifferenceInDifferences, generate_did_data
2424
25-
# Tip: most estimators have short aliases, e.g. DiD, TWFE, CS, DDD
26-
# from diff_diff import DiD
25+
.. tip::
26+
27+
Most estimators have short aliases for convenience — e.g.
28+
``from diff_diff import DiD, TWFE, CS, DDD``.
29+
See the :doc:`API reference <api/estimators>` for the full list.
30+
31+
.. code-block:: python
2732
2833
# Generate synthetic data with a known treatment effect
2934
data = generate_did_data(

0 commit comments

Comments
 (0)