Parallelly Run Cox Analysis in Batch Mode
ezcox_parallel(
data,
covariates,
controls = NULL,
time = "time",
status = "status",
batch_size = 100,
global_method = c("likelihood", "wald", "logrank"),
keep_models = FALSE,
return_models = FALSE,
model_dir = file.path(tempdir(), "ezcox"),
parallel = TRUE,
verbose = FALSE
)a ezcox object
a data.frame containing variables, time and os status.
column names specifying variables.
column names specifying controls.
column name specifying time, default is 'time'.
column name specifying event status, default is 'status'.
processing size in a batch.
method used to obtain global p value for cox model, should be one of "likelihood", "wald", "logrank". The likelihood-ratio test, Wald test, and score logrank statistics. These three methods are asymptotically equivalent. For large enough N, they will give similar results. For small N, they may differ somewhat. The Likelihood ratio test has better behavior for small sample sizes, so it is generally preferred.
If TRUE, keep models as local files.
default FALSE. If TRUE, return a list contains
cox models.
a path for storing model results.
if TRUE, do parallel computation by furrr package.
if TRUE, print extra info. If parallel is TRUE,
set verbose to FALSE may speed up.
Shixiang Wang w_shixiang@163.com
library(survival)
t <- ezcox_parallel(lung, covariates = c("sex", "ph.ecog"), controls = "age")
t
Run the code above in your browser using DataLab