Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Job spell sortid


From   "A. Manzoni" <a.manzoni@uvt.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Job spell sortid
Date   Thu, 23 Mar 2006 16:59:56 +0100

I have a file with the variables persnr, month, empl(dummy var for
employed/non employed), n_empl (indicating the order number of employment
spells)
jobchange(indicating the month in which there is a job to job change, which
is not recorded as employment spell, because an employment spell is defined
when there is a non employment spell in between two jobs, so in case one go
from a job to another job without going out of employment, I have only one
employment spell, but I want to have 2 job spells)

I want to create a n_job variable (see below), indicating the order number
of job spells. How can I do?



pid  month		empl  	n_empl	jobchange
n_job
1	1		1		1			.
1
1	2		1		1			.
1
1	3		1		1			1
2
1	4		1		1			.
2
1	5		1		1			.
2
1	6		1		1			.
2
1	7		1		1			1
3
1	8		1		1			.
3	
1	9		1		1			.
3
1	10		1		1			1
4
1	11		1		1			.
4
1	12		0		.			.
.	
1	13		0		.			.
.
1	14		1		2			.
5
1	15		1		2			.
5
1	16		1		2			1
6
1	17		1		2			.
6	 


Thanks,
Anna

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2020 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index