citab: Lisa's Cumulative Incidence Survival Table

View source: R/citab.R

citabR Documentation

Lisa's Cumulative Incidence Survival Table

Description

This function creates a summary table from a survfit object of type "mstate" including cumulative incidence estimates with CIs. It returns a dataframe and prints a table using kable or htmlTable.

Usage

citab(
  msfit,
  times,
  timelab = "Time",
  events = NA,
  evlabs = NA,
  groups = NA,
  grlabs = NA,
  grcolname = "Group",
  ci.dec = 2,
  perc = FALSE,
  color = "#EEEEEE",
  kable = TRUE,
  htmlTable = FALSE,
  flextable = TRUE,
  printorig = TRUE
)

Arguments

msfit

survfit object of type "mstate" (REQUIRED).

times

Numeric vector of times for cumulative incidence estimates (REQUIRED).

timelab

Character label for time. Default = "Time".

events

Character vector for event names. Note base state should always be referred to as "(s0)"). Default = NA (take names from object).

evlabs

Character vector for event labels. Default = NA (take names from object or events arg).

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".

ci.dec

Number of decimal places to report for cumlative incidence estimates. Default = 2.

perc

Logical indicator to report estimates as percentages. Default = FALSE.

color

Character Hex color to use for htmlTable striping. Default = "#EEEEEE" (light grey).

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.

flextable

Logical. Indicator to use flextable to display results.

printorig

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


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