calc_surv_table: Calculate time-to-event estimates

View source: R/calc_surv_table.R

calc_surv_tableR Documentation

Calculate time-to-event estimates

Description

Takes a survfit object and returns a tibble with median and confidence intervals.

Usage

calc_surv_table(fit, all_group_name = "All subjects")

Arguments

fit

survfit object

all_group_name

String name for all records. Default is "All subjects".

Value

A tibble

Examples

library(survival)
library(dplyr)
head(aml)

fit <- survival::survfit(
  survival::Surv(time = time,
                 event = status) ~ x,
  data = aml)

calc_surv_table(fit)

fit <- survival::survfit(
  survival::Surv(time = time,
                 event = status) ~ 1,
  data = aml)

calc_surv_table(fit)

emilelatour/lamisc documentation built on May 10, 2024, 8:38 a.m.