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
  • One + Multiple treatments per entity

see the Documentation for more details.

Installing

The latest release can be installed using pip

pip install differences

requires Python 3.8+

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 treatement 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 benefitted substantially from the original authors' R packages: Callaway & Sant'Anna's did and Sant'Anna and Zhao's DRDID

TWFE

from differences import TWFE, simulate_data

df = simulate_data()

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

att_gt.fit(formula='y')

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.1.1.tar.gz (403.4 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.1.1-py3-none-any.whl (414.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: differences-0.1.1.tar.gz
  • Upload date:
  • Size: 403.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.16 Darwin/21.5.0

File hashes

Hashes for differences-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0af92b52561944d08dbba5df94d1bc86a578ef5b1f8fabc769feff06aa601ea7
MD5 36efae32a733e48755e33183aa24f608
BLAKE2b-256 08dfdd4838fa89670b8feb1839e89fa45b7dc8cee44a197d2636440eed6e58bc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: differences-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 414.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.16 Darwin/21.5.0

File hashes

Hashes for differences-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b04770716d6918c0b0cc067a32be0129f3e8713cb13320acf65a97ef374e2d8
MD5 3a98f480202c54cb0a0596b1bc3ebc79
BLAKE2b-256 f617ebbf16354d4fc3c491480e9a60952c3a75e729e62ef15de76023ed1eef25

See more details on using hashes here.

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