SEQopts

class pySEQTarget.SEQopts

Parameter builder for pySEQTarget.SEQuential analysis

Parameters:
  • bootstrap_nboot (int) – Number of bootstraps to perform

  • bootstrap_sample (float) – Subsampling proportion of ID-Trials gathered for each bootstrapping iteration

  • bootstrap_CI (float) – If bootstrapped, confidence interval level

  • bootstrap_CI_method (Literal['se', 'percentile']) – If bootstrapped, confidence interval method [‘SE’ or ‘percentile’]

  • cense_colname (Optional[str]) – Column name for censoring effect (LTFU, etc.)

  • cense_denominator (Optional[str]) – Override to specify denominator patsy formula for censoring models; “1” or “” indicate intercept only model

  • cense_numerator (Optional[str]) – Override to specify numerator patsy formula for censoring models

  • cense_eligible_colname (Optional[str]) – Column name to identify which rows are eligible for censoring model fitting

  • compevent_colname (Optional[str]) – Column name specifying a competing event to the outcome

  • covariates (Optional[str]) – Override to specify the outcome patsy formula for outcome model fitting

  • denominator (Optional[str]) – Override to specify the outcome patsy formula for denominator model fitting

  • excused (bool) – Boolean to allow excused conditions when method is censoring

  • excused_colnames (List[str]) – Column names (at the same length of treatment_level) specifying excused conditions, default []

  • expand_only (bool) – If True, SEQuential.expand() returns the expanded dataset and skips weighting, modelling, and survival steps

  • glm_package (Literal['statsmodels', 'glum', 'jax']) – Backend for fitting logistic (outcome/competing-event) models [“statsmodels”, “glum”, or “jax”], default “statsmodels”.

  • followup_class (bool) – Boolean to force followup values to be treated as classes

  • followup_include (bool) – Boolean to force regular followup values into model covariates

  • followup_spline (bool) – Boolean to force followup values to be fit to cubic spline

  • followup_spline_df (int) – Degrees of freedom for the followup cubic spline, default 4

  • followup_max (int) – Maximum allowed followup in analysis

  • followup_min (int) – Minimum allowed followup in analysis

  • hazard_estimate (bool) – Boolean to create hazard estimates

  • indicator_baseline (str) – How to indicate baseline columns in models

  • indicator_squared (str) – How to indicate squared columns in models

  • km_curves (bool) – Boolean to create survival, risk, and incidence (if applicable) estimates

  • ncores (Optional[int]) – Number of cores to use if running in parallel, default max(1, cpu_count() - 1)

  • numerator (Optional[str]) – Override to specify the outcome patsy formula for numerator models; “1” or “” indicate intercept only model

  • offload (bool) – Boolean to offload intermediate model data to disk

  • offload_dir (str) – Directory to offload intermediate model data

  • parallel (bool) – Boolean to run model fitting in parallel

  • plot_colors (List[str]) – List of colors for KM plots, if applicable, default ["#F8766D", "#00BFC4", "#555555"]

  • plot_labels (List[str]) – List of length treat_level to specify treatment labeling, default []

  • plot_title (str) – Plot title

  • plot_type (Literal['risk', 'survival', 'incidence']) – Type of plot to show [“risk”, “survival” or “incidence” if compevent is specified]

  • risk_times (Optional[List[float]]) – Followup times at which to report risk difference and risk ratio when km_curves = True. Each requested time is snapped to the latest available followup at or before it, and the maximum followup is always included. Defaults to None (report at the maximum followup only).

  • seed (Optional[int]) – RNG seed

  • selection_first_trial (bool) – Boolean to only use first trial for analysis (similar to non-expanded)

  • selection_sample (float) – Subsampling proportion of ID-trials which did not initiate a treatment

  • selection_random (bool) – Boolean to randomly downsample ID-trials which did not initiate a treatment

  • subgroup_colname (str) – Column name for subgroups to share the same weighting but different outcome model fits

  • treatment_level (List[int]) – List of eligible treatment levels within treatment_col, default [0, 1]

  • trial_include (bool) – Boolean to force trial values into model covariates

  • visit_colname (str) – Column name specifying visit number

  • weight_eligible_colnames (List[str]) – List of column names of length treatment_level to identify which rows are eligible for weight fitting, default []

  • weight_fit_method (Literal['newton', 'bfgs', 'lbfgs', 'nm']) – The fitting method to be used [“newton”, “bfgs”, “lbfgs”, “nm”], default “newton”

  • weight_min (float) – Minimum weight

  • weight_max (float) – Maximum weight

  • weight_lag_condition (bool) – Boolean to fit weights based on their treatment lag

  • weight_p99 (bool) – Boolean to force weight min and max to be 1st and 99th percentile respectively

  • weight_preexpansion (bool) – Boolean to fit weights on preexpanded data

  • verbose (bool) – Boolean to print dataset size summaries and bootstrap information

  • weighted (bool) – Boolean to weight analysis

__init__(bootstrap_nboot=0, bootstrap_sample=0.8, bootstrap_CI=0.95, bootstrap_CI_method='se', cense_colname=None, cense_denominator=None, cense_numerator=None, cense_eligible_colname=None, compevent_colname=None, covariates=None, cox_package='lifelines', denominator=None, excused=False, excused_colnames=<factory>, expand_only=False, glm_package='statsmodels', followup_class=False, followup_include=True, followup_max=None, followup_min=0, followup_spline=False, followup_spline_df=4, hazard_estimate=False, indicator_baseline='_bas', indicator_squared='_sq', km_curves=False, ncores=None, numerator=None, offload=False, offload_dir='_seq_models', parallel=False, plot_colors=<factory>, plot_labels=<factory>, plot_title=None, plot_type='survival', risk_times=None, seed=None, selection_first_trial=False, selection_sample=0.8, selection_random=False, subgroup_colname=None, treatment_level=<factory>, trial_include=True, visit_colname=None, weight_eligible_colnames=<factory>, weight_fit_method='newton', weight_min=0.0, weight_max=None, weight_lag_condition=True, weight_p99=False, weight_preexpansion=True, verbose=False, weighted=False)