View source: R/glmnetpostsurv.R
varImp | R Documentation |
Compute variable importance of various survival models object
varImp( object, type = c("param", "variable"), scale = TRUE, newdata, nrep = 20, ... )
object |
fitted |
type |
if |
scale |
if |
newdata |
optional data frame containing the variables appearing on the right hand side of |
nrep |
number of replicates for permulations. Only if |
... |
not implemented. |
Absolute value of the coefficients (parameters) corresponding the tuned model are used type = param
. Otherwise, variable level importance is computed using permutation. See permuteImp
.
plotImp
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.