survival_prob_coxph: A wrapper for survival probabilities with coxph models

View source: R/proportional_hazards-survival.R

survival_prob_coxphR Documentation

A wrapper for survival probabilities with coxph models

Description

A wrapper for survival probabilities with coxph models

Usage

survival_prob_coxph(
  x,
  new_data,
  eval_time,
  time = deprecated(),
  output = "surv",
  interval = "none",
  conf.int = 0.95,
  ...
)

Arguments

x

A model from coxph().

new_data

Data for prediction

eval_time

A vector of integers for prediction times.

time

Deprecated in favor of eval_time. A vector of integers for prediction times.

output

One of "surv", "conf", or "haz".

interval

Add confidence interval for survival probability? Options are "none" or "confidence".

conf.int

The confidence level.

...

Options to pass to survival::survfit()

Value

A tibble with a list column of nested tibbles.

Examples

cox_mod <- coxph(Surv(time, status) ~ ., data = lung)
survival_prob_coxph(cox_mod, new_data = lung[1:3, ], eval_time = 300)

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