| From | David Kantor <[email protected]> |
| To | [email protected] |
| Subject | Re: st: construct new id variable |
| Date | Wed, 10 Sep 2003 17:30:04 -0400 |
at 04:49 PM 9/10/2003 -0400, Oleksandr. wrote:
Dear statalist users,
I have a survey data with following variables:
familyid personid inwork
001 01 0
001 02 1
001 03 0
001 04 1
002 01 1
002 02 0
Inwork is indicator of labor force partisipation. I want to create
variable "inworkid" that will be 0 if inwork=0 and will give numbers 1, 2,3
etc otherwise. In my example:
familyid personid inwork inworkid
001 01 0 0
001 02 1 1
001 03 0 0
001 04 1 2
002 01 1 1
002 02 0 0
How can this be done?
There are many ways to do this. Here's one.| © Copyright 1996–2025 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |