📄 stsplit.hlp
字号:
{smcl}
{* 18mar2005}{...}
{cmd:help stsplit}, {cmd:help stjoin}{right:dialogs: {bf:{dialog stsplit}} {bf:{dialog stjoin}}}
{hline}
{title:Title}
{p2colset 5 21 23 2}{...}
{p2col :{hi:[ST] stsplit} {hline 2}}Split and join time-span records{p_end}
{p2colreset}{...}
{title:Syntax}
{phang}
Split at designated times
{p 8 16 2}{cmd:stsplit} {newvar} {it:{help if}},
{c -(}{cmd:at(}{it:numlist}{cmd:)} | {opt ev:ery(#)} {c )-}
[{it:{help stsplit##stsplitDT_options:stsplitDT_options}}]
{phang}
Split at failure times
{p 8 16 2}{cmd:stsplit} {it:{help if}}, {cmd:at(}{opt f:ailures)}
[{it:{help stsplit##stsplitFT_options:stsplitFT_options}}]
{phang}
Join episodes
{p 8 15 2}{cmd:stjoin} [{cmd:,} {opt c:ensored(numlist)}]
{synoptset 15 tabbed}{...}
{marker stsplitDT_options}{...}
{synopthdr :stsplitDT_options}
{synoptline}
{syntab :Main}
{p2coldent :* {opt at(numlist)}}split records at specified analysis times{p_end}
{p2coldent :* {opt ev:ery(#)}}split records when analysis time is a multiple of {it:#}{p_end}
{synopt :{opt af:ter(spec)}}use time since {it:spec} for {opt at()} or {opt every()} rather than time since onset of risk{p_end}
{synopt :{opt trim}}exclude observations outside of range{p_end}
{p2coldent :+ {opt nopre:serve}}do not save original data; programmer's option{p_end}
{synoptline}
{p2colreset}{...}
{pstd}
* Either {opt at(numlist)} or {opt every(#)} is required with {cmd:stsplit} at designated times.
{synoptset 20 tabbed}{...}
{marker stsplitFT_options}{...}
{synopthdr :stsplitFT_options}
{synoptline}
{syntab :Main}
{p2coldent :* {cmd:at(}{cmdab:f:ailures)}}split at observed failure times{p_end}
{synopt :{opth st:rata(varlist)}}restrict splitting to failures within stratum defined by {it:varlist}{p_end}
{synopt :{opth r:iskset(newvar)}}create a risk-set ID variable named {it:newvar}{p_end}
{p2coldent :+ {opt nopre:serve}}do not save original data; programmer's option{p_end}
{synoptline}
{p2colreset}{...}
{pstd}
* {cmd:at(failures)} is required with {cmd:stsplit} at failure times.
{p 4 6 2}
+ {opt nopreserve} is not shown in the dialog box.{p_end}
{p 4 6 2}
You must {cmd:stset} your dataset using the {opt id()} option before using
{cmd:stsplit} or {cmd:stjoin}; see {helpb stset}.
{title:Description}
{pstd}
{cmd:stsplit} with option {opt at(numlist)} or {opt every(#)} splits episodes
into two or more episodes at the implied time points since being at risk or
after a time point specified by {opt after()}. Each resulting record contains
the follow-up on one subject through one time band. Expansion on multiple
time scales may be obtained by repeatedly using {cmd:stsplit}. {newvar}
specifies the name of the variable to be created containing the observation's
category. The new variable records the time interval to which each new
observation belongs and it is bottom coded.
{pstd}
{cmd:stsplit, at(failures)} performs episode splitting at the failure times
(per stratum).
{pstd}
{cmd:stjoin} performs the reverse operation, namely, joining episodes back
together when that can be done without losing information.
{title:Options for stsplit}
{dlgtab:Main}
{phang}
{opth at(numlist)} or {opt every(#)} is required in syntax one;
{cmd:at(failures)} is required for syntax two. These options specify the
analysis times at which the records are to be split.
{pmore}
{cmd:at(5(5)20)} splits records at t=5, t=10, t=15, and t=20.
{pmore}
If {cmd:at(}[{it:...}]{cmd:max)} is specified, {opt max} is replaced by
a suitably large value.
{pmore}
{opt every(#)} is a shorthand for {cmd:at(}{it:#}{cmd:(}{it:#}{cmd:)max)};
i.e., episodes are split at each positive multiple of {it:#}.
{phang}
{opt after(spec)} specifies the reference time for {opt at()} or
{opt every()}. Syntax one can be thought of as corresponding to
{opt after(}{it:time of onset of risk}{cmd:)}, although you cannot really type
this. You could type, however, {cmd:after(time=birthdate)} or
{cmd:after(time=marrydate)}.
{pmore}
{it:spec} has syntax
{p 12 20 2}{c -(}{cmd:time} | {cmd:t} | {cmd:_t}{c )-} {cmd:=}
{c -(}{it:exp} | {opt asis(exp)} | {opt min(exp)}{c )-}
where
{pmore}
{opt time} specifies that the expression be evaluated in the same
time units as {it:timevar} in {cmd:stset} {it:timevar}{cmd:,} {it:...}. This
is the default.
{pmore}
{opt t} and {opt _t} specify that the expression be evaluated in
units of analysis time. {opt t} and {opt _t} are synonyms; it makes no
difference whether you specify one or the other.
{pmore}
{it:exp} specifies the reference time. In case of multi-episode data,
{it:exp} should be constant within subject ID.
{pmore}
{opt min(exp)} specifies that in the case of multi-episode data, the minimum
of {it:exp} be taken within ID.
{pmore}
{opt asis(exp)} specifies that in the case of multi-episode data, {it:exp} be
allowed to vary within id.
{phang}
{cmd:trim} specifies that observations with values less than the minimum or
greater than the maximum value listed in {opt at()} be excluded from
subsequent analysis. Such observations are not dropped from the data;
{opt trim} merely sets their value of variable {hi:_st} to 0 so they will not
be used, yet they can still be retrieved the next time the dataset is
{cmd:stset}.
{phang}
{opth strata(varlist)} specifies up to five strata variables. Observations
with equal values of the variables are assumed to be in the same stratum.
{opt strata()} restricts episode splitting to failures that occur within the
stratum, and memory requirements are reduced when strata are specified.
{phang}
{opth riskset(newvar)} specifies the name for a new variable recording the
unique risk set in which an episode occurs, and missing otherwise.
{pstd}
The following option is available with {cmd:stsplit} but is not shown in the
dialog box:
{phang}
{opt nopreserve} is intended for use by programmers. It speeds the
transformation by not saving the original data, which can be restored should
things go wrong or if you press {hi:Break}. Programmers often specify this
option when they have already preserved the original data. {opt nopreserve}
does not affect the transformation.
{title:Option for stjoin}
{phang}
{opt censored(numlist)} specifies values of the failure variable,
{it:failvar}, from {cmd:stset} {it:...}{cmd:, failure(}{it:failvar}
{it:...}{cmd:)} {it:...} that indicate "no event" (censoring).
{pmore}
If you are using {cmd:stjoin} to rejoin records after {cmd:stsplit},
you do not need to specify {opt censored()}. Just do not forget to drop the
variable created by {cmd:stsplit} before typing {cmd:stjoin}.
{pmore}
Neither do you need to specify {opt censored()} if, when you {cmd:stset} your
dataset, you specified {opt failure(failvar)} and not
{cmd:failure(}{it:failvar=}{it:...}{cmd:)}. In that case, {cmd:stjoin} knows
that {it:failvar} = 0 and {it:failvar} = . (missing) correspond to no event.
Two records can be joined if they are contiguous and record the same data and
the first record has {it:failvar} = 0 or {it:failvar} = ., meaning no event at
that time.
{pmore}
You may need to specify {opt censored()}, and you probably do if, when
you {cmd:stset} the dataset, you specified
{cmd:failure(}{it:failvar=}{it:...}{cmd:)}. If {cmd:stjoin} is to join
records, it needs to know what events do not count and can be discarded. If
the only such event is {it:failvar} = ., then you do not need to specify
{opt censored()}.
{title:Examples}
{phang}{cmd:. stsplit cat, at(2 4 6 8)}{p_end}
{phang}{cmd:. stsplit cat, every(2)}{p_end}
{phang}{cmd:. stsplit acat, at(30 32 34) after(time = yrborn)}
{phang}{cmd:. stsplit acat, at(20(5)50) after(t = min(yr1-age))}
{phang}{cmd:. stsplit, at(failures)}{p_end}
{phang}{cmd:. stsplit, at(failures) strata(sex) riskset(rset)}
{phang}{cmd:. stjoin}{p_end}
{phang}{cmd:. stjoin, censored(0)}{p_end}
{phang}{cmd:. stjoin, censored(110 123)}
{title:Also see}
{psee}
Manual: {bf:[ST] stsplit}
{psee}
Online: {help st}, {helpb stset}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -