Package 'optband'

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: 2025-01-20 03:10:19 UTC
Source: https://github.com/seasamgo/optband

Help Index


Confidence bands optimized by area

Description

opt.ci obtains simultaneous confidence bands for the survival or cumulative-hazard functions such that the area between is minimized.

Usage

opt.ci(survi, conf.level = 0.95, fun = "surv", tl = NA, tu = NA, samples = 1)

Arguments

survi

a survfit object.

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).

Details

Produces an approximate solution based on local time arguments.

Value

A survfit object with optimized confidence bands.

Examples

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)