gtsummary (version 1.3.6)

inline_text.tbl_survival: Report statistics from survival summary tables inline

Description

for inline reporting in an R markdown document.

Usage

# S3 method for tbl_survival
inline_text(
  x,
  strata = NULL,
  time = NULL,
  prob = NULL,
  pattern = "{estimate} ({conf.level*100}% CI {ci})",
  estimate_fun = NULL,
  ...
)

Value

A string reporting results from a gtsummary table

pattern argument

The following items are available to print. Use print(x$table_long) to print the table the estimates are extracted from.

  • {label} 'time' or 'prob' label

  • {estimate} survival or survival time estimate formatted with 'estimate_fun'

  • {conf.low} lower limit of confidence interval formatted with 'estimate_fun'

  • {conf.high} upper limit of confidence interval formatted with 'estimate_fun'

  • {ci} confidence interval formatted with x$estimate_fun (pre-formatted)

  • {time}/{prob} time or survival quantile (numeric)

  • {n.risk} number at risk at 'time' (within stratum if applicable)

  • {n.event} number of observed events at 'time' (within stratum if applicable)

  • {n} number of observations (within stratum if applicable)

  • {variable} stratum variable (if applicable)

  • {level} stratum level (if applicable )

  • {groupname} label_level from original tbl_survival() call

See Also

Other tbl_survival tools: tbl_survival.survfit()

Examples

Run this code
# NOT RUN {
library(survival)
surv_table <-
  survfit(Surv(ttdeath, death) ~ trt, trial) %>%
  tbl_survival(times = c(12, 24))

inline_text(surv_table,
  strata = "Drug A",
  time = 12
)
# }

Run the code above in your browser using DataCamp Workspace