The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merge WI to KR in Mali
Re: Merge WI to KR in Mali [message #17898 is a reply to message #17896] Tue, 09 July 2019 01:21 Go to previous messageGo to previous message
sohelruhrd is currently offline  sohelruhrd
Messages: 19
Registered: July 2014
Location: Bangladesh
Member

I tried to use the following command to merge the KR file with Wi file in Stata. This is an example for Niger DHS 1992.


************************************************************ ************************************
clear all
set more off
use "........\Niger 1998\NIWI31FL.DTA"
rename whhid hhid
merge 1:m hhid using "........\Niger 1998\NIHR31FL.DTA" // merging with household record
drop _merge
keep hhid wlthindf wlthind5 hv001 hv002 hv003
rename hv001 v001
rename hv002 v002
rename hv003 v003
sort v001 v002 v003
save "........\Niger 1998\NIHR31FLnew.DTA", replace

****
clear all
set more off
use "........\Niger 1998\NIKR31FL.DTA", clear
sort v001 v002 v003
merge m:1 v001 v002 using "........\Niger 1998\NIHR31FLnew.DTA" // merging with Wealth Index file
drop if _merge==2
drop _merge

rename wlthind5 v190 // wlthind5: wealth index
ta v190

************************************************************ ************************************************************ *********


I found the following error message:
"variables v001 v002 do not uniquely identify observations in the using data"

Thank you.

Regards,
Rahman
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging BR file with PR file for NFHS-4 round(India)
Next Topic: Merging of NFHS-4 dataset
Goto Forum:
  


Current Time: Thu Apr 18 23:14:46 Coordinated Universal Time 2024