📄 ltable.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help ltable} {right:dialog: {bf:{dialog ltable}}}
{hline}
{title:Title}
{p2colset 5 20 22 2}{...}
{p2col :{hi:[ST] ltable} {hline 2}}Life tables for survival data{p_end}
{p2colreset}{...}
{title:Syntax}
{p 8 15 2}
{cmd:ltable} {it:timevar} [{it:deadvar}] {ifin} {weight} [{cmd:,} {it:options}]
{synoptset 29 tabbed}
{synopthdr}
{synoptline}
{syntab:Main}
{synopt :{opt nota:ble}}display graph only; suppress display of table{p_end}
{synopt :{opt g:raph}}present the table graphically as well as in tabular form{p_end}
{synopt :{opth "by(varname:groupvar)"}}separate tables (or graphs) for each value of {it:groupvar}{p_end}
{synopt :{opt t:est}}report chi-squared measure of differences between groups (2 tests){p_end}
{synopt :{opt overlay}}overlay plots on the same graph{p_end}
{synopt :{opt su:rvival}}display survival table; the default{p_end}
{synopt :{opt f:ailure}}display cumulative failure table{p_end}
{synopt :{opt h:azard}}display hazard table{p_end}
{synopt :{opt noconf}}suppress graphing confidence interval{p_end}
{synopt :{opt l:evel(#)}}set confidence level; default is {cmd:level(95)}{p_end}
{synopt :{opt noa:djust}}suppress actuarial adjustment for deaths and censored observations{p_end}
{synopt :{opth tv:id(varname)}}subject ID variable to use with time-varying parameters{p_end}
{synopt :{cmdab:i:ntervals:(}{cmd:w}|{it:numlist}{cmd:)}}time intervals in which data are to be aggregated for tables{p_end}
{synopt :{cmdab:sav:ing:(}{it:filename}[{cmd:,} {cmd:replace}]{cmd:)}}save the life-table data to {it:filename}; use {opt replace} to overwrite existing {it:filename}{p_end}
{syntab:Plot}
{synopt :{it:{help marker_options}}}change look of markers (color, size, etc.){p_end}
{synopt :{it:{help marker_label_options}}}add marker labels; change look or position{p_end}
{synopt :{it:{help cline_options}}}affect rendition of the plotted points{p_end}
{syntab:CI plot}
{synopt :{opth ciop:ts(line_options)}}affect the rendition of the confidence intervals{p_end}
{syntab:Add plot}
{synopt :{opth "addplot(addplot_option:plot)"}}add other plots to the generated graph{p_end}
{syntab:Y-Axis, X-Axis, Title, Caption, Legend, Overall}
{synopt :{it:{help twoway_options}}}any options other than {opt by()} documented in {bind:{bf:[G] {it:twoway_options}}}{p_end}
{synoptline}
{p2colreset}
{pstd}{opt fweight}s are allowed; see {help weight}.
{title:Description}
{pstd}
{cmd: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. {cmd:ltable} also allows examining the empirical
hazard function through aggregation. See also {helpb sts} for alternative
commands.
{pstd}
{it:timevar} specifies the time of failure or censoring. If {it:deadvar}
is not specified, all values of {it:timevar} are interpreted as failure times;
otherwise, {it:timevar} is interpreted as a failure time where
{it:deadvar}!=0, and as a censoring time otherwise. Observations with
{it:timevar} or {it:deadvar}==. are ignored.
{pstd}
Note that {it:deadvar} does NOT specify the {it:number} of failures.
An observation with {it:deadvar} equal to 1 or 50 has the same
interpretation{hline 2}the observation records one failure. Specify frequency
weights for aggregated data (e.g., "{cmd:ltable time [freq=number]}").
{title:Options}
{dlgtab:Main}
{phang}
{opt notable} suppresses displaying the table. This option is often used
with {opt graph}.
{phang}
{opt graph} requests that the table be presented graphically, as well as
in tabular form; when {opt notable} is also specified, only the graph is
presented. When you specify {opt graph}, only one table can be
calculated and graphed at a time; see {opt survival}, {opt failure}, and
{opt hazard} below.
{pmore}
{opt graph} may not be specified with {opt hazard}. Use {cmd:sts graph} to
graph estimates of the hazard function.
{phang}
{opth "by(varname:groupvar)"} creates separate tables (or graphs within the
same image) for each value of {it:groupvar}. {it:groupvar} may be string or
numeric.
{phang}
{opt test} presents two chi-squared measures of the differences between
groups, the likelihood-ration test of homogeneity, and the log-rank test for
equality of survivor functions. The two groups are identified by the
{opt by()} option, so {opt by()} must also be specified.
{phang}
{opt overlay} causes the plot from each group identified in the {opt 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 {opt by()} option.
{phang}
{opt survival}, {opt failure}, and {opt hazard} indicate the table
to be displayed. If none is specified specified, the default is the survival
table. Specifying {opt failure} displays the cumulative failure table.
Specifying {opt survival failure} would display both the survival and the
cumulative failure table. If {opt graph} is specified, multiple tables
may not be requested.
{phang}
{opt noconf} suppresses graphing the confidence intervals around
{opt survival}, {opt failure}, or {opt hazard}.
{phang}
{opt level(#)} specifies the confidence level, as a percentage,
for confidence intervals. The default is {cmd:level(95)} or as set by
{cmd:set level}; see {help level}.
{phang}
{opt 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_start - dead_or_censored/2). If
{opt noadjust} is specified, the number at risk is simply the total at the
start, corresponding to the standard Kaplan-Meier assumption. {opt noadjust}
should be specified when using {cmd:ltable} to list results corresponding to
those produced by {cmd:sts list} (see {helpb sts list}).
{phang}
{opt 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 {it:varname} identify observations referring to the same subject. When
{opt 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 {it:last}
here means the last observation chronologically.
{phang}
{cmd:intervals(}{cmd:w}|{it:numlist}{cmd:)} specifies the time intervals into
which the data are to be aggregated for tabular presentation. A single numeric
argument is interpreted as the width of the interval. For instance,
{cmd:interval(2)} aggregates data into the time intervals 0<=t<2, 2<=t<4, and
so on. Not specifying {opt interval()} is equivalent to specifying
{cmd:interval(1)}. Since 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 {opt noadjust}
option below). Also see {helpb 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.
{pmore}
When more than one argument is specified, time intervals are aggregated
as specified. For instance, {cmd:interval(0,2,8,16)} aggregates data into the
intervals [0,2), [2,8), [8,16), and (if necessary) [16, infinity).
{pmore}
{cmd:interval(w)} is equivalent to
{cmd:interval(0,7,15,30,60,90,180,360,540,720)}, corresponding to one week,
(roughly) two weeks, one month, two months, three months, six months, 1 year,
1.5 years, and 2 years when failure times are recorded in days. The {opt w}
suggests widening intervals.
{phang}
{cmd:saving(}{it:filename}[{cmd:,} {cmd:replace}]{cmd:)} creates a Stata data
file ({opt .dta} file) containing the life table. This option will not save
the graph to disk; see {helpb graph_save} to save the resulting graph to
disk.
{pmore}
{cmd:replace} indicates that {it:filename} be overwritten, if it exists. This
option is not shown in the dialog box.
{dlgtab:Plot}
{phang}
{it:marker_options} affect the rendition of markers drawn at the plotted
points, including their shape, size, color, and outline; see
{it:{help marker_options}}.
{phang}
{it:marker_label_options} specify if and how the markers are
to be labeled; see {it:{help marker_label_options}}.
{phang}
{it:cline_options} affect whether lines connect the plotted points and the
rendition of those lines; see {it:{help cline_options}}.
{phang}
When {opt overlay} is specified, the options controlling the rendition or
markers, marker labels, and connecting lines accept lists of styles (one for
each connected line); see {it:{help marker_options}},
{it:{help marker_label_options}}, {it:{help connect_options}}. Only the first
connected line can be changed from the dialog box.
{dlgtab:CI plot}
{phang}
{opt ciopts(line_options)} affect the rendition of the confidence
intervals for the graphed survival, failure, or hazard. See
{it:{help line_options}}. Note that the {opt recast()} suboption may be used
to display the confidence interval as a different plottype; see
{it:{help advanced_options}}.
{dlgtab:Add plot}
{phang}
{opt addplot(plot)} provides a way to add other plots to the generated graph;
see {it:{help addplot_option}}.
{dlgtab:Y-Axis, X-Axis, Title, Caption, Legend, Overall}
{phang}
{it:twoway_options} and are any of the options documented in
{it:{help twoway_options}}, excluding {opt by()}. These include options for
titling the graph (see {it:{help title_options}}) and options for saving the
graph to disk (see {it:{help saving_option}}).
{title:Examples}
{phang}{cmd:. ltable studytim died}{p_end}
{phang}{cmd:. ltable studytim died, by(drug)}{p_end}
{phang}{cmd:. ltable studytim died, by(drug) failure}{p_end}
{phang}{cmd:. ltable studytim died, graph}{p_end}
{phang}{cmd:. ltable studytim died, by(drug) failure graph}{p_end}
{phang}{cmd:. ltable studytim died, by(drug) test}
{title:Also see}
Manual: {hi:[ST] ltable}
{psee}
Online: {help st}, {helpb stcox}, {helpb streg}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -