Statalist


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

Re: st: -merge- which one would make sense?


From   "Friedrich Huebler" <[email protected]>
To   [email protected]
Subject   Re: st: -merge- which one would make sense?
Date   Wed, 21 May 2008 19:58:18 -0400

Nirina,

Let's say we have the household below. Assume that the two
40-year-olds are married and that the 50-year-old man is married to
the 30-year-old woman. Your code merges the 50-year-old man with the
40-year-old woman and the 40-year-old man with the 30-year-old woman,
which would be wrong. Given only the data below it is not possible to
identify married couples. You need something like line number of the
spouse.

hhid sex age maritalstatus
1    1   50  1
1    1   40  1
1    2   40  1
1    2   30  1
1    1   5   0
1    2   3   0

It may help if you read two Stata FAQs about data on families.

http://www.stata.com/support/faqs/data/members.html
http://www.stata.com/support/faqs/data/anyall.html

Friedrich

On Wed, May 21, 2008 at 6:52 PM, Nirina F <[email protected]> wrote:
> Dear David and Friedrich,
>
> You are right, within one household, there are the wife and husband,
> children and other people like mother of husband.
> This is the code I used originally:
>
> Using the original data:
>
> keep if sex==1 & maritalstatus==1
> foreach x of var * {
>        rename `x' h_`x'
> }
>
> gen hid=h_hhid
> sort hid
> save  husband.dta
>
> keep if sex==2 & maritalstatus==1
> foreach x of var * {
>        rename `x' w_`x'
> }
> gen hid=w_hhid
> sort hid
> save wife.dta
> merge using husband.dta
>
> I also tried to include line number of respondent after each -keep-
> but it does not give me the answer where answers from husband on hh
> characteristics should match wive's.
> I am looking into details of what I have.
> thank you,
> nirina
>
>
>
> On 5/21/08, Friedrich Huebler <[email protected]> wrote:
>> Nirina,
>>
>> Further to my earlier question, I assume you have a variable that
>> identifies the marital status of each household member. Your
>> description is not clear but from what I understand you selected men
>> and women whose marital status is "married" and then assumed that a
>> married man and a married woman in the same household are each other's
>> spouse. Is this what you did? What did you do with households with
>> more than one married man and woman?
>>
>> Other possibilities are that you have a variable with the line number
>> of each household member's spouse or a variable that describes the
>> relationship to the household head. Either way, we need more
>> information in order to help you.
>>
>> Friedrich
>>
>> On Wed, May 21, 2008 at 10:56 AM, Friedrich Huebler <[email protected]> wrote:
>> > Nirina,
>> >
>> > First, please include the Stata commands you used.
>> >
>> > Second, how do you identified husbands and wives? A married man and a
>> > married woman living in the same household are not necessarily married
>> > to each other.
>> >
>> > Friedrich
>> >
>> > On Wed, May 21, 2008 at 8:29 AM, Nirina F <[email protected]> wrote:
>> >> Hello,
>> >> I have a microdataset with 5000 individuals. In the data, I have
>> >> household questionnaires and individual questionnaires together, pid,
>> >> hhid.
>> >>
>> >> I did the following scenarios and now I'm lost:
>> >>
>> >> 1- I separated the household(hh) questionnaire from the individual(i)
>> >> questionnaires.
>> >> I split the remaining individual questionnaires into married female
>> >> and  married male renamed all variables accordingly.
>> >> Then I merged the male and female because they are husband and wife by
>> >> their household id. I had 2000 households
>> >> Afterward, I merged the hh questionnaire. I end up back to 5000 observations.
>> >>
>> >> 2- I kept the original dataset and just split into two datasets
>> >> married female and  married male which I merged afterward to have
>> >> husband and wives. I arrive at 2000 observations.
>> >> When I assert if household information from husband and wife is the
>> >> same, almost 90% of the observation is false.
>> >>
>> >> What do you think I should do? Which one of the two should make sense?
>> >> Thank you very much from your help.
>> >> Nirina
>> >
*
*   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