Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: episode splitting_event history analysis


From   "Simon Oertel" <[email protected]>
To   <[email protected]>
Subject   st: episode splitting_event history analysis
Date   Thu, 18 Oct 2007 10:22:52 +0200

Dear Stata users,
 
I am working on a event history analysis and struggling with some
problems. I would be really thankful for any suggestions.
 
My original dataset has simplified the following structure:
 
Case-Nr.  Birth     Death    Entry1    Exit1     Entry2    Exit2
1           0        100       0         90
2          10         80      10         60       10        70
3          30        150      30        120
 
I would like to analyse, if exits influence the mortality risk of a
subject. For answering this question, I do an episode splitting. I do
this, by defining a variable "Event" which has the value "1" if an exit
happened to a subject. The episodes were split by the command: 

"expand 2 if event"
 
As long as I have only one entry and exit-event, this works well for my
data and looks as follows:
 
Newid Birth Death Entry1 Exit1 event afterevent  ts  t1  dummydeath
1       0    100    0      90    1       0        0  90      0
1       0    100    0      90    1       1       90  100     1
3      30    150   30     120    1       0       30  120     0
3      30    150   30     120    1       1      120  150     1
4       0    100   30     100    0       0        0  100     1
 
The variable "ts" describes the start, "t1" the end of each episode.
"Afterevent" is a dummy which tells if an exit-event happened in the
episode and "dummydeath" in general tells if a subject died. (this is a
very simplified example) 
 
After that, I am able to stset the data:
"stset t1, failure(dummy_death=1) id(newid)"
 
and than analyse potential effects:
"streg afterevent, dist(weibull) nohr"
 
 
My question is: How can I split cases in which 2 and more exit-events
happened (like for example for Case-Nr.2)?  
 
Again, thank you for your answers.
Simon
 
 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index