Sequentially Nested Target Trial Emulation
Project description
pySEQTarget - Sequentially Nested Target Trial Emulation
Implementation of sequential trial emulation for the analysis of
observational databases. The pySEQTarget software accommodates
time-varying treatments and confounders, as well as binary and failure
time outcomes. pySEQTarget allows to compare both static and dynamic
strategies, can be used to estimate observational analogs of
intention-to-treat and per-protocol effects, and can adjust for
potential selection bias.
Installation
You can install the development version of pySEQTarget from github with:
pip install git+https://github.com/CausalInference/pySEQTarget
Or from pypi iwth
pip install pySEQTarget
Setting up your Analysis
The primary API, SEQuential uses a dataclass system to handle function input. You can then recover elements as they are built by interacting with the SEQuential object you create.
From the user side, this amounts to creating a dataclass, SEQopts, and then feeding this into SEQuential. If you forgot to add something at class instantiation, you can, in some cases, add them when you call their respective class method.
from pySEQTarget import SEQuential, SEQopts
from pySEQTarget.data import load_data
data = load_data("SEQdata")
options = SEQopts(km_curves = True)
# Initiate the class
model = SEQuential(data,
id_col = "ID",
time_col = "time",
eligible_col = "eligible",
treatment_col = "tx_init",
outcome_col = "outcome",
time_varying_cols = ["N", "L", "P"],
fixed_cols = ["sex"],
method = "ITT",
parameters = options)
model.expand() # Construct the nested structure
model.bootstrap(bootstrap_nboot = 20) # Run 20 bootstrap samples
model.fit() # Fit the model
model.survival() # Create survival curves
model.plot() # Create and show a plot of the survival curves
model.collect() # Collection of important information
Assumptions
There are several key assumptions in this package -
- User provided
time_colbegins at 0 per uniqueid_col, we also assume this column contains only integers and continues by 1 for every time step, e.g. (0, 1, 2, 3, 4, ...) is allowed and (0, 1, 2, 2.5, ...) or (0, 1, 4, 5) are not- Provided
time_colentries may be out of order at intake as a sort is enforced at expansion.
- Provided
eligible_coland elements ofexcused_colnamesare once 1, only 1 (with respect totime_col) flag variables.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyseqtarget-0.13.2.tar.gz.
File metadata
- Download URL: pyseqtarget-0.13.2.tar.gz
- Upload date:
- Size: 44.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7644f9de046498285ec126b206e9f28efaf27304daf2262b07504afb115356f7
|
|
| MD5 |
759f8796c2c877c59f5df53834a73a3e
|
|
| BLAKE2b-256 |
96dcae40c92c4aa1320914f1fcd4412f0d27388f4831797fa597b84124b6b5d1
|
Provenance
The following attestation bundles were made for pyseqtarget-0.13.2.tar.gz:
Publisher:
publish.yml on CausalInference/pySEQTarget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyseqtarget-0.13.2.tar.gz -
Subject digest:
7644f9de046498285ec126b206e9f28efaf27304daf2262b07504afb115356f7 - Sigstore transparency entry: 1409364730
- Sigstore integration time:
-
Permalink:
CausalInference/pySEQTarget@f7bdc57cd656361ad175d3ef33ca7fdbcb100051 -
Branch / Tag:
refs/tags/0.13.2 - Owner: https://github.com/CausalInference
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7bdc57cd656361ad175d3ef33ca7fdbcb100051 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pyseqtarget-0.13.2-py3-none-any.whl.
File metadata
- Download URL: pyseqtarget-0.13.2-py3-none-any.whl
- Upload date:
- Size: 47.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
effeb398edbeea2ba26877afed7ff9ef85e3ad2e2d08b78e81525587bdd0ae93
|
|
| MD5 |
6bbda4e9daf984b8eb80cd3de3334cb0
|
|
| BLAKE2b-256 |
c0ce3fa8f5fd89940a85a965aa39cf84037d48a67ea044dc8f9131cf81a4a932
|
Provenance
The following attestation bundles were made for pyseqtarget-0.13.2-py3-none-any.whl:
Publisher:
publish.yml on CausalInference/pySEQTarget
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyseqtarget-0.13.2-py3-none-any.whl -
Subject digest:
effeb398edbeea2ba26877afed7ff9ef85e3ad2e2d08b78e81525587bdd0ae93 - Sigstore transparency entry: 1409364755
- Sigstore integration time:
-
Permalink:
CausalInference/pySEQTarget@f7bdc57cd656361ad175d3ef33ca7fdbcb100051 -
Branch / Tag:
refs/tags/0.13.2 - Owner: https://github.com/CausalInference
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f7bdc57cd656361ad175d3ef33ca7fdbcb100051 -
Trigger Event:
release
-
Statement type: