The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » variables hv001 hv002 hv003 do not uniquely identify observations in the using data
variables hv001 hv002 hv003 do not uniquely identify observations in the using data [message #2562] Sat, 12 July 2014 10:58 Go to next message
nnalo is currently offline  nnalo
Messages: 5
Registered: July 2014
Member
Hello,
I am working with Nigeria 2013 DHS.
I am trying to merge male recode with household members recode in STATA.
I followed the procedure below but STATA reported with-- variables hv001 hv002 hv003 do not uniquely identify observations in the using data---

Steps:
1. open the household member file and sort hv001 hv002 hv003 and then save this file

2. open male file and do:


gen hv001 = mv001

gen hv002 = mv002

gen hv003= mv003

sort hv001 hv002 hv003

merge 1:1 hv001 hv002 hv003 using "THE NAME OF THE FILE WITH SORTED HOUSEHOLD MEMBER DATA"

keep if _merge==3

save "NEW NAME"

Please help me out here.
Thank You.
Re: variables hv001 hv002 hv003 do not uniquely identify observations in the using data [message #2569 is a reply to message #2562] Mon, 14 July 2014 08:25 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3202
Registered: February 2013
Senior Member
Following is a response from DHS Stata Specialist, Tom Pullum:

You are making a common mistake. The line number given by hv003 is not the line number of the household member; it is the line number of the household respondent, i.e. the person who provided the information for the household. It is the same for every record in the household. The line number of the household member is hvidx. This is the field that should match with v003 in the IR file or mv003 in the MR file. In other words, your line "gen hv003= mv003" should be "gen hvidx= mv003". In all other places where you have "hv003", you should replace it with "hvidx".
Re: variables hv001 hv002 hv003 do not uniquely identify observations in the using data [message #2572 is a reply to message #2569] Tue, 15 July 2014 18:49 Go to previous messageGo to next message
nnalo is currently offline  nnalo
Messages: 5
Registered: July 2014
Member
Thank You so much!
Re: variables hv001 hv002 hv003 do not uniquely identify observations in the using data [message #2575 is a reply to message #2572] Wed, 16 July 2014 10:25 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3202
Registered: February 2013
Senior Member
You're welcome.
Previous Topic: variables hv001 hv002 hv003 do not uniquely identify observations in the using data
Next Topic: Merging SPA and DHS data
Goto Forum:
  


Current Time: Mon Dec 2 17:31:43 Coordinated Universal Time 2024