The DHS Program User Forum - RDF feed
https://userforum.dhsprogram.com/index.php
variables hv001 hv002 hv003 do not uniquely identify observations in the using data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=2563&th=1390#msg_2563
*urgent
I am working with Nigeria 2013 DHS.
I am trying to merge male recode with household member recode in STATA. But STATA reports is as---
variables hv001 hv002 hv003 do not uniquely identify observations in the using data---
This is the procedure I followed:
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.
Thank you
]]>nnalo2014-07-12T15:03:48-00:00Re: variables hv001 hv002 hv003 do not uniquely identify observations in the using data
https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=2568&th=1390#msg_2568
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".