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: merging the newly created height and weight DHS data sets with child data set
From
Donela Besada <[email protected]>
To
[email protected]
Subject
Re: st: merging the newly created height and weight DHS data sets with child data set
Date
Thu, 22 Aug 2013 16:10:05 +0200
Hello, thank you for your response.
So this is what I did:
I first opened the height and weight data set and renamed the two
variables I need to merge on so that they correspond to the name in
the household member data set
gen hhid=hwhhid
gen hvidx=hwline
Then I opened the household member data set and I did merge it with
the anthropometric data set
Type of merge: one to one on key variables
merge 1:1 hvidx hhid using
"/Users/donelabesada/Desktop/IHSS/Ethiopia/ETHW51DT_2005
anthro/ETHW51FL.DTA"
Result # of obs.
-----------------------------------------
not matched 62,591
from master 62,591 (_merge==1)
from using 0 (_merge==2)
matched 4,949 (_merge==3)
-----------------------------------------
After that I renamed the variables I am instructed to merge on to
reflect the same variables in the child data set:
rename hv001 v001
rename hv002 v002
rename hvidx b16
I then saved that file and opened the child data set. I then tried to
merge this child data set with my newly created merged file-again one
to one on key variables
merge 1:1 v001 v002 b16 using
"/Users/donelabesada/Desktop/ETPR51FL_householdmember_anthro_merge.dta"
When I did this I got the below error:
variables v001 v002 b16 do not uniquely identify observations in the master data
I am using Ethiopia 2005 data for this merging.
I would appreciate any help anyone can offer.
Thank you very much.
Warm wishes,
Donela
On Thu, Aug 22, 2013 at 4:01 PM, Nick Cox <[email protected]> wrote:
> Please show the -merge- command you typed to increase the chance of a
> good answer.
> Nick
> [email protected]
>
>
> On 22 August 2013 14:55, Donela Besada <[email protected]> wrote:
>> Hello,
>>
>> I was wondering if anyone could help me. I am trying to follow the WHO
>> instructions on how to merge the new height and age data sets with the
>> original child data sets. I am able to successfully merge the height
>> and weight data with the household member data. I am having some
>> trouble with the second step of merging that data set to the child
>> data set. When I try to merge on the variables: v001, v002 and b16, I
>> get the following error:
>>
>> "variables v001 v002 b16 do not uniquely identify observations in the
>> master data"
>>
>> Has anyone successfully done this and could you please help if so?
>>
>>
>> Thank you very much
>> Donela
>>
>> WHO instructions:
>>
>> The Height and Weight data collected for children at the household
>> level can be matched to the households, to the members, to the
>> mothers, or to the children.
>>
>> Use HWHHID and HWLINE from the Height and Weight file with HHID and
>> HVIDX from the Members Recode file to merge it with the household
>> member data.
>>
>> Once the Height and weight data are merged to the household members’
>> file, the resulting file could then be merged with the mother’s and
>> children’s file, as follows:
>>
>> Use HV001 (cluster number) plus HV002 (household number) and HWLINE
>> from the member’s constructed file (or the one resulting from the
>> previous merge), and merge it with the corresponding V001, V002, B16
>> (child’s line number in the household) in the Children Recode file or
>> in the Births Recode file.
>>
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>> * http://www.ats.ucla.edu/stat/stata/
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/