Nomograms for High-Dimensional Cox Models

Share:

Description

Nomograms for High-Dimensional Cox Models

Usage

1
2
3
hdnom.nomogram(object, model.type = c("lasso", "alasso", "flasso", "enet",
  "aenet", "mcp", "mnet", "scad", "snet"), x, time, event, ddist,
  lambda = NULL, pred.at = NULL, fun.at = NULL, funlabel = NULL)

Arguments

object

Fitted model object.

model.type

Fitted model type. Could be one of "lasso", "alasso", "flasso", "enet", "aenet", "mcp", "mnet", "scad", or "snet".

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.

ddist

Data frame version of x, made by datadist.

lambda

Value of the penalty parameter lambda in glmnet or ncvsurv. Required except when model.type == "flasso". We will use the selected variables at the provided lambda to build the nomogram, and make predictions. See the example for choosing a proper lambda value extracted from cross-validation results.

pred.at

Time point at which to plot nomogram prediction axis.

fun.at

Function values to label on axis.

funlabel

Label for fun axis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library("rms")

# Load imputed SMART data
data(smart)
x = as.matrix(smart[, -c(1, 2)])
time = smart$TEVENT
event = smart$EVENT
y = Surv(time, event)

# Fit penalized Cox model with lasso penalty
lassofit = hdcox.lasso(x, y, nfolds = 5, rule = "lambda.1se", seed = 11)

# Prepare data needed for plotting nomogram
x.df = as.data.frame(x)
dd = datadist(x.df)
options(datadist = "dd")

# Generate hdnom.nomogram objects and plot nomogram
nom = hdnom.nomogram(lassofit$lasso_model, model.type = "lasso",
                     x, time, event, x.df,
                     lambda = lassofit$lasso_best_lambda, pred.at = 365 * 2,
                     funlabel = "2-Year Overall Survival Probability")

print(nom)
plot(nom)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.