surv_table | R Documentation |
Prints a formatted summary table for survfit
objects.
surv_table(
object,
digits = ifelse(percent, 0L, 3L),
times = pretty(object$time),
maxtime = FALSE,
percent = FALSE,
locf = FALSE,
median = FALSE,
ci.median = TRUE,
ci.type = c("conf.int", "range"),
digits.median = 0L,
na.median = "NR",
fun = c("S", "F"),
...
)
object |
an object of class |
digits |
number of digits to use in printing numbers |
times |
vector of times |
maxtime |
logical; if |
percent |
logical; if |
locf |
logical; if |
median , ci.median |
logical; if |
ci.type |
for the median confidence interval, show either the
|
digits.median |
for the median, the number of digits past the decimal point to keep |
na.median |
a string to use in place of "NA" for the median text; default is "NR" for "not reached" |
fun |
survival estimate transformation, one of "S" or "F" for the usual
survival probabilities, |
... |
additional arguments passed to |
A matrix (or list of matrices) with formatted summaries for each strata; see
summary.survfit
survfit
; print.summary.survfit
library('survival')
fit0 <- survfit(Surv(time, status == 2) ~ 1, data = cancer)
surv_table(fit0, times = 0:2 * 100)
surv_table(fit0, times = 0:2 * 100, median = TRUE)
surv_table(fit0, times = 0:2 * 100, median = TRUE, ci.type = 'range')
## also works for list of tables
fit1 <- survfit(Surv(time, status == 2) ~ sex, data = cancer)
surv_table(fit1, median = TRUE, digits.median = 2, ci.median = FALSE)
rawr::combine_table(surv_table(fit1, median = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.