Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: understanding the -asis()- option in -stsplit-
From
"Jesper Lindhardsen" <[email protected]>
To
<[email protected]>
Subject
st: understanding the -asis()- option in -stsplit-
Date
Fri, 18 Nov 2011 10:50:13 +0100
Hi All,
This may be simple, but I am having a hard time with a futher split
(-stsplit-) of multiepisode survival data (Stata 11.2/MP on windows
server).
Basically I want to split some of the observations within an individual,
if exposed, into several new observations. However, this (I figure)
causes the offset (-after()- option) to vary within individuals, which
forces the use of the -asis()- option-. But I cannot figure out the
proper use, and the documentation on this option is scarse.
In the below very simplified example, I want to split the episodes with
changevar==1 to be further divided in two, however, this does not work
(only one of two episode is splitted).
I've tried several other stsplit commands, but no succes.
clear all
input time id changevar event
30 1 . 0
40 1 1 0
50 1 . 0
60 1 1 0
end
stset time, id(id) f(event)
stsplit hej if changevar==1,at(2) after(time=asis(_t0))
sort time
Hope you can help,
Jesper
Jesper Lindhardsen
MD, PhD candidate
Department of Cardiovascular Research
Copenhagen University Hospital, Gentofte
Denmark
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/