The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Other countries » Namibia 2013 - age inconsistencies after merging household and individual datasets
Re: Namibia 2013 - age inconsistencies after merging household and individual datasets [message #11896 is a reply to message #11889] Mon, 27 February 2017 11:02 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3123
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

You must include the line number. The following lines will work (change the paths):

set more off
use e:\DHS\DHS_data\IR_files\NMIR61FL.dta, clear
rename v001 hv001
rename v002 hv002
rename v003 hvidx
sort hv001 hv002 hvidx
save e:\DHS\scratch\temp.dta, replace

use e:\DHS\DHS_data\PR_files\NMPR61FL.dta, clear 
sort hv001 hv002 hvidx
merge hv001 hv002 hvidx using e:\DHS\scratch\temp.dta

tab _merge

_merge will be 3 for the women in the IR file; _merge will be 1 for the cases in the PR file who are not in the IR file. I never use the version of merge that has 1:1 or 1:m or m:1 or m:m. The older version will do everything you could possibly want to do and is more forgiving.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Liberia Household Survey 2013 (lbhr6adt)
Next Topic: Cote D'Ivoire ethnic groups
Goto Forum:
  


Current Time: Wed Aug 7 18:37:00 Coordinated Universal Time 2024