Extract information of selected variables from high-dimensional Cox models
Source:R/1_3_model_method.R
infer_variable_type.Rd
Extract the names and type of selected variables from fitted high-dimensional Cox models.
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"