The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Wealth Index » Merge wealth index with individual recode - Malawi 2000
Merge wealth index with individual recode - Malawi 2000 [message #10793] Wed, 14 September 2016 20:58 Go to previous message
jswindle is currently offline  jswindle
Messages: 5
Registered: September 2016
Member
Hi all,

I would like to merge the household wealth index data file for Malawi 2000 with the individual recode data file for Malawi 2000. I would like to do this because I am then merging the Malawi 2000, 2004, and 2010 individual recode data files together, and the 2004 and 2010 data files include the wealth index variables (v190 and v191), but the 2000 data file does not.

My understanding is that I will need to merge the 2000 wealth index data file with the 2000 household recode data file first, after which I can merge this new edited 2000 household recode data file with the 2000 individual recode data file. If that is incorrect and I can merge the 2000 wealth index data file with the 2000 individual recode data file directly, then I would prefer to do that, but am not sure how I would do it.

When I follow my plans to merge the wealth and household files first, and then merge the household and individual files, I run into problems with the output of the merge between the 2000 individual recode and 2000 household recode data files. The files merge, but the merge "match" results appear to be quite off. The total n for the new merged file is 20,052, which is the total n of the two data files put together, rather than the n of the original individual recode data file alone, which is 13,220.

Below is the code I am using in Stata. Any advice would be appreciated. Thank you in advance.

STATA CODE

* Add wealth index to 2000 individual recode
use "H:\DHS\Malawi\2000 wealth recode\MWwi42fl.DTA", clear
rename whhid hhid
merge 1:1 hhid using "H:\DHS\Malawi\2000 household recode\MWHR41FL.DTA"
drop _merge
rename hv001 v001
rename hv002 v002
rename hv003 v003
rename wlthindf v190
rename wlthind5 v191
keep v001 v002 v003 v190 v191
sort v001 v002 v003
save "H:\DHS\Malawi\2000 wealth recode\wealthmergeprep.DTA", replace
clear
use "H:\DHS\Malawi\2000 individual recode\MWIR41FL.DTA", clear
sort v001 v002 v003
merge m:1 v001 v002 v003 using "H:\DHS\Malawi\2000 wealth recode\wealthmergeprep.DTA"


This is the output generated after the merge command:

. merge m:1 v001 v002 v003 using "H:\DHS\Malawi\2000 wealth recode\wealthmergeprep.DTA"

Result # of obs.
-----------------------------------------
not matched 12,671
from master 5,839 (_merge==1)
from using 6,832 (_merge==2)

matched 7,381 (_merge==3)
-----------------------------------------

.
end of do-file




 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Food Security indicators within DHS
Next Topic: merging wealth index file for Turkey DHS 1993
Goto Forum:
  


Current Time: Sat Apr 20 04:08:00 Coordinated Universal Time 2024