| Title: | 'surv' Object Confidence Bands Optimized by Area |
|---|---|
| Description: | Given a certain coverage level, obtains simultaneous confidence bands for the survival and cumulative hazard functions such that the area between is minimized. Produces an approximate solution based on local time arguments. |
| Authors: | Tom Chen & Sam Tracy |
| Maintainer: | Sam Tracy <[email protected]> |
| License: | GPL-2 | GPL-3 |
| Version: | 0.2.2.9000 |
| Built: | 2026-05-19 07:24:55 UTC |
| Source: | https://github.com/seasamgo/optband |
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)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)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)