help stsum dialog: stsum
-------------------------------------------------------------------------------
Title
[ST] stsum -- Summarize survival-time data
Syntax
stsum [if] [in] [, by(varlist) noshow]
You must stset your data before using stsum; see [ST] stset.
by is allowed; see [D] by.
fweights, iweights, and pweights may be specified with stset; see [ST]
stset.
Menu
Statistics > Survival analysis > Summary statistics, tests, and tables >
Summarize survival-time data
Description
stsum presents summary statistics: time at risk; incidence rate; number
of subjects; and the 25th, 50th, and 75th percentiles of survival time.
stsum can be used with single- or multiple-record or single- or
multiple-failure st date.
Options
+------+
----+ Main +-------------------------------------------------------------
by(varlist) requests separate summaries for each group along with an
overall total. Observations are in the same group if they have equal
values of the variables in varlist. varlist may contain any number
of string or numeric variables.
noshow prevents stsum from showing the key st variables. This option is
seldom used because most people type stset, show or stset, noshow to
set whether they want to see these variables mentioned at the top of
the output of every st command; see [ST] stset.
Examples using single-failure data
---------------------------------------------------------------------------
Setup
. webuse page2
Summarize single-record survival data
. stsum
---------------------------------------------------------------------------
Setup
. webuse stan3
Summarize multiple-record survival data
. stsum
Summarize multiple-record survival data for different categories of
posttran
. stsum, by(posttran)
Report whether values of posttran within subject vary over time
. stvary posttran
---------------------------------------------------------------------------
Example using multiple-failure data
Setup
. webuse mfail2
Show st settings
. st
Create nf containing the cumulative number of failures for each subject
as of the entry time for the observation
. stgen nf = nfailures()
Summarize data by categories of nf
. stsum, by(nf)
Saved results
stsum saves the following in r():
Scalars
r(p25) 25th percentile
r(p50) 50th percentile
r(p75) 75th percentile
r(risk) time at risk
r(ir) incidence rate
r(N_sub) number of subjects
Also see
Manual: [ST] stsum
Help: [ST] stdescribe, [ST] stgen, [ST] stir, [ST] sts, [ST] stset,
[ST] stvary, [ST] stci, [ST] stptime