The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » merging household data with female data
merging household data with female data [message #13473] Wed, 08 November 2017 05:17 Go to next message
rakesh is currently offline  rakesh
Messages: 2
Registered: November 2017
Member
hi,
i want to merge IABR42FL and IAIR42FL datasets in nhfs2. i have already generated the unique hhids. couldn't merge the two sets due to mismatch of number of observations in stata. please provide the stata code.

[Updated on: Wed, 08 November 2017 05:18]

Report message to a moderator

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 next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1482
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

Re: merging household data with female data [message #13476 is a reply to message #13474] Wed, 08 November 2017 09:06 Go to previous messageGo to next message
rakesh is currently offline  rakesh
Messages: 2
Registered: November 2017
Member
thanks a lot
an you please tell me about which dataset captures which information?
Re: merging household data with female data [message #13477 is a reply to message #13476] Wed, 08 November 2017 09:12 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 1482
Registered: February 2013
Senior Member
Please visit the "Dataset Types" page: https://www.dhsprogram.com/data/Dataset-Types.cfm
Re: merging household data with female data [message #13492 is a reply to message #13473] Fri, 10 November 2017 08:45 Go to previous message
boyle014 is currently offline  boyle014
Messages: 42
Registered: December 2015
Location: Minneapolis
Member
Dear Rakesh,

You may find IPUMS-DHS (www.idhsdata.org) particularly useful for your needs. The birth files and women's files have already been merged (and all of the household variables have also been added), and it is easy to browse all the variables to see which are available.

You can login with your DHS program email and password. Select GET DATA on the home page, use SELECT SAMPLES to choose India. (Be sure you SUBMIT on the sample selection page). The TOPICS drop-down menu will then show you the variables that are available for this sample.

Good luck with your research!

Liz Boyle



Professor Elizabeth Boyle
Sociology & Law, University of Minnesota, USA
Principal Investigator, IPUMS-DHS
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: Fri Oct 19 08:16:17 Eastern Daylight Time 2018