help ltable dialog: ltable
-------------------------------------------------------------------------------
Title
[ST] ltable -- Life tables for survival data
Syntax
ltable timevar [deadvar] [if] [in] [weight] [, options]
options description
-------------------------------------------------------------------------
Main
notable display graph only; suppress display of
table
graph present the table graphically, as well as
in tabular form
by(groupvar) produce separate tables (or graphs) for
each value of groupvar
test report chi-squared measure of differences
between groups (2 tests)
overlay overlay plots on the same graph
survival display survival table; the default
failure display cumulative failure table
hazard display hazard table
ci graph confidence interval
level(#) set confidence level; default is level(95)
noadjust suppress actuarial adjustment for deaths
and censored observations
tvid(varname) subject ID variable to use with
time-varying parameters
intervals(w|numlist) time intervals in which data are to be
aggregated for tables
saving(filename[, replace]) save the life-table data to filename; use
replace to overwrite existing filename
Plot
plotopts(plot_options) affect rendition of the plotted line and
plotted points
plot#opts(plot_options) affect rendition of the #th plotted line
and plotted points; available only with
overlay
CI plot
ciopts(rspike_options) affect rendition of the confidence
intervals
ci#opts(rspike_options) affect rendition of the #th confidence
interval; available only with overlay
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] twoway_options
byopts(byopts) how subgraphs are combined, labeled, etc.
-------------------------------------------------------------------------
plot_options description
-------------------------------------------------------------------------
connect_options change look of lines or connecting method
marker_options change look of markers (color, size, etc.)
-------------------------------------------------------------------------
fweights are allowed; see weight.
Menu
Statistics > Survival analysis > Summary statistics, tests, and tables >
Life tables for survival data
Description
ltable displays and graphs life tables for individual-level or aggregate
data and optionally presents the likelihood-ratio and log-rank tests for
equivalence of groups. ltable also allows you to examine the empirical
hazard function through aggregation. See also [ST] sts for alternative
commands.
timevar specifies the time of failure or censoring. If deadvar is not
specified, all values of timevar are interpreted as failure times;
otherwise, timevar is interpreted as a failure time where deadvar!=0, and
as a censoring time otherwise. Observations with timevar or deadvar
equal to missing are ignored.
deadvar does not specify the number of failures. An observation with
deadvar equal to 1 or 50 has the same interpretation -- the observation
records one failure. Specify frequency weights for aggregated data
(e.g., ltable time [freq=number]).
Options
+------+
----+ Main +-------------------------------------------------------------
notable suppresses displaying the table. This option is often used with
graph.
graph requests that the table be presented graphically, as well as in
tabular form; when notable is also specified, only the graph is
presented. When you specify graph, only one table can be calculated
and graphed at a time; see survival, failure, and hazard below.
graph may not be specified with hazard. Use sts graph to graph
estimates of the hazard function.
by(groupvar) creates separate tables (or graphs within the same image)
for each value of groupvar. groupvar may be string or numeric.
test presents two chi-squared measures of the differences between groups,
the likelihood-ratio test of homogeneity and the log-rank test for
equality of survivor functions. The two groups are identified by the
by() option, so by() must also be specified.
overlay causes the plot from each group identified in the by() option to
be overlaid on the same graph. The default is to generate a separate
graph (within the same image) for each group. This option requires
the by() option.
survival, failure, and hazard indicate the table to be displayed. If
none is specified specified, the default is the survival table.
Specifying failure displays the cumulative failure table. Specifying
survival failure would display both the survival and the cumulative
failure table. If graph is specified, multiple tables may not be
requested.
ci graphs the confidence intervals around survival, failure, or hazard.
level(#) specifies the confidence level, as a percentage, for confidence
intervals. The default is level(95) or as set by set level.
noadjust suppresses the actuarial adjustment for deaths and censored
observations. The default is to consider the adjusted number at risk
at the start of the interval to be total at the start minus (the
number dead or censored)/2. If noadjust is specified, the number at
risk is simply the total at the start, corresponding to the standard
Kaplan-Meier assumption. noadjust should be specified when using
ltable to list results corresponding to those produced by sts list.
tvid(varname) is for use with longitudinal data with time-varying
parameters. Each subject appears in the data more than once, and
equal values of varname identify observations referring to the same
subject. When tvid() is specified, only the last observation on each
subject is used in making the table. The order of the data does not
matter, and last here means the last observation chronologically.
intervals(w|numlist) specifies the intervals into which the data are to
be aggregated for tabular presentation. A numeric argument is
interpreted as the width of the interval. For instance, interval(2)
aggregates data into the intervals 0<=t<2, 2<=t<4, and so on. Not
specifying interval() is equivalent to specifying interval(1).
Because in most data, failure times are recorded as integers, this
amounts to no aggregation except that implied by the recording of the
time variable, and so it produces Kaplan-Meier product-limit
estimates of the survival curve (with an actuarial adjustment; see
the noadjust option below). Also see [ST] sts list. Although it is
possible to examine survival and failure without aggregation, some
form of aggregation is almost always required for examining the
hazard.
When more than one argument is specified, intervals are aggregated as
specified. For instance, interval(0,2,8,16) aggregates data into the
intervals [0,2), [2,8), [8,16), and (if necessary) [16, infinity).
interval(w) is equivalent to
interval(0,7,15,30,60,90,180,360,540,720), corresponding to 1 week,
(roughly) 2 weeks, 1 month, 2 months, 3 months, 6 months, 1 year, 1.5
years, and 2 years when failure times are recorded in days. The w
suggests widening intervals.
saving(filename[, replace]) creates a Stata data file (.dta file)
containing the life table. This option will not save the graph to
disk; see [G] graph save to save the resulting graph to disk.
replace indicates that filename be overwritten, if it exists. This
option is not shown in the dialog box.
+------+
----+ Plot +-------------------------------------------------------------
plotopts(plot_options) affects the rendition of the plotted line and
plotted points; see [G] connect_options and [G] marker_options.
plot#opts(plot_options) affects the rendition of the #th plotted line and
plotted points; see [G] connect_options and [G] marker_options. This
option is valid only if overlay is specified.
+---------+
----+ CI plot +----------------------------------------------------------
ciopts(rspike_options) affects the rendition of the confidence intervals
for the graphed survival, failure, or hazard; see [G] rspike_options.
ci#opts(rspike_options) affects the rendition of the #th confidence
interval for the graphed survival, failure, or hazard; see [G]
rspike_options. This option is valid only if overlay is specified.
+-----------+
----+ Add plots +--------------------------------------------------------
addplot(plot) provides a way to add other plots to the generated graph;
see [G] addplot_option.
+-----------------------------------------+
----+ Y axis, X axis, Titles, Legend, Overall +--------------------------
twoway_options are any of the options documented in [G] twoway_options,
excluding by(). These include options for titling the graph (see [G]
title_options) and for saving the graph to disk (see [G]
saving_option).
byopts(byopts) affects the appearance of the combined graph when by() is
specified, including the overall graph title and the organization of
subgraphs. See [G] by_option.
Examples
---------------------------------------------------------------------------
Setup
. webuse rat
List some of the data
. list in 1/5
. list if died == 0
Display the life table for group 1
. ltable t died if group == 1
Display the life table for group 1 aggregated into 30-day intervals
. ltable t died if group == 1, interval(30)
Display the life table for group 1 using the specified intervals
. ltable t died if group == 1, interval(120,180,210,240,330)
Display separate life tables for each group and aggregate into 30-day
intervals
. ltable t died, by(group) interval(30)
Display a failure table for group 1 aggregated into 30-day intervals
. ltable t died if group == 1, interval(30) failure
---------------------------------------------------------------------------
Setup
. webuse selvin
List some of the data
. list in 1/5
Obtain survival rates, and show both table and graph
. ltable t died [freq=pop], graph
---------------------------------------------------------------------------
Setup
. webuse tumor
List some of the data
. list in 1/6, sep(0)
Display the hazard table
. ltable t d [freq=pop], hazard interval(0(1)9)
---------------------------------------------------------------------------
Also see
Manual: [ST] ltable
Help: [ST] stcox