Parallelly Run Cox Analysis in Batch Mode
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.
a ezcox object
library(survival)
t <- ezcox_parallel(lung, covariates = c("sex", "ph.ecog"), controls = "age")
#> Loading required namespace: furrr
t
#> # A tibble: 4 × 12
#> Variable is_cont…¹ contr…² ref_l…³ n_con…⁴ n_ref beta HR lower…⁵ upper…⁶
#> <chr> <lgl> <chr> <chr> <int> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 sex FALSE sex sex 228 228 -0.513 0.599 0.431 0.831
#> 2 sex TRUE age age 228 228 0.017 1.02 0.999 1.04
#> 3 ph.ecog FALSE ph.ecog ph.ecog 227 227 0.443 1.56 1.24 1.96
#> 4 ph.ecog TRUE age age 228 228 0.0113 1.01 0.993 1.03
#> # … with 2 more variables: p.value <dbl>, global.pval <dbl>, and abbreviated
#> # variable names ¹is_control, ²contrast_level, ³ref_level, ⁴n_contrast,
#> # ⁵lower_95, ⁶upper_95