⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stset.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help stset}, {cmd:help streset}, {cmd:help st} {right:dialog:  {bf:{dialog stset}}}
{hline}

{title:Title}

{p2colset 5 19 21 2}{...}
{p2col :{hi:[ST] stset} {hline 2}}Declare data to be survival-time data{p_end}
{p2colreset}{...}


{title:Syntax}

{phang}Single-record-per-subject survival data

{p 8 16 2}
{cmd:stset} {it:timevar} [{it:{help if}}]  {weight} [{cmd:,} 
        {it:{help stset##single_options:single_options}}]

{p 8 16 2}
{cmd:streset} [{it:{help if}}]  {weight} [{cmd:,} 
        {it:{help stset##single_options:single_options}}]

{p 8 16 2}
{cmd:st} [{cmd:,} {opt noc:md} {opt not:able}]

{p 8 16 2}
{cmd:stset, clear}


{phang}Multiple-record-per-subject survival data

{p 8 16 2}
{cmd:stset} {it:timevar} [{it:{help if}}]  {weight} [{cmd:,} {opth id(varname)}
        {cmdab:f:ailure(}{it:failvar}[{cmd:==}{it:numlist}]{cmd:)} 
        {it:{help stset##multiple_options:multiple_options}}]

{p 8 16 2}
{cmd:streset} [{it:{help if}}]  {weight} [{cmd:,} 
        {it:{help stset##multiple_options:multiple_options}}]

{p 8 16 2}
{cmd:streset,} {{opt p:ast}|{opt f:uture}|{opt p:ast}|{opt f:uture}} 

{p 8 16 2}
{cmd:st} [{cmd:,} {opt noc:md} {opt not:able}]

{p 8 16 2}
{cmd:stset, clear}


{synoptset 29 tabbed}{...}
{marker single_options}{...}
{synopthdr :single_options}
{synoptline}
{syntab :Main}
{synopt :{cmdab:f:ailure:(}{it:timevar}[{cmd:==}{it:numlist}]{cmd:)}}failure event{p_end}
{synopt :{opt nos:how}}prevent other st commands from showing st setting information{p_end}

{syntab :Options}
{synopt :{cmdab:o:rigin(}{cmdab:t:ime} {it:exp}{cmd:)}}define when a subject becomes at risk{p_end}
{synopt :{opt sc:ale(#)}}rescale time value{p_end}
{synopt :{cmdab:en:ter(}{cmdab:t:ime} {it:exp}{cmd:)}}specify when subject first enters study{p_end}
{synopt :{cmdab:ex:it(}{cmdab:t:ime} {it:exp}{cmd:)}}specify when subject exits study{p_end}

{syntab :Advanced}
{synopt :{opth if(exp)}}select records for which {it:exp} is true; recommended rather than if {it:exp}{p_end}
{synopt :{opth time0(varname)}}mechanical aspect of interpretation about records in dataset; seldom used{p_end}
{synoptline}
{p2colreset}{...}


{synoptset 29 tabbed}{...}
{marker multiple_options}{...}
{synopthdr :multiple_options}
{synoptline}
{syntab :Main}
{p2coldent :* {opth id(varname)}}multiple-record ID variable{p_end}
{p2coldent :* {cmdab:f:ailure:(}{it:timevar}[{cmd:==}{it:numlist}]{cmd:)}}failure event{p_end}
{synopt :{opt nos:how}}prevent other st commands from showing st setting information{p_end}

{syntab :Options}
{synopt :{cmdab:o:rigin(}[{varname}{cmd:==}{it:numlist} {opt t:ime} {it:exp}|{cmd:min)}}define when a subject becomes at risk{p_end}
{synopt :{opt sc:ale(#)}}rescale time value{p_end}
{synopt :{cmdab:en:ter(}[{varname}{cmd:==}{it:numlist}] {cmdab:t:ime} {it:exp}{cmd:)}}specify when subject first enters study{p_end}
{synopt :{cmdab:ex:it(failure}| [{varname}{cmd:==}{it:numlist}] {cmdab:t:ime} {it:exp}{cmd:)}}specify when subject exits study{p_end}

{syntab :Advanced}
{synopt :{opth if(exp)}}select records for which {it:exp} is true; recommended rather than if {it:exp}{p_end}
{synopt :{opth ever(exp)}}select objects for which {it:exp} is ever true{p_end}
{synopt :{opth never(exp)}}select objects for which {it:exp} is never true{p_end}
{synopt :{opth after(exp)}}select records within subject on or after the first time {it:exp} is true{p_end}
{synopt :{opth befor:e(exp)}}select records within subject before the first time {it:exp} is true{p_end}
{synopt :{opth time0(varname)}}mechanical aspect of interpretation about records in dataset; seldom used{p_end}
{synoptline}
{p2colreset}{...}
{phang}
* {opt id()} and {opt failure()} are required with {cmd:stset} multiple-record-per-subject survival data.

{phang}
{opt fweight}s, {opt iweight}s, and {opt pweight}s are allowed; see {help weight}.


{title:Description}

{pstd}
st refers to survival-time data, which are fully described below.

{pstd}
{cmd:stset} declares the data in memory to be survival-time (st) data,
informing Stata of key variables and their roles in a survival-time analysis.
When you {cmd:stset} your data, {cmd:stset} runs various data consistency
checks to ensure that what you have declared makes sense.  Note that if the
data are weighted, you specify the weights when you {cmd:stset} the data, not
when you issue the individual st commands.

{pstd}
{cmd:streset} changes how the st dataset is declared.  In multiple-record
data, {cmd:streset} can also temporarily set the sample to include records
from before the time at risk (called the past) and records after failure
(called the future).  In that case, typing {cmd:streset} without arguments
resets the sample back to the analysis sample.

{pstd}
{cmd:st} displays how the dataset is currently declared.

{pstd}
Whenever you type {cmd:stset} or {cmd:streset}, Stata runs or reruns data
consistency checks to ensure that what you are now declaring (or declared in
the past) makes sense.  Thus if you have made any changes to your data or
simply wish to verify how things are, you can type {cmd:streset} without any
options.

{pstd}
{cmd:stset, clear} is for use by programmers.  It causes Stata to forget the
st markers, making the data no longer st data to Stata.  The data remain
unchanged.  It is not necessary to {cmd:stset, clear} before doing another
{cmd:stset}.


{title:Options for use with stset and streset}

{phang}
{opt id(idvar)} specifies the subject-ID variable; observations with equal,
nonmissing values of {it:idvar} are assumed to be the subject.  {it:idvar} may
be string or numeric.  Observations for which {it:idvar} is missing 
(.  or "") are ignored.  

{pmore}
When {opt id()} is not specified, each observation is assumed to represent a
different subject and thus constitutes a single-record-per-subject survival
dataset.

{pmore}.
When you specify {opt id()}, the data are said to be multiple-record data, even if it turns out there is only one record per subject.  Perhaps they would better be called potentially multiple-record data.

{pmore}
If you specify {opt id()}, {cmd:stset} requires that you specify 
{opt failure()}.

{pmore}
Specifying {opt id()} never hurts; we recommend it because a few st commands,
such as {cmd:stsplit}, require an ID variable to have been specified when the
dataset was {cmd:stset}.

{phang}
{cmd:failure(}{it:failvar}[{cmd:==}{it:numlist}]{cmd:)} specifies the
failure event.  

{pmore}
If {opt failure()} is not specified, all records are assumed to end in
failure.  This is allowed with single-record data only.

{pmore}
If {opt failure(failvar)} is specified, {it:failvar} is interpreted as an
indicator variable; 0 and missing mean censored, and all other values are
interpreted as representing failure.

{pmore}
If {cmd:failure(}{it:failvar}{cmd:==}{it:numlist}{cmd:)} is specified, records
with {it:failvar} taking on any of the values in {it:numlist} are assumed to
end in failure, and all records are assumed to be censored.

{phang}
{cmd:noshow} prevents other commands from showing the key st variables at the
top of their output.


{dlgtab:Options}

{phang}
{cmd:origin(}[{varname}{cmd:==}{it:numlist}] {opt time} {it:exp} |
{cmd:min)} and {opt scale(#)} define analysis time, or said differently, 
{opt origin()} defines when a subject becomes at risk.  Subjects become at risk
when time = {opt origin()}.  All analyses are performed in terms of time since
becoming at risk, called analysis time.

{phang}
{cmd:enter(}[{varname}{cmd:==}{it:numlist}] {cmd:time} {it:exp}{cmd:)}
specifies when a subject first comes under observation, meaning that any
failures, were they to occur, would be recorded in the data.

{phang}
{cmd:exit(failure} | [{varname}{cmd:==}{it:numlist}] {cmd:time}
{it:exp}{cmd:)} specifies the latest time under which the subject is both
under observation and at risk.  The emphasis is on latest; obviously subjects
also exit the risk pook when their data run out.


{dlgtab:Advanced}

{phang}
{opt if(exp)}, {opt ever(exp)}, {opt never(exp)}, {opt after(exp)}, and {opt before(exp)} select relevant records.

{pmore}
{opt if(exp)} selects records for which {it:exp} is true.  We strongly
recommend specifying this {opt if()} option rather than {cmd:if} {it:exp}
following {cmd:stset} or {cmd:streset}.  They differ in that {cmd:if} {it:exp}
removes the data from consideration before calculating beginning and ending
times and other quantities.  The {opt if} option, on the other hand, sets the
restriction after all derived variables are calculated.

{pmore}
{opth ever(exp)} selects only subjects for which {it:exp} is ever true.

{pmore}
{opth never(exp)} selects only subjects for which {it:exp} is never true.

{pmore}
{opth after(exp)} selects records within subject on or after the first time
{it:exp} is true.

{pmore}
{opth before(exp)} selects records within subject before the first time
{it:exp} is true.

{phang}
{opth time0(varname)} is seldom specified because most datasets do not contain
this information.  {opt time0()} should be used exclusively with
multiple-record data, and even then you should consider whether {opt origin()}
or {opt enter()} would be more appropriate.

{pmore}
{opt time0()} specifies a mechanical aspect of interpretation about the
records in the dataset, namely the beginning of the period spanned by each
record.  This option should be restricted to multiple records per subject data
to indicate gaps.


{title:Options unique to streset}

{phang}
{opt past} expands the {cmd:stset} sample to include the entire recorded past
of the relevant subjects, meaning that it includes observations before
becoming at risk and those excluded due to {opt after()}, etc.

{phang}
{opt future} expands the {cmd:stset} sample to include records on the relevant
subjects after the last record that previously was included, if any, which
typically means to include all observations after failure or censoring.

{phang}
{opt past future} expands the {cmd:stset} sample to include all records on the
relevant subjects.

{pstd}
Typing {cmd:streset} without arguments resets the sample to the analysis
sample.


{title:Options for st}

{phang}
{opt nocmd} suppresses displaying the last {cmd:stset} command.

{phang}
{opt notable} suppresses displaying the table summarizing what has been
{cmd:stset}.


{title:Examples}

{phang}{cmd:. stset failtime}

{phang}{cmd:. stset failtime, failure(died)}

{phang}{cmd:. stset failtime, failure(code==2)}{p_end}
{phang}{cmd:. streset, fail(code==3)}

{phang}{cmd:. stset studytim, failure(relapse) origin(time enttime)}

{phang}{cmd:. stset followup, failure(icd9==411 412) exit(time .)}

{phang}{cmd:. stset time, failure(fail) exit(event==123)}

{phang}{cmd:. stset failtime, failure(outcome==2 99) id(patid)}{p_end}
{phang}{cmd:. streset, enter(outcome==1)}

{phang}{cmd:. streset, noshow}{p_end}
{phang}{cmd:. streset, show}{p_end}
{phang}{cmd:. streset, past}{p_end}
{phang}{cmd:. streset, future}{p_end}
{phang}{cmd:. streset, past future}


{title:Also see}

{psee}
Manual:  {bf:[ST] stset}

{psee}
Online:  {helpb snapspan}, {help st}, {helpb stdes}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -