predict.survdnn: Predict from a survdnn Model

View source: R/predict.survdnn.R

predict.survdnnR Documentation

Predict from a survdnn Model

Description

Generate predictions from a fitted 'survdnn' model for new data. Supports linear predictors, survival probabilities at specified time points, or cumulative risk estimates.

Usage

## S3 method for class 'survdnn'
predict(object, newdata, times = NULL, type = c("survival", "lp", "risk"), ...)

Arguments

object

An object of class '"survdnn"' returned by [survdnn()].

newdata

A data frame of new observations to predict on.

times

Numeric vector of time points at which to compute survival or risk probabilities. Required if 'type = "survival"' or 'type = "risk"' for Cox/AFT models. For CoxTime, 'times = NULL' is allowed when 'type="survival"' and defaults to event times.

type

Character string specifying the type of prediction to return:

"lp"

Linear predictor. For '"cox"'/'"cox_l2"' this is a log-risk score (higher implies worse prognosis, consistent with training sign convention). For '"aft"', this is the predicted location parameter \mu(x) on the log-time scale. For '"coxtime"', this is g(t_0, x) evaluated at a reference time t_0 (the first event time).

"survival"

Predicted survival probabilities at each value of 'times'.

"risk"

Cumulative risk (1 - survival) at **a single** time point.

...

Currently ignored (for future extensions).

Value

A numeric vector (if 'type = "lp"' or '"risk"'), or a data frame (if 'type = "survival"') with one row per observation and one column per 'times'.


survdnn documentation built on Jan. 8, 2026, 9:07 a.m.