Skip to main content

A Python package for causal inference methods including ATE estimation, propensity score methods, and meta-learners

Project description

Tests

PyPI version

Causal Inference Python Package - Josh Lim

This package provides key causal inference methods. These methods include ATE estimation from randomized experiments, propensity score methods, and meta-learners.

Installation

Install from PyPI:

pip install pycausal-inference-joshlim

Or install in editable mode for development:

git clone https://github.com/jhl126/pycausal-inference-joshlim.git
cd pycausal-inference-joshlim
uv pip install -e .

Usage

Import functions with the following code:

from pycausal_inference_joshlim import calculate_ate_ci, calculate_ate_pvalue
from pycausal_inference_joshlim import ipw, doubly_robust
from pycausal_inference_joshlim import s_learner_discrete, t_learner_discrete, x_learner_discrete, double_ml_cate

API Documentation

RCT Module

  • calculate_ate_ci(data) - Calculates the average treatment effect (ATE) and confidence interval from randomized experiment data
  • calculate_ate_pvalue(data) - Calculates the p-value for the ATE estimate

Propensity Score Module

  • ipw(data) - Estimates the ATE using inverse probability weighting
  • doubly_robust(data) - Estimates the ATE using the doubly robust estimator

Meta-Learners Module

  • s_learner_discrete(data) - Estimates heterogeneous treatment effects using the S-Learner approach
  • t_learner_discrete(data) - Estimates heterogeneous treatment effects using the T-Learner approach
  • x_learner_discrete(data) - Estimates heterogeneous treatment effects using the X-Learner approach
  • double_ml_cate(data) - Estimates heterogeneous treatment effects using Double ML

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

pycausal_inference_joshlim-0.1.1.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycausal_inference_joshlim-0.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pycausal_inference_joshlim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bb9995464e3563a609ce18d7281de289891de3f7594bc1a69909a9eab54bc6f9
MD5 1afb51d1c2bf060529bd013af5d2d1c4
BLAKE2b-256 2d99da0ce7848a7993898afe1d1677a75891713f79c492b29cebd0056deda541

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycausal_inference_joshlim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5beed2c1ad0fdeed690d649d3c6ad5ddef4455a06c5bd066bbdd6848cfa59b2d
MD5 3d52a2b56aeedd50a67318d7ff57e47c
BLAKE2b-256 70925fa57d43a2a3157b85f87004370b50c06df601ca39d562f636f98b360c66

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