I have a panel data-set (unbalanced) in which individuals are observed for up to 4 years. For my analysis, I only want to keep those observations when the respondents were working. For this reason I want to drop those respondents who have non-consecutive appearances in the data.
For example, if respondent x was working in period 1 and 3 but was unemployed in periods 2 and 4 I want a code that will drop all observations from this respondent altogether. On the other hand, I want to keep any respondent who has at least 2 consecutive observations when he/she was working. For example, if a respondent y was working in periods 1 and 2 but then he/she was unemployed in period 3 and 4 I want to keep him/her in the data.
Thanks in advance
For example, if respondent x was working in period 1 and 3 but was unemployed in periods 2 and 4 I want a code that will drop all observations from this respondent altogether. On the other hand, I want to keep any respondent who has at least 2 consecutive observations when he/she was working. For example, if a respondent y was working in periods 1 and 2 but then he/she was unemployed in period 3 and 4 I want to keep him/her in the data.
Thanks in advance
Comment