Hi. I am currently working with longitudinal data I have converted to panel data and I now need some help getting to the final sample.
So the respondents must have worked for at least ten years.
What my datasets contains is different cohorts. So HACOHORT describes which cohort the respondents belong to (2,3,4,5).
I need for the different cohorts to keep the respondents who is not retired when entering the survey. That is when Retirement==0. Furthermore a respondent is considered not retired if Retirement==2 together with Weekly_Hours>20
So first question is. In each cohort (HACOHORT[2,3,4,5]) how do I keep both the respondents which have Retirement==0 and the ones with Retirement==2 together with Weekly_Hours>20
Next question is more tricky I think. If a respondent enters not retired from the criterias above and then becomes retired (either by Retirement==2 together with Weeklyhours<20, or Retirement==1), and then enters the labor force (becoming not retired) again I want to exclude these individuals. So changing from not retired, to retired and back to nor retired over the time period which In this example is "Waves" which go from 1-10 where there is two years in between.
In the dataex I have attached the only command I have done is to drop for missing observation on "Retirement". I hop the question make sense, if not please say so and I will try to elaborate.
Thank you very much
Related Posts with Sorting panel data with numerous conditions
xtreg gives coefficients for outcome variablesHey dear Stata-Users! I have a question regarding xtreg: I run a regression model with different de…
How to show the first step of ivpoisson estimation?Greetings all, I wonder if it is possible to get the estimation of the first step conducted by the …
Counting with _nHello Statalist, Question here about counting with _n in large datasets. I am attempting to create …
New program -twostep- available on SSCCourtesy of Kit Baum, the new package -twostep- by Johannes Giesecke and myself is available on SSC.…
Help on choosing the right regressionHello! I am a real beginner with Stata and would like to know if I am doing the right things, I am …
Subscribe to:
Post Comments (Atom)
0 Response to Sorting panel data with numerous conditions
Post a Comment