Statalist


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

st: survival analyses/event history analysis: stsplit calendar year


From   "[ISO-8859-1] Ola Sj÷berg" <ola.sjoberg@sofi.su.se>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: survival analyses/event history analysis: stsplit calendar year
Date   Mon, 25 Feb 2008 12:09:53 +0100

Dear all,

I have a dataset with entry- and exit-month into different labour market 
statuses (n=2500; episodes=10500), where entry- and exit-month is 
measured as calendar months (0=January 1900). Now, I would like split 
this dataset according to calendar year (I have 30 years), i.e. episodes 
that stretches over two or more calendar years should be be split and 
all information (i.e. other independent variables) about this episode 
should be duplicated. To split according to the duration of episodes 
seems easy, I have trouble to split according to calendar year.

So, this is what I have

ID    start   end   X1
1      1        11    2
2      13      37    3

And this is what I would like to have

ID    start   end     year     X1
1      1       11        1         2
2      13     24        2         3
2      25    36         3         3
2      37    37         4         3

I hope anyone can help me to to this in an efficient way.

Thanks

Ola

-- 
Ola Sj÷berg, Associate Professor of Sociology

Swedish Institute for Social Research
Stockholm University
106 91 Stockholm
Sweden
Tel.: +46 8 162150
Fax: +46 8 154670
Home page: http://www.sofi.su.se/~osj/






*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index