
Summary of a Survival Curve
summary.survfit.RdReturns a list containing the survival curve, confidence limits for the curve, and other information.
Usage
# S3 method for class 'survfit'
summary(object, times, censored=FALSE, scale=1,
extend=FALSE, rmean=getOption('survfit.rmean'), data.frame=FALSE, dosum, ...)
# S3 method for class 'survfitms'
summary(object, times, censored=FALSE, scale=1,
extend=FALSE, rmean=getOption('survfit.rmean'), data.frame=FALSE, dosum, ...)Arguments
- object
the result of a call to the
survfitfunction.- times
vector of times; the returned matrix will contain 1 row for each time. The vector will be sorted into increasing order; missing values are not allowed. If
censored=T, the defaulttimesvector contains all the unique times infit, otherwise the defaulttimesvector uses only the event (death) times.- censored
logical value: should the censoring times be included in the output? This is ignored if the
timesargument is present.- scale
numeric value to rescale the survival time, e.g., if the input data to
survfitwere in days,scale = 365.25would scale the output to years.- extend
logical value: if TRUE, prints information for all specified
times, even if there are no subjects left at the end of the specifiedtimes. This is only used if thetimesargument is present.- rmean
Show restricted mean: see
print.survfitfor details- data.frame
if TRUE, return the results as a data frame, rather than a summary.survfit object
- dosum
only applicable if
timesis present, see details below- ...
for future methods
Value
if data.frame = TRUE, a data frame with columns of time,
n.risk, n.event, n.censor, surv, strata (if present) and, for survfit.coxph,
the relevant row of newdata. Also std.err,
upper and lower if the curve had se.fit=TRUE.
if data.frame = FALSE, a list with the following components:
- surv
the estimate of survival at time t+0.
- time
the timepoints on the curve.
- n.risk
the number of subjects at risk at time t-0 (but see the comments on weights in the
survfithelp file).- n.event
if the
timesargument is missing, then this column is the number of events that occurred at time t. Otherwise, it is the cumulative number of events that have occurred since the last time listed until time t+0.- n.entered
This is present only for counting process survival data. If the
timesargument is missing, this column is the number of subjects that entered at time t. Otherwise, it is the cumulative number of subjects that have entered since the last time listed until time t.- n.exit.censored
if the
timesargument is missing, this column is the number of subjects that left without an event at time t. Otherwise, it is the cumulative number of subjects that have left without an event since the last time listed until time t+0. This is only present for counting process survival data.- std.err
the standard error of the survival value.
- conf.int
level of confidence for the confidence intervals of survival.
- lower
lower confidence limits for the curve.
- upper
upper confidence limits for the curve.
- strata
indicates stratification of curve estimation. If
stratais notNULL, there are multiple curves in the result and thesurv,time,n.risk, etc. vectors will contain multiple curves, pasted end to end. The levels ofstrata(a factor) are the labels for the curves.- call
the statement used to create the
fitobject.- na.action
same as for
fit, if present.- table
table of information that is returned from
print.survfitfunction.- type
type of data censoring. Passed through from the fit object.
Details
This routine has two uses: printing out a survival curve at specified
time points (often yearly), or extracting the values at specified time
points for further processing.
In the first case we normally want extend=FALSE, i.e., don't print out
data past the end of the curve. If the times option only
contains values beyond the last point in the curve then there is nothing
to print and an error message will result.
For the second usage we often want extend=TRUE, so that the
results will have a predictable length.
If data.frame = TRUE then either might be desired.
Be aware, however, that these extended values will often be badly
biased; we are essentialy treating the final censored subjects as
immortal.
The underlying survival object will have a row for each unique event or
censoring time.
When the times argument contains values not in the data, the
routine can only use a best guess for the number at risk, i.e., the
number at risk at the next event/censoring time.
When the routine is called with counting process data many users are
confused by counts that appear too large.
For example, Surv(c(0,0, 1, 5), c(2, 3, 8, 10), c(1, 0, 1, 0)),
which prints as (0,2] (0, 3+] (1, 8] (5,10+].
Do survfit followed by summary with
a request for the values at time 0.
The survfit object has entries only at times 2, 3, 8, and 10;
there are 3 subjects at risk at time 2, so that is what will be printed
for time 0.
For a printout at fixed times, for example yearly values for a curve,
the printed number of events will by default be the total number of
events that have occured since the prior line of printout, and likewise
for number of censored and number at entry, dosum = TRUE.
Alternately, the routine can return the number of events/censors/entry at
that time, dosum=FALSE.
This feature was added at the request of a user who essentially wanted to
use the times argument as a subscript to pick off selected rows
of the output, e.g., to select survival values corresponding to the
last follow-up times of a new set of observations.
The default for dosum is TRUE if the times vector is
strictly increasing and FALSE otherwise.
For a survfitms object replace the surv component with
pstate. Also, a data frame will not include the cumulative
hazard nor its standard error, since it has a different multiplicity:
one column per transition rather than one per state.
Examples
summary( survfit( Surv(futime, fustat)~1, data=ovarian))
#> Call: survfit(formula = Surv(futime, fustat) ~ 1, data = ovarian)
#>
#> time n.risk n.event survival std.err lower 95% CI upper 95% CI
#> 59 26 1 0.962 0.0377 0.890 1.000
#> 115 25 1 0.923 0.0523 0.826 1.000
#> 156 24 1 0.885 0.0627 0.770 1.000
#> 268 23 1 0.846 0.0708 0.718 0.997
#> 329 22 1 0.808 0.0773 0.670 0.974
#> 353 21 1 0.769 0.0826 0.623 0.949
#> 365 20 1 0.731 0.0870 0.579 0.923
#> 431 17 1 0.688 0.0919 0.529 0.894
#> 464 15 1 0.642 0.0965 0.478 0.862
#> 475 14 1 0.596 0.0999 0.429 0.828
#> 563 12 1 0.546 0.1032 0.377 0.791
#> 638 11 1 0.497 0.1051 0.328 0.752
summary( survfit( Surv(futime, fustat)~rx, data=ovarian))
#> Call: survfit(formula = Surv(futime, fustat) ~ rx, data = ovarian)
#>
#> rx=1
#> time n.risk n.event survival std.err lower 95% CI upper 95% CI
#> 59 13 1 0.923 0.0739 0.789 1.000
#> 115 12 1 0.846 0.1001 0.671 1.000
#> 156 11 1 0.769 0.1169 0.571 1.000
#> 268 10 1 0.692 0.1280 0.482 0.995
#> 329 9 1 0.615 0.1349 0.400 0.946
#> 431 8 1 0.538 0.1383 0.326 0.891
#> 638 5 1 0.431 0.1467 0.221 0.840
#>
#> rx=2
#> time n.risk n.event survival std.err lower 95% CI upper 95% CI
#> 353 13 1 0.923 0.0739 0.789 1.000
#> 365 12 1 0.846 0.1001 0.671 1.000
#> 464 9 1 0.752 0.1256 0.542 1.000
#> 475 8 1 0.658 0.1407 0.433 1.000
#> 563 7 1 0.564 0.1488 0.336 0.946
#>