permuteImp: Permutation variable importance

View source: R/glmnetsurvfit.R

permuteImpR Documentation

Permutation variable importance

Description

Computes the relative importance based on random permutation of focal variable for various survival models.

Usage

permuteImp(model, newdata, nrep = 50)

Arguments

model

fitted glmnetsurv, pcoxtime, coxph, etc.

newdata

optional data frame containing the variables appearing on the right hand side of glmnetsurv formula.

nrep

number of replicates for permulations

Details

Given predictors x_1, x_2, ..., x_n used to predict the survival outcome, y. Suppose, for example, x_1 has low predictive power for the response. Then, if we randomly permute the observed values for x_1, then the prediction for y will not change much. Conversely, if any of the predictors highly predicts the response, the permutation of that specific predictor will lead to a considerable change in the predictive measure of the model. In this case, we conclude that this predictor is important. In our implementation, Harrel's concordance index is used to measure the prediction accuracy.

Value

a named vector of variable scores

Examples


data(veteran, package="survival")
# Penalized
lam <- 0.1
alp <- 0.5
pfit1 <- glmnetsurv(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior
	, data = veteran
	, lambda = lam
	, alpha = alp
)
imp <- permuteImp(pfit1, newdata = veteran, nrep = 50)
imp


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