TrialEmulation0.0.4.2 package

Causal Analysis of Observational Time-to-Event Data

calculate_predictions

Calculate and transform predictions

calculate_weights

Calculate Inverse Probability of Censoring Weights

case_control_sampling_trials

Case-control sampling of expanded data for the sequence of emulated tr...

censor_func

Censoring Function in C++

check_newdata

Check Data used for Prediction

data_manipulation

Data Manipulation Function

data_preparation

Prepare data for the sequence of emulated target trials

expand_trials

Expand trials

expand_until_switch

Check Expand Flag After Treatment Switch

expand

Expand Function

fit_msm

Fit the marginal structural model for the sequence of emulated trials

fit_outcome_model

Method for fitting outcome models

fit_weights_model

Method for fitting weight models

initiators

A wrapper function to perform data preparation and model fitting in a ...

internal-methods

Internal Methods

ipw_data

IPW Data Accessor and Setter

load_expanded_data

Method to read, subset and sample expanded data

outcome_data

Outcome Data Accessor and Setter

parsnip_model

Fit outcome models using parsnip models

predict_marginal

Predict marginal cumulative incidences with confidence intervals for a...

print_TE

Print a weight summary object

read_expanded_data

Method to read expanded data

robust_calculation

Robust Variance Calculation

sample_expanded_data

Internal method to sample expanded data

save_expanded_data

Method to save expanded data

save_to_csv

Save expanded data as CSV

save_to_datatable

Save expanded data as a data.table

save_to_duckdb

Save expanded data to DuckDB

select_data_cols

Select Data Columns

set_censor_weight_model

Set censoring weight model

set_data

Set the trial data

set_expansion_options

Set expansion options

set_outcome_model

Specify the outcome model

set_switch_weight_model

Set switching weight model

show_weight_models

Show Weight Model Summaries

stats_glm_logit

Fit outcome models using stats::glm

summary_TE

Summary methods

te_data-class

TrialEmulation Data Class

te_datastore_csv-class

te_datastore_csv, functions and methods

te_datastore_duckdb-class

te_datastore_duckdb, functions and methods

te_datastore-class

te_datastore

te_model_fitter-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

te_parsnip_model-class

Fit Models using parsnip

te_stats_glm_logit-class

Fit Models using logistic stats::glm

trial_msm

Fit the marginal structural model for the sequence of emulated trials

trial_sequence-class

Trial Sequence class

trial_sequence

Create a sequence of emulated target trials object

TrialEmulation-package

TrialEmulation Package

weight_model_data_indices

Data used in weight model fitting

Implements target trial emulation methods to apply randomized clinical trial design and analysis in an observational setting. Using marginal structural models, it can estimate intention-to-treat and per-protocol effects in emulated trials using electronic health records. A description and application of the method can be found in Danaei et al (2013) <doi:10.1177/0962280211403603>.

  • Maintainer: Isaac Gravestock
  • License: Apache License (>= 2)
  • Last published: 2025-02-21