Statalist The Stata Listserver


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

RE: st: Spells creation


From   n j cox <[email protected]>
To   [email protected]
Subject   RE: st: Spells creation
Date   Thu, 23 Mar 2006 18:11:57 +0000

Your criteria are quite complicated.

But you should check out -tsspell- from SSC. The code will
look something like

tsset pid month
tsspell, fcond((L.month == . & empl == 1) | jobchange == 1 |
n_empl != L.n.empl)

but I think your missing values could prove problematic.

Nick
[email protected]

Anna Manzoni wrote (three times)

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
*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index