The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » Merging dataset for MIS 2015 Survery on stata
Merging dataset for MIS 2015 Survery on stata [message #22020] Wed, 20 January 2021 09:49 Go to next message
toyosi is currently offline  toyosi
Messages: 3
Registered: January 2021
Member
Hi I am using the 2015 MIS survey for my dissertation however I having trouble merging the household dataset which is KEPR7ADT with the womens/individual dataset which is KEIR7A on STATA. Please can anyone let me know what to do , i have tried using the guidance provided on the dhs website but it did not work.
this is the code i used:

use "/Users/t/Desktop/Actual dataset/PR2.DTA"

rename hv001 v001
rename hv002 v002
sort v001 v002
save "/Users/Desktop/Actual dataset/PR2.DTA", replace

use "/Users/t/Desktop/Actual dataset/IR.DTA"
sort v001 v002

merge m:1 v001 v002 using PR2

I received the error message that the variables v001 v002 do not uniquely identify observations in the using data

I dont know what i did wrong as this is what the dhs guide says to do . Pls help

thank you so much,

toyosi

[Updated on: Wed, 20 January 2021 09:58]

Report message to a moderator

Re: Merging dataset for MIS 2015 Survery on stata [message #22022 is a reply to message #22020] Wed, 20 January 2021 15:01 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3208
Registered: February 2013
Senior Member

Following is a response from DHS Research & Data Analysis Director, Tom Pullum:

You need to include line number. In the PR file that's hvidx and in the IR file it's v003. Just change to the following:

use "/Users/t/Desktop/Actual dataset/PR2.DTA"

rename hv001 v001
rename hv002 v002
rename hvidx v003
sort v001 v002 v003
save "/Users/Desktop/Actual dataset/PR2.DTA", replace

use "/Users/t/Desktop/Actual dataset/IR.DTA"
sort v001 v002 v003

merge m:1 v001 v002 v003 using PR2
Previous Topic: Indicator for financial literacy and savings
Next Topic: MIS 2015
Goto Forum:
  


Current Time: Wed Dec 11 18:55:07 Coordinated Universal Time 2024