Skip to content

Commit ab874c4

Browse files
committed
Update documentation for estimators module refactoring
- README.md: Use `from diff_diff import TwoWayFixedEffects` (preferred) - docs/api/estimators.rst: Document new module structure (twfe.py, synthetic_did.py) with backward-compatible import instructions
1 parent 482b1b2 commit ab874c4

File tree

2 files changed

+27
-9
lines changed

2 files changed

+27
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ Works with `DifferenceInDifferences` and `TwoWayFixedEffects` estimators.
539539
### Two-Way Fixed Effects (Panel Data)
540540

541541
```python
542-
from diff_diff.estimators import TwoWayFixedEffects
542+
from diff_diff import TwoWayFixedEffects
543543

544544
twfe = TwoWayFixedEffects()
545545
results = twfe.fit(

docs/api/estimators.rst

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ Estimators
33

44
Core estimator classes for Difference-in-Differences analysis.
55

6+
The main estimators module (``diff_diff.estimators``) contains the base classes
7+
``DifferenceInDifferences`` and ``MultiPeriodDiD``. Additional estimators are
8+
organized in separate modules for maintainability:
9+
10+
- ``diff_diff.twfe`` - ``TwoWayFixedEffects`` estimator
11+
- ``diff_diff.synthetic_did`` - ``SyntheticDiD`` estimator
12+
13+
All estimators are re-exported from ``diff_diff.estimators`` and ``diff_diff``
14+
for backward compatibility, so you can import any of them using:
15+
16+
.. code-block:: python
17+
18+
from diff_diff import DifferenceInDifferences, TwoWayFixedEffects, MultiPeriodDiD, SyntheticDiD
19+
620
.. module:: diff_diff.estimators
721

822
DifferenceInDifferences
@@ -24,23 +38,25 @@ Basic 2x2 DiD estimator.
2438
~DifferenceInDifferences.get_params
2539
~DifferenceInDifferences.set_params
2640

27-
TwoWayFixedEffects
28-
------------------
41+
MultiPeriodDiD
42+
--------------
2943

30-
Panel DiD with unit and time fixed effects.
44+
Event study estimator with period-specific treatment effects.
3145

32-
.. autoclass:: diff_diff.TwoWayFixedEffects
46+
.. autoclass:: diff_diff.MultiPeriodDiD
3347
:members:
3448
:undoc-members:
3549
:show-inheritance:
3650
:inherited-members:
3751

38-
MultiPeriodDiD
39-
--------------
52+
TwoWayFixedEffects
53+
------------------
4054

41-
Event study estimator with period-specific treatment effects.
55+
Panel DiD with unit and time fixed effects.
4256

43-
.. autoclass:: diff_diff.MultiPeriodDiD
57+
.. module:: diff_diff.twfe
58+
59+
.. autoclass:: diff_diff.TwoWayFixedEffects
4460
:members:
4561
:undoc-members:
4662
:show-inheritance:
@@ -51,6 +67,8 @@ SyntheticDiD
5167

5268
Synthetic control combined with DiD (Arkhangelsky et al. 2021).
5369

70+
.. module:: diff_diff.synthetic_did
71+
5472
.. autoclass:: diff_diff.SyntheticDiD
5573
:members:
5674
:undoc-members:

0 commit comments

Comments
 (0)