View source: R/summary.survfit.R
summary.survfit | R Documentation |
Returns a list containing the survival curve, confidence limits for the curve, and other information.
## 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, ...)
object |
the result of a call to the |
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 |
logical value: should the censoring times be included in the output?
This is ignored if the |
scale |
numeric value to rescale the survival time, e.g., if the input data to
|
extend |
logical value: if TRUE, prints information for all specified |
rmean |
Show restricted mean: see
|
data.frame |
if TRUE, return the results as a data frame, rather than a summary.survfit object |
dosum |
only applicable if |
... |
for future methods |
if data.frame = TRUE
, a data frame with columns of time,
n.risk, n.event, n.censor, surv, cumhaz, strata (if present) and
data (the row of newdata for survfit.coxph). Also std.err, std.chaz,
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 |
n.event |
if the |
n.entered |
This is present only for counting process survival data.
If the |
n.exit.censored |
if the |
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 |
call |
the statement used to create the |
na.action |
same as for |
table |
table of information that is returned from |
type |
type of data censoring. Passed through from the fit object. |
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.
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
.
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 since it has a different multiplicity: one column per transition
rather than one per state.
The survfit
object itself will have a row of information at each
censoring or event time, the default is not save information on each unique
entry time. For printout at two time points t1, t2, this function will
give the the number at risk at the smallest event times that are >= t1
and >= t2, respectively, the survival curve at the largest recorded times
<= t1 and <= t2, and the number of events and censorings in the interval
t1 < t <= t2.
When the routine is called with counting process data many users are
confused by counts that are too large.
For example, Surv(c(0,0, 5, 5), c(2, 3, 8, 10), c(1, 0, 1, 0))
followed by a request for the values at time 4.
The survfit
object has entries only at times 2, 3, 8, and 10;
there are 2 subjects at risk at time 8, so that is what will be printed.
survfit
, print.summary.survfit
summary( survfit( Surv(futime, fustat)~1, data=ovarian))
summary( survfit( Surv(futime, fustat)~rx, data=ovarian))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.