Metadata-Version: 2.1
Name: differences
Version: 0.2.0
Summary: difference-in-differences estimation and inference in Python
Author-email: Bernardo Dionisi <bernardo.dionisi@gmail.com>
License: GPLv3
Project-URL: Homepage, https://github.com/bernardodionisi/differences
Project-URL: Source, https://github.com/bernardodionisi/differences
Project-URL: Issues, https://github.com/bernardodionisi/differences/issues
Project-URL: Documentation, https://bernardodionisi.github.io/differences/latest/
Keywords: did,difference-in-differences,panel data,econometrics,causal inference
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: numpy>=1.19
Requires-Dist: scipy>=1.8
Requires-Dist: pandas>=1.2
Requires-Dist: linearmodels>=4.25
Requires-Dist: statsmodels<1.0,>=0.13
Requires-Dist: formulaic<0.4.0,>=0.3.4
Requires-Dist: tqdm>=4.64.1
Requires-Dist: joblib>=1.2.0
Requires-Dist: typing_extensions>=4.0.0

<img src="./doc/source/images/logo/bw/logo_name_bw.png" alt="drawing" width="200"
style="display: block;margin-left: auto;margin-right: auto;width: 80%;"/>

difference-in-differences estimation and inference for Python

**For the following use cases**

- Balanced panels, unbalanced panels & repeated cross-section
- Two + Multiple time periods
- Fixed + Staggered treatment timing
- Binary + Multi-Valued treatment
- Heterogeneous treatment effects & triple difference

see the [Documentation](https://bernardodionisi.github.io/differences/latest/) for more details.

## Installing

The latest release can be installed using pip

```bash
pip install differences
```

requires Python >= 3.9

## Quick Start

### ATTgt

the ATTgt class implements the estimation procedures suggested by [Callaway and Sant'Anna (2021)
](https://www.sciencedirect.com/science/article/abs/pii/S0304407620303948), [Sant'Anna and Zhao
(2020)](https://www.sciencedirect.com/science/article/abs/pii/S0304407620301901) and the
multi-valued treatment case discussed
in [Callaway, Goodman-Bacon & Sant'Anna (2021)](https://arxiv.org/abs/2107.02637)

```python
from differences import ATTgt, simulate_data

df = simulate_data()

att_gt = ATTgt(data=df, cohort_name='cohort')

att_gt.fit(formula='y')

att_gt.aggregate('event')
```

*differences* ATTgt benefited from
- Callaway & Sant'Anna's [did](https://github.com/bcallaway11/did)
- Sant'Anna and Zhao's [DRDID](https://github.com/pedrohcgs/DRDID)
