The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging Women and Household Member Recode files
Re: Merging Women and Household Member Recode files [message #1377 is a reply to message #1322] Wed, 19 February 2014 16:12 Go to previous messageGo to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 802
Registered: January 2013
Senior Member
1) In your analysis you want to use characteristics of the mother with the child, so your merging needs to match with the mother's line number. hvidx for the children you are interested in is the line number of the child. For merging you will need to use the line number of the mother (hv112). Thus your commands need to:
a) sort the IR file on v001 v002 v003 (and save the sorted version - the file may already be sorted by these variables).
b) open the PR file, either rename hv001 to v001, hv002 to v002, hv112 to v003, or I generally prefer to create new variables, e.g. gen v001 = hv001, gen v002 = hv002, gen v003 = hv112
c) merge m:1 v001 v002 v003 using "IRfile"
d) drop any women's data for women that have no children, e.g. "keep if _merge==3" (this will only keep children for whom the mother was in the household and was interviewed). Check exactly which children you want to keep. You might want to use "drop if _merge==2", which will keep all of the children currently in the PR file, but will drop any cases of women that have no children in the PR file.

2) Yes, you should get the same results if you tabulate from the PR file with "if hvidx==1", but why not just use the HR file. The processing will be quicker with the HR file as it is reading only 9033 cases and not 44000 cases.

I hope this helps.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging women's file with Household File
Next Topic: Bangladesh 2011 DHS: Merging "children" and "male" files
Goto Forum:
  


Current Time: Sat Oct 19 13:22:59 Coordinated Universal Time 2024