Hi Statalist community,
I am trying to calculate gaps between employment for young adults. Since young adults are just starting to enter the workforce, they may have irregular work histories or may juggle multiple jobs at the same time. I am trying calculate the number days between employment. You could also see it as the numbers of days of being unemployed between jobs. I have sample data for the period from January 1st, 2011 to December 31st, 2013.
Below is my attempt at finding the gaps between employment.
I am trying to calculate gaps between employment for young adults. Since young adults are just starting to enter the workforce, they may have irregular work histories or may juggle multiple jobs at the same time. I am trying calculate the number days between employment. You could also see it as the numbers of days of being unemployed between jobs. I have sample data for the period from January 1st, 2011 to December 31st, 2013.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte id float( start_date end_date) 1 18628 19723 1 18628 19723 2 19034 19600 3 18628 19723 4 18628 19175 4 19176 19723 5 18861 18971 5 19015 19132 5 19225 19335 5 19386 19503 5 19596 19706 6 18868 18979 6 19262 19343 6 19232 19357 end format %td start_date format %td end_date
Code:
*Drop entries where someone had multiple jobs that had the same start and end date. duplicates drop id start_date end_date, force *Calculate gap between employment by subtracting the start date of a new job with the end date of the most recent job bys id (start_date): gen gap_between_employment = start_date[_n+1] - end_date-1
- Individual 1 had 2 jobs and was continuously employed and did not have any gaps between employment.
- Individual 2 had 1 job during this period and was not reemployed; thus he also didn't have a gap since he did not find another job within this period. He would be considered right censored.
- Individual 3 had 1 job and was continuous employed during this period. He had no gaps between employment.
- Individual 4 had 2 jobs was continuous employed and did not have any gaps between employment
- Individual 5 had 5 jobs and had several gaps between employment. The largest gap between employment was 92.
- Individual 6 had 3 jobs and some overlapping dates
Comment