Skip to main content

difference-in-differences estimation and inference in Python

Project description

drawing

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
  • Parallelized estimation & multiplier bootstrap (joblib, via n_jobs)

see the Documentation for more details.

Installing

The latest release can be installed using pip

pip install differences

requires Python >= 3.10

Quick Start

ATTgt

the ATTgt class implements the estimation procedures suggested by Callaway and Sant'Anna (2021) , Sant'Anna and Zhao (2020) and the multi-valued treatment case discussed in Callaway, Goodman-Bacon & Sant'Anna (2021)

import differences

df = differences.generate_data()  # requires the [all] extra: pip install differences[all]

att_gt = differences.ATTgt(data=df, cohort_column='cohort')

att_gt.fit(formula='y', n_jobs=-1)

att_gt.aggregate('event')

differences ATTgt was inspired by

  • Callaway & Sant'Anna's did
  • Sant'Anna and Zhao's DRDID

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

differences-0.3.0.tar.gz (324.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

differences-0.3.0-py3-none-any.whl (89.4 kB view details)

Uploaded Python 3

File details

Details for the file differences-0.3.0.tar.gz.

File metadata

  • Download URL: differences-0.3.0.tar.gz
  • Upload date:
  • Size: 324.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for differences-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0f0bf18908aac127a2ba93ca552f34a7a1d7e9433ea5dde0a0552e919579e980
MD5 7e6d0a8cdcf215c0ef7b7affba071405
BLAKE2b-256 985f28ef330dbf0379e1416c685f327e96805a7f0f0069f67691d88ba5187e7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for differences-0.3.0.tar.gz:

Publisher: release.yaml on bernardodionisi/differences

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file differences-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: differences-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 89.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for differences-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06164a4ed52c55ba958ad8c9ef2081841f985ba12b9850985b08fded1ff10c82
MD5 18c204fb732c91389c3547ce13867693
BLAKE2b-256 c0711e443377b27847eccf2dc1889893054f38d4b949d7ebe62a1d0270e4e674

See more details on using hashes here.

Provenance

The following attestation bundles were made for differences-0.3.0-py3-none-any.whl:

Publisher: release.yaml on bernardodionisi/differences

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page