The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » General Data Questions » Merge wealth index 1999 TZ DHS
Merge wealth index 1999 TZ DHS [message #14119] Tue, 20 February 2018 12:42 Go to next message
kpat is currently offline  kpat
Messages: 2
Registered: January 2018
Member
I am trying to merge Wealth Index (WI) files with the 1999 DHS IR file. The code works, but only matches 533 of over 12,000 observations.

Starting with the IR file, I used the following code (which worked for four other countries in the analysis):
gen whhid = substr(caseid,1,12)
merge m:1 whhid using "TZWI3AFL.DTA"

Please advise.

[Updated on: Tue, 20 February 2018 12:43]

Report message to a moderator

Re: Merge wealth index 1999 TZ DHS [message #14121 is a reply to message #14119] Tue, 20 February 2018 14:47 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3035
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The following lines will work:

set more off

use e:\DHS\DHS_data\WI_files\TZWI3AFL.dta, clear 
sort whhid
save e:\DHS\DHS_data\scratch\TZWItemp.dta, replace

use e:\DHS\DHS_data\IR_files\TZIR3AFL.dta, clear
gen whhid=substr(caseid,1,12)
sort whhid
merge whhid using e:\DHS\DHS_data\scratch\TZWItemp.dta
tab _merge

Previous Topic: Grouping neighboring clusters / PSUs
Next Topic: Missing observations for h37i and h37j in Survey datasets for Myanmar, India, and Bangladesh
Goto Forum:
  


Current Time: Fri Apr 19 01:38:56 Coordinated Universal Time 2024