50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


survMisc (version 0.5.5)

ci: confidence intervals for survival curves.

Description

confidence intervals for survival curves.

Usage

ci(x, ...)

# S3 method for ten ci(x, ..., CI = c("0.95", "0.9", "0.99"), how = c("point", "nair", "hall"), trans = c("log", "lin", "asi"), tL = NULL, tU = NULL, reCalc = FALSE)

# S3 method for stratTen ci(x, ..., CI = c("0.95", "0.9", "0.99"), how = c("point", "nair", "hall"), trans = c("log", "lin", "asi"), tL = NULL, tU = NULL)

Arguments

x

An object of class ten.

...

Additional arguments (not implemented).

CI

Confidence intervals. As the function currently relies on lookup tables, currently only 90%, 95% (the default) and 99% are supported.

how

Method to use for confidence interval. point (the default) uses pointwise confirence intervals. The alternatives use confidence bands (see details).

trans

Transformation to use.

The default is trans="log".

Also supported are linear and arcsine-square root transformations.

tL

Lower time point. Used in construction of confidence bands.

tU

Upper time point. Used in construction of confidence bands.

reCalc

Recalcuate the values? If reCalc=FALSE (the default) and the ten object already has the calculated values stored as an attribute, the value of the attribute is returned directly.

Value

The ten object is modified in place by the additional of a data.table as an attribute. attr(x, "ci") is printed. This A survfit object. The upper and lower elements in the list (representing confidence intervals) are modified from the original.

Other elements will also be shortened if the time range under consideration has been reduced from the original.

Details

In the equations below σs2(t)=V^[S^(t)]S^2(t) Where S^(t) is the Kaplan-Meier survival estimate and V^[S^(t)] is Greenwood's estimate of its variance.

The pointwise confidence intervals are valid for individual times, e.g. median and quantile values. When plotted and joined for multiple points they tend to be narrower than the bands described below. Thus they tend to exaggerate the impression of certainty when used to plot confidence intervals for a time range. They should not be interpreted as giving the intervals within which the entire survival function lies.

For a given significance level α, they are calculated using the standard normal distribution Z as follows:

  • linear S^(t)±Z1ασ(t)S^(t)

  • log transform [S^(t)1θ,S^(t)θ] where θ=expZ1ασ(t)logS^(t)

  • arcsine-square root transform

    upper:

    sin2(max[0,arcsinS^(t)Z1ασ(t)2S^(t)1S^(t)]) lower: sin2(min[π2,arcsinS^(t)+Z1ασ(t)2S^(t)1S^(t)])

Confidence bands give the values within which the survival function falls within a range of timepoints.

The time range under consideration is given so that tltmin, the minimum or lowest event time and tutmax, the maximum or largest event time.

For a sample size n and 0<al<au<1: al=nσs2(tl)1+nσs2(tl) au=nσs2(tu)1+nσs2(tu)

For the Nair or equal precision (EP) confidence bands, we begin by obtaining the relevant confidence coefficient cα. This is obtained from the upper α-th fractile of the random variable U=sup|Wo(x)[x(1x)]|,alxau Where Wo is a standard Brownian bridge.

The intervals are:

  • linear S^(t)±cασs(t)S^(t)

  • log transform (the default)

    This uses θ as below: θ=expcασs(t)logS^(t) And is given by: [S^(t)1θ,S^(t)θ]

  • arcsine-square root transform

    upper: sin2(max[0,arcsinS^(t)cασs(t)2S^(t)1S^(t)]) lower: sin2(min[π2,arcsinS^(t)+cασs(t)2S^(t)1S^(t)])

For the Hall-Wellner bands the confidence coefficient kα is obtained from the upper α-th fractile of a Brownian bridge.

In this case tl can be =0.

The intervals are:

  • linear S^(t)±kα1+nσs2(t)nS^(t)

  • log transform [S^(t)1θ,S^(t)θ] where θ=expkα[1+nσs2(t)]nlogS^(t)

  • arcsine-square root transform

    upper: sin2(max[0,arcsinS^(t)kα[1+nσs(t)]2nS^(t)1S^(t)]) lower: sin2(min[π2,arcsinS^(t)+kα[1+nσs2(t)]2nS^(t)1S^(t)])

References

Nair V, 1984. Confidence bands for survival functions with censored data: a comparative study. Technometrics. 26(3):265-75. http://www.jstor.org/stable/1267553 JSTOR

Hall WJ, Wellner JA, 1980. Confidence bands for a survival curve from censored data. Biometrika. 67(1):133-43. http://www.jstor.org/stable/2335326 JSTOR

See Also

sf

quantile

Examples

Run this code
# NOT RUN {
## K&M 2nd ed. Section 4.3. Example 4.2, pg 105.
data("bmt", package="KMsurv")
b1 <- bmt[bmt$group==1, ] # ALL patients
## K&M 2nd ed. Section 4.4. Example 4.2 (cont.), pg 111.
## patients with ALL
t1 <- ten(Surv(t2, d3) ~ 1, data=bmt[bmt$group==1, ])
ci(t1, how="nair", trans="lin", tL=100, tU=600)
## Table 4.5, pg. 111.
lapply(list("lin", "log", "asi"),
       function(x) ci(t1, how="nair", trans=x, tL=100, tU=600))
## Table 4.6, pg. 111.
lapply(list("lin", "log", "asi"),
       function(x) ci(t1, how="hall", trans=x, tL=100, tU=600))
t1 <- ten(Surv(t2, d3) ~ group, data=bmt)
ci(t1, CI="0.95", how="nair", trans="lin", tL=100, tU=600)

## stratified model
data("pbc", package="survival")
t1 <- ten(coxph(Surv(time, status==2) ~ log(bili) + age + strata(edema), data=pbc))
ci(t1)

# }

Run the code above in your browser using DataLab