Description Usage Arguments Value Examples
wrapper for survfit to create multiple survival curves for multiple endpoints, stratifications and groupings
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
surv |
the |
data |
the data |
strata |
stratifying variable |
glist |
a grouping list (list of logical vectors of the same length as rows in data, i.e. can be overlapping groups), or the name of a grouping variable in 'data' |
w |
weight or name of variable that provides weights |
type |
passed to |
prefix |
prefix values for times and events |
vs_age |
logical; should KM curves be with age on the x-axis? |
age_var |
character; name of age variable. N.B. important that age is measured in the same units as the time variable |
age_bound |
numeric; what age to start from |
progress |
primitive displayer of progress |
stringsAsFactors |
logical, if TRUE will keep ordering of ingoing stuff |
a data frame (much like a broom::tidy
-version of the output)
1 2 3 4 5 6 7 8 9 10 11 12 | n = 1200
df <- data.frame(
t.foo = abs(rnorm(n, 10, 2)),
ev.foo = rbinom(n, 1, 0.2),
t.bar = abs(rnorm(n, 10, 3)),
ev.bar = rbinom(n, 1, 0.3),
strutt = sample(letters[1:2], n, TRUE),
gsak = sample(LETTERS[4:7], n, TRUE),
wait = .5 + abs(rnorm(n, 0, 1))
)
str(survfit_it(data = df, surv = c("foo", "bar"), w = "wait",
strata = "strutt", glist = "gsak"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.