Description Usage Arguments Value Examples
survPercent provides survival percentages for a survfit(Surv()) model for specified times.
1 | survPercent(model, times, labels = NULL)
|
model |
A survfit(Surv()) model from the survival package |
times |
A vector of times to provide survival percentages for |
labels |
Labels for the grouping variable, if applicable |
A data.frame containing survival percentages.
1 2 3 4 5 6 7 | #example_dat <- data.frame(time = runif(100, 2, 100),
# event = sample(c(0, 1), 100, prob = c(.2, .8), replace = T),
# grp = sample(letters[1:3], 100, replace = T))
#library(survival)
#sMod <- survfit(Surv(time, event) ~ grp, data = example_dat)
#survPercent(model = sMod, times = c(10, 20, 30, 40, 50))
#survPercent(model = sMod, times = 1:5*10, labels=c("Group 1", "Group 2", "Group 3"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.