survcox_cv {survcompare}R Documentation

Cross-validates Cox or CoxLasso model

Description

Cross-validates Cox or CoxLasso model

Usage

survcox_cv(
  df,
  predict.factors,
  fixed_time = NaN,
  outer_cv = 3,
  repeat_cv = 2,
  randomseed = NULL,
  return_models = FALSE,
  inner_cv = 3,
  useCoxLasso = FALSE
)

Arguments

df

data frame with the data, "time" and "event" for survival outcome

predict.factors

list of predictor names

fixed_time

at which performance metrics are computed

outer_cv

k in k-fold CV, default 3

repeat_cv

if NULL, runs once, otherwise repeats CV

randomseed

random seed

return_models

TRUE/FALSE, if TRUE returns all CV objects

inner_cv

k in the inner loop of k-fold CV, default is 3; only used if CoxLasso is TRUE

useCoxLasso

TRUE/FALSE, FALSE by default

Value

list of outputs

Examples


df <- simulate_nonlinear()
coxph_cv <- survcox_cv(df, names(df)[1:4])
summary(coxph_cv)


[Package survcompare version 0.1.2 Index]