Learn R Programming

hdnom (version 6.0.4)

as_nomogram: Construct nomogram ojects for high-dimensional Cox models

Description

Construct nomograms ojects for high-dimensional Cox models

Usage

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.

Examples

Run this code
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)
plot(nom)

Run the code above in your browser using DataLab