varimp.pcoxtime | R Documentation |
Compute variable or coefficient importance score
## S3 method for class 'pcoxtime' varimp( object, newdata, type = c("coef", "perm", "model"), relative = TRUE, nrep = 50, parallelize = FALSE, nclusters = 1, estimate = c("mean", "quantile"), probs = c(0.025, 0.5, 0.975), seed = NULL, ... )
object |
fitted |
newdata |
data frame containing the variables appearing on the right hand side of |
type |
if |
relative |
logical. If |
nrep |
number of replicates for permutations. Default is |
parallelize |
whether to run in parallel. Default is |
nclusters |
number of cores to use if |
estimate |
character string specify which summary statistic to use for the estimates. Default is |
probs |
numeric vector of probabilities with values in |
seed |
a single value for for random number generation. |
... |
for future implementation. |
Absolute value of the coefficients (parameters) corresponding the pcoxtime
object (type = "coef"
). Otherwise, variable level importance is computed using permutation (type = "perm"
).
In the case of permutation: 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.
a named vector of variable scores (estimate = "mean"
) or a data frame (estimate = "quantile"
).
if (packageVersion("survival")>="3.2.9") { data(cancer, package="survival") } else { data(veteran, package="survival") } # Penalized lam <- 0.1 alp <- 0.5 pfit1 <- pcoxtime(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior , data = veteran , lambda = lam , alpha = alp ) imp1 <- varimp(pfit1, veteran) plot(imp1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.