medtab: Lisa's Median Survival Table

View source: R/medtab.R

medtabR Documentation

Lisa's Median Survival Table

Description

This function creates a summary table from a survfit object including median survival estimates with CIs. It returns a dataframe and prints a table using kable or htmlTable.

Usage

medtab(
  sfit,
  groups = NA,
  grlabs = NA,
  grcolname = "Group",
  med.dec = 2,
  medlab = "Median survival time",
  printorig = TRUE,
  kable = TRUE,
  htmlTable = FALSE
)

Arguments

sfit

Survfit object (REQUIRED).

groups

Character vector for groups as listed in dataset. Default = NA (no groups).

grlabs

Character vector for group names, must be in same order as groups. Default = NA (no groups or use group levels from dataset).

grcolname

Character label for group column. Default = "Group".

med.dec

Number of decimal places to report for median survival time. Default = 2.

medlab

Character label for median and CI columns. Default = "Median survival time".

printorig

Logical indicator to print original summary of survfit object for checking purposes. Default = TRUE.

kable

Logical. Indicator to use kable to display table. Default = TRUE.

htmlTable

Logical. Indicator to use htmlTable package to display table instead of kable Default = FALSE.


lisaerein/nicesurv documentation built on Dec. 9, 2024, 12:17 a.m.