The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merge PR and KR in wave 3, b16 does not exist
Re: Merge PR and KR in wave 3, b16 does not exist [message #15192 is a reply to message #14961] Thu, 14 June 2018 11:06 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3035
Registered: February 2013
Senior Member
Following is a response from DHS Technical Specialist, Shireen Assaf:

The following code should work for a KR PR merge. I'm using the Rwanda most recent survey as an example.


use RWKR70FL.DTA, clear             
               
               rename v001 hv001
               rename v002 hv002
               rename b16  hvidx
               
               * dropping those that are not in the household so we can merge with PR file
               drop if hvidx==0 | hvidx==.

               sort hv001 hv002 hvidx
               
               save temp.dta, replace
               
               use RWPR70FL.DTA, clear             

               sort hv001 hv002 hvidx
               merge 1:1 hv001 hv002 hvidx using temp.dta
               
               erase temp.dta
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Survey identifiers
Next Topic: Merging household and women's individual data Myanmar 2015-2016
Goto Forum:
  


Current Time: Fri Apr 19 00:15:10 Coordinated Universal Time 2024