View source: R/package_functions.R
opt.ci | R Documentation |
opt.ci
obtains simultaneous confidence bands for the survival or
cumulative-hazard functions such that the area between is minimized.
opt.ci(survi, conf.level = 0.95, fun = "surv", tl = NA, tu = NA, samples = 1)
survi |
a |
conf.level |
desired coverage level. |
fun |
"surv" for survival function and "cumhaz" for the cumulative-hazard. function, with "surv" as the default. |
tl |
a lower bound for truncation. |
tu |
an upper bound for truncation. |
samples |
the number of groups (1 or 2). |
Produces an approximate solution based on local time arguments.
A survfit
object with optimized confidence bands.
library(survival)
# fit and plot a Kaplan-Meier curve
fit <- survfit(Surv(stop, event) ~ 1, data=bladder)
plot(fit)
fit2 <- opt.ci(fit)
plot(fit2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.