Merging Women and Household Member Recode files [message #1322] |
Fri, 14 February 2014 07:49  |
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   |
Trevor-DHS
Messages: 805 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.
|
|
|
|
|
|