**[ST] stci** -- Confidence intervals for means and percentiles of survival time

__Syntax__

**stci** [*if*] [*in*] [**,** *options*]

*options* Description
-------------------------------------------------------------------------
Main
**by(***varlist***)** perform separate calculations for each group of *varlist*
__m__**edian** calculate median survival times; the default
__r__**mean** calculate mean survival time restricted to longest
follow-up time
__e__**mean** calculate the mean survival time by exponentially
extending the survival curve to zero
**p(***#***)** compute the *#* percentile of survival times
__cc__**orr** calculate the standard error for **rmean** using a
continuity correction
__nosh__**ow** do not show st setting information
**dd(***#***)** set maximum number of decimal digits to report
__l__**evel(***#***)** set confidence level; default is **level(95)**
__g__**raph** plot exponentially extended survivor function
__t__**max(***#***)** set maximum analysis time of *#* to be plotted

Plot
*cline_options* affect rendition of the plotted lines

Add plots
**addplot(***plot***)** add other plots to the generated graph

Y axis, X axis, Titles, Legend, Overall
*twoway_options* any options other than **by()** documented in **[G-3]**
*twoway_options*
-------------------------------------------------------------------------
You must **stset** your data before using **stci**; see **[ST] stset**.
**by** is allowed; see **[D] by**.

__Menu__

**Statistics > Survival analysis > Summary statistics, tests, and tables >**
**CIs for means and percentiles of survival time**

__Description__

**stci** computes means and percentiles of survival time, standard errors,
and confidence intervals. For multiple-event data, survival time is the
time until a failure.

**stci** can be used with single- or multiple-record or single- or
multiple-failure st data.

__Options__

+------+
----+ Main +-------------------------------------------------------------

**by(***varlist***)** specifies that separate calculations be made for each group
identified by equal values of the variables in *varlist*, resulting in
separate summaries and an overall total. *varlist* may contain any
number of variables, each of which may be string or numeric.

**median** specifies median survival times. This is the default.

**rmean** and **emean** specify mean survival times. If the longest follow-up
time is censored, **emean** (extended mean) computes the mean survival by
exponentially extending the survival curve to zero, and **rmean**
(restricted mean) computes the mean survival time restricted to the
longest follow-up time. If the longest follow-up time is a failure,
the restricted mean survival time and the extended mean survival time
are equal.

**p(***#***)** specifies the percentile of survival time to be computed. For
example, **p(25)** will compute the 25th percentile of survival times,
and **p(75)** will compute the 75th percentile of survival times.
Specifying **p(50)** is the same as specifying the **median** option.

**ccorr** specifies that the standard error for the restricted mean survival
time be computed using a continuity correction. **ccorr** is valid only
with the **rmean** option.

**noshow** prevents **stci** 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**.

**dd(***#***)** specifies the maximum number of decimal digits to be reported for
standard errors and confidence intervals. This option affects only
how values are reported and not how they are calculated.

**level(***#***)** specifies the confidence level, as a percentage, for confidence
intervals. The default is **level(95)** or as set by **set level**.

**graph** specifies that the exponentially extended survivor function be
plotted. This option is valid only when the **emean** option is also
specified and is not valid in conjunction with the **by()** option.

**tmax(***#***)** is for use with the **graph** option. It specifies the maximum
analysis time to be plotted.

+------+
----+ Plot +-------------------------------------------------------------

*cline_options* affect the rendition of the plotted lines; see **[G-3]**
*cline_options*.

+-----------+
----+ Add plots +--------------------------------------------------------

**addplot(***plot***)** provides a way to add other plots to the generated graph;
see **[G-3]** *addplot_option*.

+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------

*twoway_options* are any of the options documented in **[G-3]** *twoway_options*,
excluding **by()**. These include options for titling the graph (see
**[G-3]** *title_options*) and for saving the graph to disk (see **[G-3]**
*saving_option*).

__Examples with single-record survival data__

Setup
**. webuse page2**

Compute median survival time
**. stci**

Compute median survival time by group
**. stci, by(group)**

Compute the 25th percentile of survival time
**. stci, p(25)**

Compute the 25th percentile of survival time by group
**. stci, p(25) by(group)**

Compute mean survival time restricted to the longest follow-up time by
group
**. stci, rmean by(group)**

Compute mean survival time by exponentially extending the survival curve
to 0
**. stci, emean**

Same as above, but also plot the exponentially extended survivor function
**. stci, emean graph**

__Examples with multiple-record survival data__

Setup
**. webuse stan3**

Compute median survival time
**. stci**

Compute median survival time by group
**. stci, by(posttran)**

Report whether values of **posttran** within subject vary over time
**. stvary posttran**

__Examples with multiple-failure data__

Setup
**. webuse mfail2**

Show st settings
**. stset**

Compute median survival time
**. stci**

Create **nf** containing the cumulative number of failures for each subject
as of the entry time for the observation
**. stgen nf = nfailures()**

Compute median survival time by group
**. stci, by(nf)**

__Stored results__

**stci** stores the following in **r()**:

Scalars
**r(N_sub)** number of subjects
**r(p***#***)** *#*th percentile
**r(rmean)** restricted mean
**r(emean)** extended mean
**r(se)** standard error
**r(lb)** lower bound of CI
**r(ub)** upper bound of CI