Skip to main content

causal-curve

build status codecov DOI

Python tools to perform causal inference when the treatment of interest is continuous.

Table of Contents

Overview

(Version 1.0.0 released in January 2021!)

There are many implemented methods to perform causal inference when your intervention of interest is binary, but few methods exist to handle continuous treatments.

This is unfortunate because there are many scenarios (in industry and research) where these methods would be useful. For example, when you would like to:

  • Estimate the causal response to increasing or decreasing the price of a product across a wide range.
  • Understand how the number of minutes per week of aerobic exercise causes positive health outcomes.
  • Estimate how decreasing order wait time will impact customer satisfaction, after controlling for confounding effects.
  • Estimate how changing neighborhood income inequality (Gini index) could be causally related to neighborhood crime rate.

This library attempts to address this gap, providing tools to estimate causal curves (AKA causal dose-response curves). Both continuous and binary outcomes can be modeled against a continuous treatment.

Installation

Available via PyPI:

pip install causal-curve

You can also get the latest version of causal-curve by cloning the repository::

git clone -b main https://github.com/ronikobrosly/causal-curve.git
cd causal-curve
pip install .

Documentation

Documentation is available at readthedocs.org

Contributing

Your help is absolutely welcome! Please do reach out or create a feature branch!

Citation

Kobrosly, R. W., (2020). causal-curve: A Python Causal Inference Package to Estimate Causal Dose-Response Curves. Journal of Open Source Software, 5(52), 2523, https://doi.org/10.21105/joss.02523

References

Galagate, D. Causal Inference with a Continuous Treatment and Outcome: Alternative Estimators for Parametric Dose-Response function with Applications. PhD thesis, 2016.

Hirano K and Imbens GW. The propensity score with continuous treatments. In: Gelman A and Meng XL (eds) Applied bayesian modeling and causal inference from incomplete-data perspectives. Oxford, UK: Wiley, 2004, pp.73–84.

Imai K, Keele L, Tingley D. A General Approach to Causal Mediation Analysis. Psychological Methods. 15(4), 2010, pp.309–334.

Kennedy EH, Ma Z, McHugh MD, Small DS. Nonparametric methods for doubly robust estimation of continuous treatment effects. Journal of the Royal Statistical Society, Series B. 79(4), 2017, pp.1229-1245.

Moodie E and Stephens DA. Estimation of dose–response functions for longitudinal data using the generalised propensity score. In: Statistical Methods in Medical Research 21(2), 2010, pp.149–166.

van der Laan MJ and Gruber S. Collaborative double robust penalized targeted maximum likelihood estimation. In: The International Journal of Biostatistics 6(1), 2010.

van der Laan MJ and Rubin D. Targeted maximum likelihood learning. In: ​U.C. Berkeley Division of Biostatistics Working Paper Series, 2006.

Release files for causal-curve 1.0.6

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

Source distribution (sdist)

Source distribution for causal-curve 1.0.6
File Size Uploaded
causal-curve-1.0.6.tar.gz 24.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for causal-curve 1.0.6
File Interpreter ABI Platform
causal_curve-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 53.5 kB

Release files / causal-curve-1.0.6.tar.gz

Download URL causal-curve-1.0.6.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
00173be616b8333d58e9725e6ec30cf534d59ac89cfa86d97228e883701de5a6
BLAKE2b-256 checksum
How to use checksums
ac53ee051ab5f63de3fda627114da8ee245f44953c3b583313ea6d54baf483fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Release files / causal_curve-1.0.6-py3-none-any.whl

Download URL causal_curve-1.0.6-py3-none-any.whl
Size 28.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6bd85d0a7c7a100e06401e1df4962c0a0b740791983b893e007a830ccff52cd
BLAKE2b-256 checksum
How to use checksums
9a22627cda55217dcfba55b121f5b15d6a8d9c86fbf56ba78e2bb1f248348eb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.2

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.5

2 release files

0.3.4

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