powered by
Cross-validates Cox or CoxLasso model
survcox_cv( df, predict.factors, fixed_time = NaN, outer_cv = 3, repeat_cv = 2, randomseed = NaN, return_models = FALSE, inner_cv = 3, useCoxLasso = FALSE, suppresswarn = TRUE, impute = 0, impute_method = "missForest" )
list of outputs
data frame with the data, "time" and "event" for survival outcome
list of predictor names
at which performance metrics are computed
k in k-fold CV, default 3
if NULL, runs once, otherwise repeats CV
random seed
TRUE/FALSE, if TRUE returns all CV objects
k in the inner loop of k-fold CV, default is 3; only used if CoxLasso is TRUE
TRUE/FALSE, FALSE by default
TRUE/FALSE, TRUE by default
0/1/2/3 for no imputation / option 1 (proper way) / option 2 (faster way) / option 3 (complete cases), more in documentation and vignette
"missForest"
# \donttest{ df <- simulate_nonlinear() coxph_cv <- survcox_cv(df, names(df)[1:4]) summary(coxph_cv) # }
Run the code above in your browser using DataLab