Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Creating household id for groups of persons


From   "Hans Meier" <[email protected]>
To   [email protected]
Subject   st: Creating household id for groups of persons
Date   Wed, 6 Jul 2011 09:23:41 +0200 (CEST)

Dear all,

I'm trying to create an id-variable for groups of persons.

My data looks like this:


contract |    id
___________
123        |   1
123        |   2
123        |   3
456        |   4
456        |   5
678        |   1

There are different insurance-contracts, and many people (id's) can be part of one contract.

Now I need a household id, which groups the people who have contracts together, like this:


contract |    id       |  household_id
___________________________
123        |   1        |   1   
123        |   2        |   1   
123        |   3        |   1   
456        |   4        |   2   
456        |   5        |   2   
678        |   1        |   1   

The problem is, as you can see in my example, that its's not always the same people having contracts together, like id "1" has the contract "678" alone, but he belongs to household_id "1".

How can I create this household id?

Thank you for your help in advance,

H. Meier
email: [email protected]






___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index