I am using in Stata 13 a panel dataset that contains several education- and labour-related spells for each individual. For instance, study periods, working periods, inactivity periods, etc. Every spell can be chronologically delimited by a start month ('mes_inicio') and year ('y6_ylhcs_begdaty') and by an end month ('mes_fin') and year ('y6_ylhcs_enddaty'). Each spell appears in the dataset as a different row of data, so that there are as many rows for a given individual as spells are registered for that individual. During some of these spells (namely, the education-related ones), individuals may achieve an educational diploma ('diploma_ola6) that qualifies them for enrolling in certain educational institutions or, alternatively, to go into the labour market or just go into inactivity. I am interested in studying the post-diploma transitions. That is, what people do after getting the diploma. The problem that I have and the one I request your help for is that I don't know how to identify only those spells that come immediately after the spell during which individuals got the educational diploma. This is important because I would like, for instance, to create a frequency table that shows the educational or labour destinations or to model the chances of making the transition to any of these destinations ignoring the spells that come before getting the aforementioned educational diploma.
Find below an example of my dataset to try to understand its structure and my problem. For example, for 'indivdual 3', I want to identify the spell that comes immediately after the spell when s/he gets the Abitur diploma (diploma_ola6=1), which happens to be 'other activities' (y6_ylhcs_spt1=3).
`
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input long youthid byte y6_ylhcs_spt1 float mes_inicio int y6_ylhcs_begdaty float mes_fin int y6_ylhcs_enddaty float diploma_ola6 individual 1 1 9 2010 7 2012 . individual 1 1 8 2012 8 2015 3 individual 1 2 8 2015 9 2015 . individual 1 1 9 2015 2 2016 . individual 2 1 1.5 2009 6.5 2012 . individual 2 1 6.5 2012 6.5 2014 2 individual 2 2 6.5 2014 6.5 2015 . individual 2 2 6.5 2015 3 2016 . individual 3 1 6.5 2006 6.5 2012 . individual 3 1 6.5 2012 3 2015 1 individual 3 3 4 2015 6 2015 . individual 3 2 7 2015 3 2016 . individual 3 1 10 2015 4 2016 . individual 4 1 7 2006 7 2011 . individual 4 1 8 2011 6 2013 2 individual 4 3 7 2013 8 2013 . individual 4 1 9 2013 4 2016 . end label values youthid youthid label values y6_ylhcs_spt1 y6_ylhcs_spt1 label def y6_ylhcs_spt1 1 "education", modify label def y6_ylhcs_spt1 2 "employment", modify label def y6_ylhcs_spt1 3 "other activities", modify label values mes_inicio y6_ylhcs_begdatm label def y6_ylhcs_begdatm 4 "april", modify label def y6_ylhcs_begdatm 7 "july", modify label def y6_ylhcs_begdatm 8 "august", modify label def y6_ylhcs_begdatm 9 "september", modify label def y6_ylhcs_begdatm 10 "october", modify label values y6_ylhcs_begdaty y6_ylhcs_begdaty label values mes_fin y6_ylhcs_enddatm label def y6_ylhcs_enddatm 2 "february", modify label def y6_ylhcs_enddatm 3 "march", modify label def y6_ylhcs_enddatm 4 "april", modify label def y6_ylhcs_enddatm 6 "june", modify label def y6_ylhcs_enddatm 7 "july", modify label def y6_ylhcs_enddatm 8 "august", modify label def y6_ylhcs_enddatm 9 "september", modify label values y6_ylhcs_enddaty y6_ylhcs_enddaty label values diploma_ola6 diploma_ola6 label def diploma_ola6 1 "Abitur", modify label def diploma_ola6 2 "Fachabitur", modify label def diploma_ola6 3 "Vocational degree", modify
0 Response to Identifying spells after a specific event in panel datasets.
Post a Comment