Package: TrialEmulation 0.0.3.39
TrialEmulation: Causal Analysis of Observational Time-to-Event Data
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>.
Authors:
TrialEmulation_0.0.3.39.tar.gz
TrialEmulation_0.0.3.39.zip(r-4.5)TrialEmulation_0.0.3.39.zip(r-4.4)TrialEmulation_0.0.3.39.zip(r-4.3)
TrialEmulation_0.0.3.39.tgz(r-4.4-x86_64)TrialEmulation_0.0.3.39.tgz(r-4.4-arm64)TrialEmulation_0.0.3.39.tgz(r-4.3-x86_64)TrialEmulation_0.0.3.39.tgz(r-4.3-arm64)
TrialEmulation_0.0.3.39.tar.gz(r-4.5-noble)TrialEmulation_0.0.3.39.tar.gz(r-4.4-noble)
TrialEmulation_0.0.3.39.tgz(r-4.4-emscripten)TrialEmulation_0.0.3.39.tgz(r-4.3-emscripten)
TrialEmulation.pdf |TrialEmulation.html✨
TrialEmulation/json (API)
NEWS
# Install 'TrialEmulation' in R: |
install.packages('TrialEmulation', repos = c('https://remlapmot.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/causal-lda/trialemulation/issues
- data_censored - Example of longitudinal data for sequential trial emulation containing censoring
- te_data_ex - Example of a prepared data object
- te_model_ex - Example of a fitted marginal structural model object
- trial_example - Example of longitudinal data for sequential trial emulation
- vignette_switch_data - Example of expanded longitudinal data for sequential trial emulation
causal-inferencelongitudinal-datasurvival-analysis
Last updated 4 days agofrom:884edcf662. Checks:OK: 9. Indexed: no.
Target | Result | Date |
---|---|---|
Doc / Vignettes | OK | Nov 15 2024 |
R-4.5-win-x86_64 | OK | Nov 15 2024 |
R-4.5-linux-x86_64 | OK | Nov 15 2024 |
R-4.4-win-x86_64 | OK | Nov 15 2024 |
R-4.4-mac-x86_64 | OK | Nov 15 2024 |
R-4.4-mac-aarch64 | OK | Nov 15 2024 |
R-4.3-win-x86_64 | OK | Nov 15 2024 |
R-4.3-mac-x86_64 | OK | Nov 15 2024 |
R-4.3-mac-aarch64 | OK | Nov 15 2024 |
Exports:calculate_weightscase_control_sampling_trialsdata_preparationexpand_trialsfit_msmfit_outcome_modelfit_weights_modelinitiatorsipw_dataipw_data<-load_expanded_dataoutcome_dataoutcome_data<-parsnip_modelpredictread_expanded_datasample_expanded_datasave_expanded_datasave_to_csvsave_to_datatablesave_to_duckdbset_censor_weight_modelset_dataset_expansion_optionsset_outcome_modelset_switch_weight_modelshow_weight_modelsstats_glm_logittrial_msmtrial_sequenceweight_model_data_indices
Dependencies:backportsbroomcheckmateclicpp11data.tableDBIdplyrduckdbfansiformula.toolsgenericsgluelatticelifecyclelmtestmagrittrMatrixmvtnormoperator.toolsparglmpillarpkgconfigpurrrR6RcppRcppArmadillorlangsandwichstringistringrtibbletidyrtidyselectutf8vctrswithrzoo
Extending-TrialEmulation
Rendered fromExtending-TrialEmulation.Rmd
usingknitr::rmarkdown
on Nov 15 2024.Last update: 2024-08-23
Started: 2024-08-23
Getting-Started
Rendered fromGetting-Started.Rmd
usingknitr::rmarkdown
on Nov 15 2024.Last update: 2024-01-08
Started: 2021-10-06
New Interface
Rendered fromnew-interface.Rmd
usingknitr::rmarkdown
on Nov 15 2024.Last update: 2024-11-13
Started: 2024-06-04
Readme and manuals
Help Manual
Help page | Topics |
---|---|
Calculate Inverse Probability of Censoring Weights | calculate_weights calculate_weights,trial_sequence_AT-method calculate_weights,trial_sequence_ITT-method calculate_weights,trial_sequence_PP-method |
Case-control sampling of expanded data for the sequence of emulated trials | case_control_sampling_trials |
Example of longitudinal data for sequential trial emulation containing censoring | data_censored |
Prepare data for the sequence of emulated target trials | data_preparation |
Expand trials | expand_trials |
Fit the marginal structural model for the sequence of emulated trials | fit_msm fit_msm,trial_sequence-method |
Method for fitting weight models | fit_weights_model |
A wrapper function to perform data preparation and model fitting in a sequence of emulated target trials | initiators |
IPW Data Accessor and Setter | ipw_data ipw_data,trial_sequence-method ipw_data<- ipw_data<-,trial_sequence-method |
Method to read, subset and sample expanded data | load_expanded_data load_expanded_data,trial_sequence-method |
Outcome Data Accessor and Setter | outcome_data outcome_data,trial_sequence-method outcome_data<- outcome_data<-,trial_sequence-method |
Fit outcome models using 'parsnip' models | parsnip_model |
Predict marginal cumulative incidences with confidence intervals for a target trial population | predict predict,trial_sequence_ITT-method predict,trial_sequence_PP-method predict.TE_msm predict_marginal |
Print a weight summary object | print.TE_weight_summary |
Method to read expanded data | read_expanded_data read_expanded_data,te_datastore_datatable-method |
Internal method to sample expanded data | sample_expanded_data sample_expanded_data,te_datastore-method |
Method to save expanded data | save_expanded_data save_expanded_data,te_datastore_datatable-method |
Save expanded data as CSV | save_to_csv |
Save expanded data as a 'data.table' | save_to_datatable |
Save expanded data to 'DuckDB' | save_to_duckdb |
Set censoring weight model | set_censor_weight_model set_censor_weight_model,trial_sequence-method set_censor_weight_model,trial_sequence_AT-method set_censor_weight_model,trial_sequence_ITT-method set_censor_weight_model,trial_sequence_PP-method |
Set the trial data | set_data set_data,trial_sequence_AT,data.frame-method set_data,trial_sequence_ITT,data.frame-method set_data,trial_sequence_PP,data.frame-method |
Set expansion options | set_expansion_options set_expansion_options,trial_sequence_ITT-method set_expansion_options,trial_sequence_PP-method |
Specify the outcome model | set_outcome_model set_outcome_model,trial_sequence-method set_outcome_model,trial_sequence_AT-method set_outcome_model,trial_sequence_ITT-method set_outcome_model,trial_sequence_PP-method |
Set switching weight model | set_switch_weight_model set_switch_weight_model,trial_sequence-method set_switch_weight_model,trial_sequence_ITT-method |
Show Weight Model Summaries | show_weight_models |
Fit outcome models using 'stats::glm' | stats_glm_logit |
Summary methods | summary.TE_data_prep summary.TE_data_prep_dt summary.TE_data_prep_sep summary.TE_msm summary.TE_robust |
Example of a prepared data object | te_data_ex |
TrialEmulation Data Class | te_data-class |
te_datastore | te_datastore-class |
Example of a fitted marginal structural model object | te_model_ex |
Outcome Model Fitter Class | te_model_fitter-class |
TrialEmulation Outcome Data Class | te_outcome_data-class |
Fitted Outcome Model Object | te_outcome_fitted-class |
Fitted Outcome Model Object | te_outcome_model-class |
Example of longitudinal data for sequential trial emulation | trial_example |
Fit the marginal structural model for the sequence of emulated trials | trial_msm |
Create a sequence of emulated target trials object | trial_sequence |
Trial Sequence class | trial_sequence-class trial_sequence_AT-class trial_sequence_ITT-class trial_sequence_PP-class |
Example of expanded longitudinal data for sequential trial emulation | vignette_switch_data |
Data used in weight model fitting | weight_model_data_indices |