The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » 2014 Kenya DHS merging household and men's datafile
2014 Kenya DHS merging household and men's datafile [message #10138] Thu, 30 June 2016 08:57 Go to next message
laura is currently offline  laura
Messages: 6
Registered: June 2016
Member
Hello,

I would like to merge the household and men's data files to use in my analysis.

However, I have tried to merge using the household number but I get the error message
"variable hv002 does not uniquely identify observations in the master data"

I am using this command
"merge 1:m hv002 using KEKR70FL"

NB: I renamed the household number in the men's datafile from mv002 to hv002

Kindly how do I go about merging the two data files as I cannot identify any other variable which I can use as an identifier.


Thank you.

Laura

[Updated on: Thu, 30 June 2016 09:10]

Report message to a moderator

Re: 2014 Kenya DHS merging household and men's datafile [message #10139 is a reply to message #10138] Thu, 30 June 2016 09:10 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member
There are several posts on merging household and men on the forum. You could also reference the page on merging: http://www.dhsprogram.com/data/Merging-Datasets.cfm .
Re: 2014 Kenya DHS merging household and men's datafile [message #10140 is a reply to message #10139] Thu, 30 June 2016 09:12 Go to previous messageGo to next message
laura is currently offline  laura
Messages: 6
Registered: June 2016
Member
Dear Bridget,

I have checked them out and tried merging as described in the various forums but I still get the error message
Re: 2014 Kenya DHS merging household and men's datafile [message #10141 is a reply to message #10140] Thu, 30 June 2016 09:35 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member
Senior DHS Stata Specialist, Tom Pullum has provided the following Stata syntax:

use MRfile, clear
rename mv001 hv001
rename mv002 hv002
rename mv003 hvidx
sort hv001 hv002 hvidx
save MRtemp.dta, replace

use PRfile, clear
sort hv001 hv002 hvidx
merge hv001 hv002 hvidx using MRtemp.dta
tab _merge
keep if _merge==3
drop _merge
Re: 2014 Kenya DHS merging household and men's datafile [message #10144 is a reply to message #10141] Thu, 30 June 2016 10:11 Go to previous messageGo to next message
laura is currently offline  laura
Messages: 6
Registered: June 2016
Member
Thank you for the response.

[Updated on: Thu, 30 June 2016 10:36]

Report message to a moderator

Re: 2014 Kenya DHS merging household and men's datafile [message #10145 is a reply to message #10144] Thu, 30 June 2016 11:02 Go to previous messageGo to next message
laura is currently offline  laura
Messages: 6
Registered: June 2016
Member
Since I am doing a study on primary school attendance, I am interested in members of family age 6-14 years, after the merging, I do not have a single observation on that age group.

Kindly advise, on how I should go around this issue as I need to use some respondents characteristics such as literacy and occupation which are not included in the PRfile but in the MRfile.
Re: 2014 Kenya DHS merging household and men's datafile [message #10196 is a reply to message #10145] Thu, 07 July 2016 10:11 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member
Another response from Tom Pullum:

The MR file is for "men", not "males", and like the IR file has a minimum age of 15. (The maximum age varies for men, but is usually 49 or 54 or 59.) My previous answer was probably misleading--I guess I didn't understand that you were just interested in the ages for school attendance. If you do this merge you will get some men/boys at ages 15 to 17 or 18 ( or whatever age you could take as the top age for school attendance) but you will not get any below age 15. The same for women/girls; you won't find anyone below age 15 in the IR file.

Previous Topic: Merging DHS Files
Next Topic: Merging data
Goto Forum:
  


Current Time: Sun Dec 22 00:30:19 Coordinated Universal Time 2024