Hi all,
I am not sure if a solution is possible, but any help would be appreciated. I am not working with a traditional event-history data file; instead I have a person-year data set (which looks like a typical panel). A key question asks respondents when they started working in their current job, this is answered every year. Another key question asks respondents if they experienced a change in job over the last year. A sample of the data's current shape is listed below. The variable "idind", is a person specific ID. The variable "intyer" is the interview year. "Round" is the survey round. "Start" is the year the respondent started in their current job. "Dur" is a generated variable that's trying to capture duration (start - intyer). Finally, "Newjob" is a variable which asks people if they changed their job in the last year (this is simplified using "event").
I am trying to set this data up for a discrete-time survival analysis, but I can't figure out how to transform the frame above into a person-period file. Is this even possible or am I wasting my time? It seems like all the ingredients are there, but for example the duration variable keeps increasing +1 if nothing changes.
Again, any help would be appreciated.
I am not sure if a solution is possible, but any help would be appreciated. I am not working with a traditional event-history data file; instead I have a person-year data set (which looks like a typical panel). A key question asks respondents when they started working in their current job, this is answered every year. Another key question asks respondents if they experienced a change in job over the last year. A sample of the data's current shape is listed below. The variable "idind", is a person specific ID. The variable "intyer" is the interview year. "Round" is the survey round. "Start" is the year the respondent started in their current job. "Dur" is a generated variable that's trying to capture duration (start - intyer). Finally, "Newjob" is a variable which asks people if they changed their job in the last year (this is simplified using "event").
Code:
list idind intyer round start dur newjob event in 1/20, sepby(idind)
+----------------------------------------------------------+
| idind intyer round start_~r dur newjob event |
|----------------------------------------------------------|
1. | 1 2009 18 1998 11 1 0 |
2. | 1 2010 19 1998 12 1 0 |
3. | 1 2011 20 2011 0 4 1 |
4. | 1 2012 21 2011 1 1 0 |
5. | 1 2013 22 2011 2 1 0 |
6. | 1 2014 23 2011 3 1 0 |
|----------------------------------------------------------|
7. | 3 2009 18 2006 3 1 0 |
8. | 3 2011 20 2010 1 1 0 |
9. | 3 2012 21 2010 2 1 0 |
10. | 3 2013 22 2013 0 4 1 |
11. | 3 2014 23 2012 2 1 0 |
|----------------------------------------------------------|
12. | 5 2009 18 2008 1 1 0 |
13. | 5 2010 19 2008 2 1 0 |
14. | 5 2011 20 2008 3 1 0 |
15. | 5 2012 21 2012 0 3 1 |
16. | 5 2013 22 2011 2 1 0 |
17. | 5 2014 23 2012 2 1 0 |
|----------------------------------------------------------|
18. | 27 2011 20 2010 1 1 0 |
|----------------------------------------------------------|
19. | 28 2009 18 2003 6 1 0 |
20. | 28 2010 19 2004 6 1 0 |
+----------------------------------------------------------+
.
Again, any help would be appreciated.

Comment