run_survival | R Documentation |
Run survival analysis
run_survival(time, censor, arm, control = NA, conf_level)
time |
time to event data |
censor |
indicator for censor or event, 0 = censored, 1 = event |
arm |
indicator for arm. Has to be at least two arms |
control |
the name of the control arm |
conf_level |
The confidence level to calculate for estimated hazard ratio |
a data frame containing results of sample size, p-value, decision, number of events, hazard ratio with 95% confidence interval, median survival, median follow-up, ect
rand_arm(nsbj = 1, ratio = c(1, 1))
time <- c(5.68, 0.34, 4.94, 1.49, 4.72, 1.32, 3.48, 3.42, 3.41, 2.93)
censor <- c(0, 0, 0, 1, 0, 1, 0, 0, 0, 1)
arm <- c("arm_1", "arm_2", "arm_1", "arm_2", "arm_2", "arm_1", "arm_2", "arm_1", "arm_1", "arm_2")
control <- "arm_1"
res1 <- run_survival(time, censor, arm, control = "arm_1", conf_level = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.