EVOLUTION-MANAGER
Edit File: quantile.survfit.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Quantiles from a survfit object</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for quantile.survfit {survival}"><tr><td>quantile.survfit {survival}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Quantiles from a survfit object</h2> <h3>Description</h3> <p>Retrieve quantiles and confidence intervals for them from a survfit object. </p> <h3>Usage</h3> <pre> ## S3 method for class 'survfit' quantile(x, probs = c(0.25, 0.5, 0.75), conf.int = TRUE, tolerance= sqrt(.Machine$double.eps), ...) ## S3 method for class 'survfitms' quantile(x, probs = c(0.25, 0.5, 0.75), conf.int = TRUE, tolerance= sqrt(.Machine$double.eps), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>a result of the survfit function</p> </td></tr> <tr valign="top"><td><code>probs</code></td> <td> <p>numeric vector of probabilities with values in [0,1]</p> </td></tr> <tr valign="top"><td><code>conf.int</code></td> <td> <p>should lower and upper confidence limits be returned?</p> </td></tr> <tr valign="top"><td><code>tolerance</code></td> <td> <p>tolerance for checking that the survival curve exactly equals one of the quantiles</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>optional arguments for other methods</p> </td></tr> </table> <h3>Details</h3> <p>The kth quantile for a survival curve S(t) is the location at which a horizontal line at height p= 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. </p> <p>In order to be consistent with other quantile functions, the argument <code>prob</code> of this function applies to the cumulative distribution function F(t) = 1-S(t). </p> <p>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 <code>conf.type</code> option of <code>survfit</code>. If the survival curves have no confidence bands, confidence limits for the quantiles are not available. </p> <p>When a horizontal segment of the survival curve exactly matches one of the requested quantiles the returned value will be the midpoint of the horizontal segment; this agrees with the usual definition of a median for uncensored data. Since the survival curve is computed as a series of products, however, there may be round off error. Assume for instance a sample of size 20 with no tied times and no censoring. The survival curve after the 10th death is (19/20)(18/19)(17/18) ... (10/11) = 10/20, but the computed result will not be exactly 0.5. Any horizontal segment whose absolute difference with a requested percentile is less than <code>tolerance</code> is considered to be an exact match. </p> <h3>Value</h3> <p>The quantiles will be a vector if the <code>survfit</code> object contains only a single curve, otherwise it will be a matrix or array. In this case the last dimension will index the quantiles. </p> <p>If confidence limits are requested, then result will be a list with components <code>quantile</code>, <code>lower</code>, and <code>upper</code>, otherwise it is the vector or matrix of quantiles. </p> <h3>Author(s)</h3> <p>Terry Therneau</p> <h3>See Also</h3> <p><code><a href="survfit.html">survfit</a></code>, <code><a href="print.survfit.html">print.survfit</a></code>, <code><a href="dsurvreg.html">qsurvreg</a></code> </p> <h3>Examples</h3> <pre> fit <- survfit(Surv(time, status) ~ ph.ecog, data=lung) quantile(fit) cfit <- coxph(Surv(time, status) ~ age + strata(ph.ecog), data=lung) csurv<- survfit(cfit, newdata=data.frame(age=c(40, 60, 80)), conf.type ="none") temp <- quantile(csurv, 1:5/10) temp[2,3,] # quantiles for second level of ph.ecog, age=80 quantile(csurv[2,3], 1:5/10) # quantiles of a single curve, same result </pre> <hr /><div style="text-align: center;">[Package <em>survival</em> version 2.44-1.1 <a href="00Index.html">Index</a>]</div> </body></html>