survival_time_coxnet: A wrapper for survival times with coxnet models

View source: R/proportional_hazards-glmnet.R

survival_time_coxnetR Documentation

A wrapper for survival times with coxnet models

Description

A wrapper for survival times with coxnet models

Usage

survival_time_coxnet(object, new_data, penalty = NULL, ...)

Arguments

object

A fitted ⁠_coxnet⁠ object.

new_data

Data for prediction.

penalty

Penalty value(s).

...

Options to pass to survival::survfit().

Value

A vector.

Examples

cox_mod <- proportional_hazards(penalty = 0.1) %>%
  set_engine("glmnet") %>%
  fit(Surv(time, status) ~ ., data = lung)
survival_time_coxnet(cox_mod, new_data = lung[1:3, ], penalty = 0.1)

censored documentation built on April 14, 2023, 12:30 a.m.