Skip to main content

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:

  • CompRiskReg
  • formulaic
  • 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.

Metadata

Release files for pygformula 1.2.1

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

Source distribution (sdist)

Source distribution for pygformula 1.2.1
File Size Uploaded Provenance Actions
pygformula-1.2.1.tar.gz 53.0 kB Without provenance Details for pygformula-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pygformula 1.2.1
File Interpreter ABI Platform Actions
pygformula-1.2.1-py3-none-any.whl Python 3 none any Details for pygformula-1.2.1-py3-none-any.whl

Total release size: 113.1 kB

Release files / pygformula-1.2.1.tar.gz

Download URL pygformula-1.2.1.tar.gz
Size 53.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ac186d29e33dea8821380a2ee534871683d9b39c6d3a8b1b80c2828121f75fd1
BLAKE2b-256 checksum
How to use checksums
b76fca2d88a93746d82d0242d82216f99e3429abe7c1b0eba6968313a0fd2f83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / pygformula-1.2.1-py3-none-any.whl

Download URL pygformula-1.2.1-py3-none-any.whl
Size 60.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
042b9df4db97593752f4dc2efdb09892837115c40852ee8a2c5cd2c4c04c0ddc
BLAKE2b-256 checksum
How to use checksums
68690871c49ea1ab7066ca2f8a331865c50e4148eb734f36a90e518898573c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for pygformula 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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