* Example generated by -dataex-. For more info, type help dataex
clear
input int pubid long job_id float(quitlookjob quittakejob) str5 start_stop float date
1 9701 1 . "start" 450
1 9701 1 . "stop" 470
1 199902 . . "start" 470
1 200102 . . "start" 492
1 200102 . . "stop" 509
1 199902 . . "stop" 511
1 200103 . 1 "start" 517
1 200702 0 0 "start" 562
1 200103 . 1 "stop" 564
1 200702 0 0 "stop" 672
2 200001 . . "start" 480
2 200001 . . "stop" 485
2 200002 . . "start" 486
2 200102 0 0 "start" 501
2 200102 0 0 "stop" 502
2 200002 . . "stop" 511
2 200202 . . "start" 513
2 200202 . . "stop" 514
2 200301 . 1 "start" 517
2 200301 . 1 "stop" 529
2 200402 . . "start" 529
2 200402 . . "stop" 563
2 200802 0 0 "start" 570
2 200802 0 0 "stop" 718
end
format %tm date
label values pubid vlR0000100
For each individual, I have a timeline of their jobs.
I want to compute job gaps for individuals who have stopped jobs to look for jobs or to take jobs separately. My goal is that for each job with quitlook==1 & start=="stop", I compute the distance between the date and the closest start date after it for each individual (pubid). In some cases (not shown here), it seems that the individual started a job prior to quitting their given job and in those cases, I will belonging for the closest start date that belongs to a different job (marked by job_id) before it.
clear
input int pubid long job_id float(quitlookjob quittakejob) str5 start_stop float date
1 9701 1 . "start" 450
1 9701 1 . "stop" 470
1 199902 . . "start" 470
1 200102 . . "start" 492
1 200102 . . "stop" 509
1 199902 . . "stop" 511
1 200103 . 1 "start" 517
1 200702 0 0 "start" 562
1 200103 . 1 "stop" 564
1 200702 0 0 "stop" 672
2 200001 . . "start" 480
2 200001 . . "stop" 485
2 200002 . . "start" 486
2 200102 0 0 "start" 501
2 200102 0 0 "stop" 502
2 200002 . . "stop" 511
2 200202 . . "start" 513
2 200202 . . "stop" 514
2 200301 . 1 "start" 517
2 200301 . 1 "stop" 529
2 200402 . . "start" 529
2 200402 . . "stop" 563
2 200802 0 0 "start" 570
2 200802 0 0 "stop" 718
end
format %tm date
label values pubid vlR0000100
For each individual, I have a timeline of their jobs.
I want to compute job gaps for individuals who have stopped jobs to look for jobs or to take jobs separately. My goal is that for each job with quitlook==1 & start=="stop", I compute the distance between the date and the closest start date after it for each individual (pubid). In some cases (not shown here), it seems that the individual started a job prior to quitting their given job and in those cases, I will belonging for the closest start date that belongs to a different job (marked by job_id) before it.
