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

see the Documentation for more details.

Installing

The latest release can be installed using pip

pip install differences

requires Python >= 3.9

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)

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
  • 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.2.0.tar.gz (472.3 kB view details)

Uploaded Source

Built Distribution

differences-0.2.0-py3-none-any.whl (383.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: differences-0.2.0.tar.gz
  • Upload date:
  • Size: 472.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for differences-0.2.0.tar.gz
Algorithm Hash digest
SHA256 54390bfd3bb49a80154a47fe6932573e3ceb6924fc45f68fe5187c5cfede6cb6
MD5 43ea46b43e28fd5f9cd2faa0eb886f84
BLAKE2b-256 e2ea6edbc3ee817168ca2d7155811086c9e107eae03ec83d8f222bd52c93f278

See more details on using hashes here.

File details

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

File metadata

  • Download URL: differences-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 383.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for differences-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c83dca3359d5f599a8eac81199e987086d9466b8689bd3593f584b71c98f9e69
MD5 ce931e80c06775446588a5bbcc5e1aca
BLAKE2b-256 93c7f3e58610709703b416d2dbfe97e41e416a2141fb03a5453ee45a0723c44c

See more details on using hashes here.

Supported by

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