Construct nomograms ojects for high-dimensional Cox models

as_nomogram(object, x, time, event, pred.at = NULL, fun.at = NULL,
  funlabel = NULL)

Arguments

object

Model object fitted by `hdnom::fit_*()` functions.

x

Matrix of training data used for fitting the model.

time

Survival time. Must be of the same length with the number of rows as x.

event

Status indicator, normally 0 = alive, 1 = dead. Must be of the same length with the number of rows as x.

pred.at

Time point at which to plot nomogram prediction axis.

fun.at

Function values to label on axis.

funlabel

Label for fun axis.

Note

The nomogram visualizes the model under the automatically selected "optimal" hyperparameters (e.g. lambda, alpha, gamma).

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) nom <- as_nomogram( fit, x, time, event, pred.at = 365 * 2, funlabel = "2-Year Overall Survival Probability" ) print(nom)
#> Points per unit of linear predictor: 43.07899 #> Linear predictor units per point : 0.02321317 #> #> #> AGE Points #> 15 0 #> 20 5 #> 25 9 #> 30 14 #> 35 19 #> 40 23 #> 45 28 #> 50 33 #> 55 37 #> 60 42 #> 65 47 #> 70 51 #> 75 56 #> 80 61 #> 85 65 #> #> #> AAA Points #> 0 0 #> 1 19 #> #> #> STENOSIS Points #> 0 0 #> 1 4 #> #> #> CREAT Points #> 0 0 #> 100 7 #> 200 14 #> 300 21 #> 400 29 #> 500 36 #> 600 43 #> 700 50 #> 800 57 #> 900 64 #> 1000 71 #> 1100 79 #> 1200 86 #> 1300 93 #> 1400 100 #> #> #> IMT Points #> 0.0 0 #> 0.5 9 #> 1.0 18 #> 1.5 27 #> 2.0 36 #> 2.5 45 #> 3.0 54 #> 3.5 63 #> 4.0 72 #> 4.5 81 #> 5.0 90 #> #> #> ALBUMIN Points #> 1 0 #> 2 13 #> 3 25 #> #> #> Total Points 2-Year Overall Survival Probability #> 166 0.60 #> 151 0.70 #> 131 0.80 #> 98 0.90 #> 67 0.95 #>
plot(nom)