| quantile.survfit {survival} | R Documentation |
Retrieve quantiles and confidence intervals for them from a survfit object.
## S3 method for class 'survfit' quantile(x, probs = c(0.25, 0.5, 0.75), conf.int = TRUE, ...)
x |
a result of the survfit function |
probs |
numeric vector of probabilities with values in [0,1]. |
conf.int |
should lower and upper confidence limits be returned? |
... |
optional arguments for other methods |
The kth quantile for a survival curve S(t) is the location at which a horizontal line at height 1-k intersects the plot of S(t). Since S(t) is a step function, it is possible for the curve to have a horizontal segment at exactly 1-k, in which case the midpoint of the horizontal segment is returned. This mirrors the standard behavior of the median when data is uncensored. If the survival curve does not fall to 1-k, then that quantile is undefined.
Confidence limits for the values are based on the intersection of the
horizontal line at 1-k with the upper and lower limits for the
survival curve. Hence confidence limits use the same
p-value as was in effect when the curve was created, and will differ
depending on the conf.type option of survfit.
If the survival curves have no confidence bands, confidence limits for
the quantiles are not available.
The quantiles will be a vector if the survfit object contains
only a single curve, otherwise it will be a matrix or array. In
this latter case the second dimension will index the quantiles.
If confidence limits are requested, then result will list with components
quantile, lower, and upper, otherwise the
vector or matrix of quantiles.
Terry Therneau
survfit, print.survfit,
qsurvreg
fit <- survfit(Surv(time, status) ~ ph.ecog, data=lung) quantile(fit)