varimp.pcoxtime: Compute variable or coefficient importance score

Description Usage Arguments Details Value Examples

View source: R/posthocfuns.R

Description

Compute variable or coefficient importance score

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## 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,
  ...
)

Arguments

object

fitted pcoxtime.

newdata

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

type

if type = "coef" or type = "model" absolute value of estimated coefficients is computed. If type = "perm" variable level importance is computed using permutation.

relative

logical. If TRUE the scores are divided by the absolute sum of the coefficients.

nrep

number of replicates for permutations. Default is nrep = 50.

parallelize

whether to run in parallel. Default is FALSE.

nclusters

number of cores to use if parallelize = TRUE.

estimate

character string specify which summary statistic to use for the estimates. Default is "mean".

probs

numeric vector of probabilities with values in [0,1].

seed

a single value for for random number generation.

...

for future implementation.

Details

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.

Value

a named vector of variable scores (estimate = "mean") or a data frame (estimate = "quantile").

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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)

pcoxtime documentation built on Nov. 13, 2021, 9:07 a.m.