analyse_sim: Analyse simulations of time-to-event data using arbitrary...

Description Usage Arguments Value Author(s) References Examples

View source: R/simulation_functions.R

Description

Function for analysing simulated time-to-event trial data produced by simulate_trials() or simulate_trials_strata().
This function automatically reads in either list or matrix simulate_trials() data formats. It performs log rank test and Cox regression analysis by default, but can also/instead perform RMST and/or landmark analyses. Covariate adjusted (/ stratified) analysis may be selected by using the "stratum" argument. If a stratum is specified, it will be included as a covariate in Cox and RMST analysis, and as a stratum in a stratified log-rank test and an inverse-precision-weighted landmark test. Strata values are handled as factors, so continuous covariates are not supported.
Analysis is typically the slowest part of simulation studies, so parallel processing using the doParallel package is built in. Parallel processing is enabled by setting the number of cores in the "parallel_cores" argument. Use of parallel processing is recommended for largescale (e.g. 100,000 iteration) simulations. To avoid unnecessary issues, ensure that the number of cores specified does not exceed number of threads provided by hardware.

Usage

1
2
3
4
5
6
7
8
analyse_sim(
  data,
  LR = TRUE,
  RMST = NA,
  landmark = NA,
  stratum = "",
  parallel_cores = 1
)

Arguments

data

Output file from simulate_trials(). Only simulate_trials() or simulate_trials_strata() output is supported, in either "list" or "matrix" format.

LR

Requests log-rank test and Cox regression. Default=TRUE

RMST

Requests Restricted Mean Survival Time analysis with specified (positive integer) restriction time, leave NULL for no analysis. Default=NULL (no RMST analysis).

landmark

Requests Landmark analysis at specified (positive integer) time, leave NULL for no analysis. Default=NULL (no landmark analysis).

stratum

Specify name of column of a stratification factor and turn on stratified (LR/LM) and covariate-adjusted (Cox/RMST) analysis. By default, "", and no stratification.

parallel_cores

Positive integer specifying number of cores to use. If 1 specified then no parallel processing. Default=1 (no parallel processing).

Value

Returns a table with one row per simulation. Table contains the following columns:

Author(s)

James Bell

References

Uno H, Claggett B, Tian L, Inoue E, Gallo P, Miyata T, Schrag D, Takeuchi M, Uyama Y, Zhao L, Skali H, Solomon S, Jacobus S, Hughes M, Packer M, Wei LJ. Moving beyond the hazard ratio in quantifying the between-group difference in survival analysis. Journal of clinical Oncology 2014,32, 2380-2385. Tian L, Zhao L, Wei LJ. Predicting the restricted mean event time with the subjects baseline covariates in survival analysis. Biostatistics 2014, 15, 222-233.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
example_sim <- simulate_trials(active_ecurve=Weibull(250,0.8),control_ecurve=Weibull(100,1),
rcurve=LinearR(12,100,100), assess=20,iterations=100,seed=12345,detailed_output=TRUE)

example_analysis1 <- analyse_sim(example_sim)
example_analysis2 <- analyse_sim(data=example_sim,RMST=15,landmark=15)

example_strat_sim <- simulate_trials_strata(stratum_probs=c(0.5,0.5),
active_ecurve=c(Weibull(250,0.8),Weibull(100,1)), control_ecurve=Weibull(100,1),
rcurve=LinearR(12,100,100),assess=20,iterations=100,seed=12345)

example_strat_analysis <- analyse_sim(data=example_strat_sim,RMST=15,landmark=15,stratum="Stratum")

gestate documentation built on Feb. 20, 2020, 5:08 p.m.