Skip to main content

Causal Inference in Python

Causal Inference in Python, or Causalinference in short, is a software package that implements various statistical and econometric methods used in the field variously known as Causal Inference, Program Evaluation, or Treatment Effect Analysis.

Work on Causalinference started in 2014 by Laurence Wong as a personal side project. It is distributed under the 3-Clause BSD license.

Main Features

  • Assessment of overlap in covariate distributions

  • Estimation of propensity score

  • Improvement of covariate balance through trimming

  • Subclassification on propensity score

  • Estimation of treatment effects via matching, blocking, weighting, and least squares

Dependencies

  • NumPy: 1.8.2 or higher

  • SciPy: 0.13.3 or higher

Installation

Causalinference can be installed using pip:

$ pip install causalinference

For help on setting up Pip, NumPy, and SciPy on Macs, check out this excellent guide.

Minimal Example

The following illustrates how to create an instance of CausalModel:

>>> from causalinference import CausalModel
>>> from causalinference.utils import random_data
>>> Y, D, X = random_data()
>>> causal = CausalModel(Y, D, X)

Invoking help on causal at this point should return a comprehensive listing of all the causal analysis tools available in Causalinference.

Release files for CausalInference 0.1.3.post1

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

Source distribution (sdist)

Source distribution for CausalInference 0.1.3.post1
File Size Uploaded
causalinference-0.1.3.post1.tar.gz 59.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for CausalInference 0.1.3.post1
File Interpreter ABI Platform
causalinference-0.1.3.post1-py3-none-any.whl Python 3 none any Details

Total release size: 110.9 kB

Release files / causalinference-0.1.3.post1.tar.gz

Download URL causalinference-0.1.3.post1.tar.gz
Size 59.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3db64d9a3cbd506f9f5a59d177fc56f7f0ee14f3c4a51c99dae582534eff770a
BLAKE2b-256 checksum
How to use checksums
3269274ec2a3ca42f7f02458eb515cee9d1106d4260486a77e2bc84d5cb977dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release files / causalinference-0.1.3.post1-py3-none-any.whl

Download URL causalinference-0.1.3.post1-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ae4251405d60d207051a228472be7e99490c92ebcb7d56688b3cf97ca64d4f1
BLAKE2b-256 checksum
How to use checksums
4cc7ba8e20fa60f7f87caff898b934978fd8031e6e29f851b392a3cc7c43810c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.5

Release history Release notifications | RSS feed

This release

0.1.3.post1 This release

2 release files

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

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