View source: R/utils-survival.R
observed_survival | R Documentation |
This functions calculate some survival information (e.g. survival rate, mortality rate).
observed_survival(x, f, times)
observed_mortality(x, f, times)
observed_events(x, f, times, cumulative = FALSE)
x |
|
f |
|
times |
|
cumulative |
|
In contrast to survival::summary.survfit()
these functions do not remove
empty strata (e.g. important for bootstrapping).
double
, with an element for each level in f
,
if times is a numeric
of length 1; or a matrix
with
as much rows as elements in times
and a column for each level in f
.
sv <- Surv(1:4, c(0, 1, 1, 0))
f <- factor(c("a", "c", "a", "c"), levels = c("a", "b", "c"))
observed_survival(sv, times = 3)
observed_survival(sv, f = f, times = 3)
observed_survival(sv, f = f, times = 1:4)
observed_mortality(sv, f = f, times = 3)
observed_events(sv, f = f, times = 3)
observed_events(sv, f = f, times = 1:4)
observed_events(sv, f = f, times = 1:4, cumulative = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.