powered by
Cross-validates Cox or CoxLasso model
survcox_cv( df, predict.factors, fixed_time = NaN, outer_cv = 3, repeat_cv = 2, randomseed = NULL, return_models = FALSE, inner_cv = 3, useCoxLasso = FALSE )
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
# \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