Skip to main content

A python implementation of the parametric g-formula

Project description

pygformula: a python implementation of the parametric g-formula

PyPI version Documentation Status Downloads

Authors: Jing Li, Sophia Rein, Sean McGrath, Roger Logan, Ryan O’Dea, Miguel Hernán

Overview

The pygformula package implements the non-iterative conditional expectation (NICE) estimator of the g-formula algorithm (Robins, 1986). The g-formula can estimate an outcome’s counterfactual mean or risk under hypothetical treatment strategies (interventions) when there is sufficient information on time-varying treatments and confounders.

Features

  • Treatments: discrete or continuous time-varying treatments.
  • Outcomes: failure time outcomes or continuous/binary end of follow-up outcomes.
  • Interventions: interventions on a single treatment or joint interventions on multiple treatments.
  • Random measurement/visit process.
  • Incorporation of a priori knowledge of the data structure.
  • Censoring events.
  • Competing events.

Requirements

The package requires python 3.8+ and these necessary dependencies:

  • cmprsk
  • joblib
  • lifelines
  • matplotlib
  • numpy
  • pandas
  • prettytable
  • pytruncreg
  • scipy
  • seaborn
  • statsmodels
  • tqdm

Documentation

The online documentation is available at pygformula documentation.

Issues

If you have any issues, please open an issue on github, we will regularly check the questions. For any additional questions or comments, please email jing_li@hsph.harvard.edu.

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

pygformula-1.2.0.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

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

pygformula-1.2.0-py3-none-any.whl (47.0 kB view details)

Uploaded Python 3

File details

Details for the file pygformula-1.2.0.tar.gz.

File metadata

  • Download URL: pygformula-1.2.0.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pygformula-1.2.0.tar.gz
Algorithm Hash digest
SHA256 e75ca217a1341bc615ea3cc385b724ada34b8c8fb2a3cd7174ea65854b1288bd
MD5 fbf0c55755a1158f965eae4ce72abfdc
BLAKE2b-256 8bdcd920c99cff141e1c90aa0927b607a03a8481a5e0f90a808218a9885e0243

See more details on using hashes here.

File details

Details for the file pygformula-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pygformula-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pygformula-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b7ba16a640f3b890f96060e9306e1ec8565d9441a76ba7f1822b2671fb49a2b3
MD5 6c33ab7d1f6ded372b5b0a8397f0883d
BLAKE2b-256 2c4000d91f47cab46783c70717d0bfa65205dc69a4d8983c2e0a3935e9cc8e0b

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