ci(x, ...)## S3 method for class 'survfit':
ci(x, ..., CI = c("0.95", "0.9", "0.99"), how = c("point",
"nair", "hall"), trans = c("log", "lin", "asin"), tL = NULL, tU = NULL)
survfit
point
(the default) uses pointwise confirence intervals.
The alternatives use confidence bands (see details).trans="log"
.
Also supported are linear and arcsine-square root transformations.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.km.ci::km.ci
.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 $\alpha$,
they are calculated using the standard normal distribution $Z$
as follows: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 $t_l \geq t_{min}$, the minimum or lowest event time and $t_u \leq t_{max}$, the maximum or largest event time. For a sample size $n$ and $0 < a_l < a_u <1$: $$a_l="\frac{n\sigma^2_s(t_l)}{1+n\sigma^2_s(t_l)}$$" $$a_u="\frac{n\sigma^2_s(t_u)}{1+n\sigma^2_s(t_u)}$$
For the Nair or equal precision (EP) confidence bands, we begin by obtaining the relevant confidence coefficient $c_{\alpha}$. This is obtained from the upper $\alpha$-th fractile of the random variable $$U = \sup{|W^o(x)\sqrt{[x(1-x)]}|, \quad a_l \leq x \leq a_u}$$ Where $W^o$ is a standard Brownian bridge. The intervals are:
For the Hall-Wellner bands the confidence coefficient $k_{\alpha}$ is obtained from the upper $\alpha$-th fractile of a Brownian bridge. In this case $t_l$ can be $=0$. The intervals are:
Hall WJ, Wellner JA, 1980.
Confidence bands for a survival curve from censored data.
Biometrika. 67(1):133-43.
Examples are from: K&M. Section 4.4, pg 111.
sf
data(bmt, package="KMsurv")
b1 <- bmt[bmt$group==1, ] # ALL patients
s1 <- survfit(Surv(t2, d3) ~ 1, data=bmt[bmt$group==1, ])
ci(s1, how="nair", trans="lin", tL=100, tU=600)
s2 <- survfit(Surv(t2, d3) ~ group, data=bmt)
ci(s2, CI="0.99", how="point", trans="asin", tL=100, tU=600)
Run the code above in your browser using DataLab