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: survival analysis : computation of rate with spell data
From
[email protected]
To
[email protected]
Subject
st: survival analysis : computation of rate with spell data
Date
Sat, 13 Jul 2013 16:17:48 +0200 (CEST)
Hello !
How I can compute the unemployment rate with spell data ?
I'm using Stata 12 for linux.
Here are my data (spells) :
id | Unemployment | begin | end | duration (=end-begin+1)
1 0 0 15 16
1 1 16 80 65
1 0 81 132 52
2 1 0 25 26
2 0 26 132 107
The end time is 132 (11 years x 12 months).
What I want is something like that :
id | Unemployment | begin | end | duration | Unemployment rate
1 0 0 15 16 0,5 (because between 0 and 15 the second individual is unemployed)
1 1 16 80 65 0,57 = [1*(25-16+1) + 0,5*(80-26+1)]/65
1 0 81 132 52 0 (because between 81 and 132 nobody is unemployed)
2 1 0 25 26 0,69 (= [50%*(15+1) + 100%*(25-16+1)]/26
2 0 26 132 107 0,25 (= [0,5*(80-26+1) + 0*(132-80+1)]/107)
The first solution I see is reshaping into time data (with one observation for each month), but I have too much variables, so that my computer cannot reshape.
And I don't see a second solution :p
Do you know how I can compute this ? Is there an function with stata ?
Thanks a lot !
Pierre
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/