Skip to contents

Extract the names and type of selected variables from fitted high-dimensional Cox models.

Usage

infer_variable_type(object, x)

Arguments

object

Model object.

x

Data matrix used to fit the model.

Value

A list containing the index, name, type and range of the selected variables.

Examples

data("smart")
x <- as.matrix(smart[, -c(1, 2)])
time <- smart$TEVENT
event <- smart$EVENT
y <- survival::Surv(time, event)

fit <- fit_lasso(x, y, nfolds = 5, rule = "lambda.1se", seed = 11)
infer_variable_type(fit, x)
#> $index
#> [1]  2  6  8 22 23 24
#> 
#> $name
#> [1] "AGE"      "AAA"      "STENOSIS" "CREAT"    "IMT"      "ALBUMIN" 
#> 
#> $type
#> [1] "categorical" "logical"     "logical"     "categorical" "continuous" 
#> [6] "categorical"
#> 
#> $domain
#> $domain[[1]]
#> [1] 19 82
#> 
#> $domain[[2]]
#> [1] 0 1
#> 
#> $domain[[3]]
#> [1] 0 1
#> 
#> $domain[[4]]
#> [1]   33 1343
#> 
#> $domain[[5]]
#> [1] 0.36 4.52
#> 
#> $domain[[6]]
#> [1] 1 3
#> 
#> 
#> attr(,"class")
#> [1] "hdnom.variable.type"