SEQuential¶
- class pySEQTarget.SEQuential¶
Primary class initializer for SEQuentially nested target trial emulation
- Parameters:
data (
DataFrame) – Data for analysisid_col (
str) – Column name for unique patient IDstime_col (
str) – Column name for observational time pointseligible_col (
str) – Column name for analytical eligibilitytreatment_col (
str) – Column name specifying treatment per time_coloutcome_col (
str) – Column name specifying outcome per time_coltime_varying_cols (
Optional[List[str]]) – Time-varying column names as covariates (BMI, Age, etc.)fixed_cols (
Optional[List[str]]) – Fixed column names as covariates (Sex, YOB, etc.)method (
Literal['ITT','dose-response','censoring']) – Method for analysis [‘ITT’, ‘dose-response’, or ‘censoring’]parameters (
Optional[SEQopts]) – Parameters to augment analysis, specified withpySEQTarget.SEQopts
- __init__(data, id_col, time_col, eligible_col, treatment_col, outcome_col, time_varying_cols=None, fixed_cols=None, method='ITT', parameters=None)¶
- bootstrap(**kwargs)¶
Internally sets up bootstrapping - creating a list of IDs to use per iteration
- Return type:
- expand()¶
Creates the sequentially nested, emulated target trial structure. If
expand_onlyis set in parameters, returns the expanded dataset as apolars.DataFrameand skips all subsequent analysis steps.
- fit()¶
Fits weight models (numerator, denominator, censoring) and outcome models (outcome, competing event)
- Return type:
- hazard()¶
Uses fit outcome models (outcome, competing event) to estimate hazard ratios
- Return type: