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
Merging Women and Household Member Recode files [message #1322] Fri, 14 February 2014 07:49 Go to next message
nashallan is currently offline  nashallan
Messages: 7
Registered: February 2014
Location: Netherlands
Member
Hello

I am analysing the association between household assets, maternal characteristics and child nutrition using Uganda 2011 DHS. I have also realized that in order to replicate the stunting rates reported in the DHS report, I should use the HC70 in the PR files (household member). Hence I am using this as my base file. I have two questions:

1. First I rename v001 hv001, v002 hv002 and v003 hvidx
After sorting hvidx hv001 hv002, I then open the PR file (my base) so that I can merge using the IR (women's file). I use the following code
merge 1:1 hvidx hv001 hv002 using "C:\Users\ddg\Documents\UGIR60FL.DTA".
Is this correct? Should I merge 1:1 or m:1 or 1:m?

2. When using the PR file, I would like to conduct some of my analysis at household level e.g. descriptive stats of household assests. In the HR file, it is clear there are 9033 households, but in the PR file because of its structure there are more than 44000 individual observations. Can I use HVIDX==1 as the household level since it denotes the household head line number? for instance svy:tab hv244 if hvidx==1 would give me the same result as that in the DHS report.

Kindly assist

Nashallan
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 next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 680
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.
Re: Merging Women and Household Member Recode files [message #1451 is a reply to message #1377] Thu, 27 February 2014 09:56 Go to previous messageGo to next message
nashallan is currently offline  nashallan
Messages: 7
Registered: February 2014
Location: Netherlands
Member
Dear Trevor

Thank you. This really helps. One quick additional question.

For ease of analysis, where I want to look at the impact of maternal characteristics on children's nutrition in each households, which one is the better file, PR or HR file? Because the key issue is I need both the household and child nutrition data. How would I use the HR file to achieve this?

Nyasha

Re: Merging Women and Household Member Recode files [message #1455 is a reply to message #1451] Thu, 27 February 2014 16:59 Go to previous messageGo to next message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 680
Registered: January 2013
Senior Member
If you are interested in the impact of maternal characteristics on children's nutrition, then this is not a household analysis. The unit of analysis would be children. Thus you would use the PR file and select the children you are interested in analyzing (and don't use "if hvidx==1" as that would limit your analysis only to the heads of households (who are not children)).
Re: Merging Women and Household Member Recode files [message #1465 is a reply to message #1455] Fri, 28 February 2014 11:47 Go to previous message
nashallan is currently offline  nashallan
Messages: 7
Registered: February 2014
Location: Netherlands
Member
Dear Trevor

Thanks for the assistance.

Nashallan
Previous Topic: Merging women's file with Household File
Next Topic: Bangladesh 2011 DHS: Merging "children" and "male" files
Goto Forum:
  


Current Time: Sat Mar 28 20:13:49 Eastern Daylight Time 2020