The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » merging household data with female data
Re: merging household data with female data [message #13474 is a reply to message #13473] Wed, 08 November 2017 08:17 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3214
Registered: February 2013
Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum:

The IR file has one record for every woman in the survey of women. The BR file has one record for every child of those women. The records in the BR file include much of the information about the mother. You only need to do this merge if there are variables on the IR records that have not already been attached to the BR records.

Women who have not had any children will not appear as mothers in the BR file. Women who have had more than one child will appear more than once as mothers in the BR file. That's why the number of records in the two files is different. However, that does not keep you from doing a merge.

The following will work (you would need to change the paths):

use e:\DHS\DHS_data\IR_files\IAIR42FL.dta, clear
sort v001 v002 v003
save e:\DHS\DHS_data\scratch\IRtemp.dta, replace

use e:\DHS\DHS_data\BR_files\IABR42FL.dta, clear
sort v001 v002 v003
merge v001 v002 v003 using e:\DHS\DHS_data\scratch\IRtemp.dta

tab _merge
keep if _merge==3
drop _merge

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging individual record to couples record
Next Topic: DRC merge individuals records contained in household data to child data
Goto Forum:
  


Current Time: Tue Dec 24 09:00:06 Coordinated Universal Time 2024