Skip to contents

Performs bootstrap resampling and refits the CoxKL elastic-net/LASSO CV procedure B times, then summarizes each variable's selection frequency (proportion of times the variable is selected with nonzero coefficient in the best model).

Usage

variable_importance(
  z,
  delta,
  time,
  stratum = NULL,
  RS = NULL,
  beta = NULL,
  etas,
  B = 10,
  nonzero_tol = 1e-10,
  seed = NULL,
  message = FALSE,
  ncores = 1,
  ...
)

Arguments

z

Numeric covariate matrix/data.frame (n x p). If a data.frame is provided, it will be converted to a numeric matrix via as.matrix(z).

delta

Numeric vector of event indicators.

time

Numeric vector of observed times.

stratum

Optional stratum vector. Default NULL.

RS

Optional external risk scores. Default NULL.

beta

Optional external coefficients. Default NULL.

etas

Numeric vector of candidate eta values.

B

Integer. Number of bootstrap replications.

nonzero_tol

Numeric tolerance for defining "selected". Default 1e-10.

seed

Optional integer seed for reproducibility.

message

Logical. Whether to print progress messages. Default FALSE.

ncores

Integer. Number of parallel cores. Default 1 (sequential execution).

...

Additional arguments passed to cv.coxkl_enet() (e.g., alpha, lambda, nlambda, lambda.min.ratio, nfolds, cv.criteria, c_index_stratum, etc.).

Value

An object of class "variable_importance" with fields:

freq

Named numeric vector of selection frequencies (length p).

count

Named integer vector of selection counts (length p).

B

Number of bootstrap replications.

call

Matched call.