Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Causal inference methods implemented in Python.

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages