User Functions

initiators()

A wrapper function to perform data preparation and model fitting in a sequence of emulated target trials

data_preparation()

Prepare data for the sequence of emulated target trials

trial_msm()

Fit the marginal structural model for the sequence of emulated trials

case_control_sampling_trials()

Case-control sampling of expanded data for the sequence of emulated trials

predict(<TE_msm>)

Predict marginal cumulative incidences with confidence intervals for a target trial population

print(<TE_weight_summary>)

Print a weight summary object

summary(<TE_data_prep>) summary(<TE_data_prep_sep>) summary(<TE_data_prep_dt>) summary(<TE_msm>) summary(<TE_robust>)

Summary methods

Data Sets

trial_example

Example of longitudinal data for sequential trial emulation

vignette_switch_data

Example of expanded longitudinal data for sequential trial emulation

te_data_ex

Example of a prepared data object

te_model_ex

Example of a fitted marginal structural model object

data_censored

Example of longitudinal data for sequential trial emulation containing censoring

New Interface Functions

Experimental functions for the new interface

trial_sequence()

Create a sequence of emulated target trials object

set_data()

Set the trial data

set_censor_weight_model()

Set censoring weight model

set_switch_weight_model()

Set switching weight model

calculate_weights()

Calculate Inverse Probability of Censoring Weights

show_weight_models()

Show Weight Model Summaries

set_expansion_options()

Set expansion options

set_outcome_model()

Specify the outcome model

expand_trials()

Expand trials

sample_controls()

Method to read, subset and sample expanded data

load_expanded_data()

Method to read, subset and sample expanded data

outcome_data() `outcome_data<-`()

Outcome Data Accessor and Setter

fit_msm()

Fit the marginal structural model for the sequence of emulated trials

Data Storage

Control how expanded data is stored

save_to_csv()

Save expanded data as CSV

save_to_duckdb()

Save expanded data to DuckDB

save_to_datatable()

Save expanded data as a data.table

Model fitters

stats_glm_logit()

Fit outcome models using stats::glm

Classes

trial_sequence-class trial_sequence_PP-class trial_sequence_ITT-class trial_sequence_AT-class

Trial Sequence class

te_data-class

TrialEmulation Data Class

te_datastore-class

te_datastore

save_expanded_data(<te_datastore_duckdb>) read_expanded_data(<te_datastore_duckdb>) sample_expanded_data(<te_datastore_duckdb>)

te_datastore_duckdb, functions and methods

te_model_fitter-class te_stats_glm_logit-class

Outcome Model Fitter Class

te_outcome_data-class

TrialEmulation Outcome Data Class

te_outcome_fitted-class

Fitted Outcome Model Object

te_outcome_model-class

Fitted Outcome Model Object

Internal Methods

save_expanded_data()

Method to save expanded data

read_expanded_data()

Method to read expanded data

sample_expanded_data()

Internal method to sample expanded data

fit_weights_model()

Method for fitting weight models