varImp: Compute variable importance of various survival models object

View source: R/glmnetpostsurv.R

varImpR Documentation

Compute variable importance of various survival models object

Description

Compute variable importance of various survival models object

Usage

varImp(
  object,
  type = c("param", "variable"),
  scale = TRUE,
  newdata,
  nrep = 20,
  ...
)

Arguments

object

fitted glmnetsurv, pcoxtime, coxph, etc, object.

type

if type = "param" absolute value of estimated coefficients are used. If type = "variable" variable level importance is computed using permutation.

scale

if TRUE the scores are divided by the absolute sum of the coefficients.

newdata

optional data frame containing the variables appearing on the right hand side of glmnetsurv formula. Required if type = "variable"

nrep

number of replicates for permulations. Only if type = "variable".

...

not implemented.

Details

Absolute value of the coefficients (parameters) corresponding the tuned model are used type = param. Otherwise, variable level importance is computed using permutation. See permuteImp.

See Also

plotImp

Examples


data(veteran, package="survival")
# glmnet
gfit1 <- glmnetsurv(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior
	, data = veteran
	, lambda = 0.02
	, alpha = 0.8
)
imp1 <- varImp(gfit1, type = "param")
print(imp1)
imp2 <- varImp(gfit1, type = "variable", newdata = veteran)
print(imp2)


CYGUBICKO/glmnetpostsurv documentation built on Sept. 1, 2022, 7:26 p.m.