Skip to main content

Causal Methods Implemented in Python

Project description

CausaliPy

Causal Methods implemented in Python.

Installation

Install via

pip install causalipy

It might make sense to add the py-arrow dependency (which is currently required for the example):

pip install pyarrow

Example

To run a version of the multi-period difference-in-difference estimator as proposed by Callaway and Sant’Anna (2020) (this requires additionally pyarrow - e.g. via pip install pyarrow - to be installed currently):

from causalipy.did.multi_periods import MultiPeriodDid
import pandas as pd

url = "https://github.com/mohelm/causalipy-datasets/raw/main/mpdta-sample.feather"
data = pd.read_feather(url)

mpd_minimum_wage = MultiPeriodDid(
    data,
    outcome="lemp",
    treatment_indicator="treat",
    time_period_indicator="year",
    group_indiciator="first.treat",
    formula="~ 1",
)
mpd_minimum_wage.plot_treatment_effects()

This will give:

alt text

License

This project is licensed under the terms of the MIT license.

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

causalipy-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

causalipy-0.1.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: causalipy-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.6 Darwin/21.1.0

File hashes

Hashes for causalipy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b043817af30aa1a952891c64e7b9e683c3508c633e95857fa26d957dcc23e31d
MD5 33124a17cb89beb6117965a95cbb81fa
BLAKE2b-256 a19dd62be8aafbbbf032ee63e8e2d5851dc53a6380a0629696da17b823405de0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: causalipy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.6 Darwin/21.1.0

File hashes

Hashes for causalipy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8cc8bbe196ce0108dcbf082c4713fd7979daa80561626be15d17f4a9cbee2204
MD5 44064d33f0519c30f7c88b4825cb2d90
BLAKE2b-256 58162fd2a2ac14b7db4a133e0c4912a07f72c6fafd676fec461d37c9783e518f

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