Skip to main content

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.

Release files for causalipy 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for causalipy 0.1.1
File Size Uploaded
causalipy-0.1.1.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for causalipy 0.1.1
File Interpreter ABI Platform
causalipy-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.8 kB

Release files / causalipy-0.1.1.tar.gz

Download URL causalipy-0.1.1.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b043817af30aa1a952891c64e7b9e683c3508c633e95857fa26d957dcc23e31d
BLAKE2b-256 checksum
How to use checksums
a19dd62be8aafbbbf032ee63e8e2d5851dc53a6380a0629696da17b823405de0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.6 Darwin/21.1.0

Release files / causalipy-0.1.1-py3-none-any.whl

Download URL causalipy-0.1.1-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8cc8bbe196ce0108dcbf082c4713fd7979daa80561626be15d17f4a9cbee2204
BLAKE2b-256 checksum
How to use checksums
58162fd2a2ac14b7db4a133e0c4912a07f72c6fafd676fec461d37c9783e518f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.11 CPython/3.9.6 Darwin/21.1.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page