Learn R Programming

tern (version 0.9.11)

h_tbl_median_surv: Helper function for survival estimations

Description

[Stable]

Transform a survival fit to a table with groups in rows characterized by N, median and confidence interval.

Usage

h_tbl_median_surv(fit_km, armval = "All", digits = 4)

Value

A summary table with statistics N, Median, and XX% CI (XX taken from fit_km).

Arguments

fit_km

(survfit)
result of survival::survfit().

armval

(string)
used as strata name when treatment arm variable only has one level. Default is "All".

digits

(integer(1))
number of significant digits for median and CI values. Defaults to 4.

Examples

Run this code
library(dplyr)
library(survival)

adtte <- tern_ex_adtte |> filter(PARAMCD == "OS")
fit <- survfit(
  formula = Surv(AVAL, 1 - CNSR) ~ ARMCD,
  data = adtte
)
h_tbl_median_surv(fit_km = fit)
h_tbl_median_surv(fit_km = fit, digits = 2)

Run the code above in your browser using DataLab