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]

Re: st: Creating household id for groups of persons


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

Yes, now you got my question right.
I don't know who lives in in which household, and I also don't have further information about this.

But I assume, that if people have an insurance contract together, they are somehow connected and I define them as one household.
(I look only at non-life insurance, no pension funds etc.)

In my example, I define the persons from contract "123" (id's "1", "2", "3") as one household, let's say household A, and those in contract "456" (id's "4", "5") as another household B.
Now, in contract "678", the id "1" tells me that this is the same person who is also in the contract "123", so I want this contract to be put in household A.

To your question:
Unfortunately,  I have a very large dataset, so I can't tell if I have one contract in each household that covers all household members.
To err on the side of caution, I would rather assume I don't have such complete contracts.

Best regards
Hans Meier


-----Ursprüngliche Nachricht-----
Von: "Friedrich Huebler" <[email protected]>
Gesendet: 06.07.2011 14:28:20
An: [email protected]
Betreff: Re: st: Creating household id for groups of persons

>Hans,
>
>I think I misread your question. If I understand correctly, persons 1,
>2 and 3 live in one household and persons 4 and 5 live in another
>household.
>
>Do you have at least one contract in each household that covers all
>household members, as in your example contract 123 in the first
>household?
>
>Friedrich
>
>On Wed, Jul 6, 2011 at 7:50 AM, Friedrich Huebler <[email protected]> wrote:
>> Hans,
>>
>> I would add one more question: How do you know that the persons with
>> contract numbers 123, 456 and 678 live in the same household? Do you
>> have another variable that you are not showing us that contains this
>> information?
>>
>> Friedrich
>>
>> On Wed, Jul 6, 2011 at 7:27 AM, Nick Cox <[email protected]> wrote:
>>> How do you know that the resulting groups would be disjoint?
>>>
>>> Nick
>>> [email protected]
>>>
>>> Hans Meier
>>>
>>> No, I wished it was that easy.
>>>
>>> With
>>> egen group = group(contract)    you get:
>>>
>>>  contract |    id       |  household_id
>>> ___________________________
>>>  123        |   1        |   1  <-
>>>  123        |   2        |   1
>>>  123        |   3        |   1
>>>  456        |   4        |   2
>>>  456        |   5        |   2
>>>  678        |   1        |   3  <-
>>>
>>> As you can see, now id "1" has two different household id's, "1" at contract "123" and "3" at contract "678".
>>>
>>> But I want to put all id's who are connected in any contract in the same household, so that the household_id in contract "678" is also "1", because id "1" already belongs to household "1" from contract "123".
>>>
>>> Maybe an example makes it clearer:
>>>
>>> Imagine contract "123" beeing a liability-insurance for a mother, father and child (id's 2, 1 and 3), who are household 1.
>>> The father (id 1) also has a car insurance (contract 678), and of course this contract also belongs to household 1.
>>>
>>> But anyway, thank you for your fast reply!
>>>
>>> Von: "Nick Cox" <[email protected]>
>>>
>>>>If I understand this correctly, -contract- is already such an
>>>>identifier. You can use
>>>>
>>>>egen group = group(contract)
>>>>
>>>>to get a tidy equivalent with values 1 up.
>>>>
>>>>Nick
>>>>
>>>>On Wed, Jul 6, 2011 at 8:23 AM, Hans Meier <[email protected]> wrote:
>>>>
>>>>> 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?
>>
>
>*
>* 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/


___________________________________________________________
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