Merging household and women's individual data Myanmar 2015-2016 [message #21897] |
Wed, 06 January 2021 17:21 |
smiedem
Messages: 1 Registered: January 2021
|
Member |
|
|
Hi, I'm trying to merge the household and women's individual data using the Myanmar DHS 2015-2016 using code provided in previous forum posts. However, it appears as though only 4,942 of 12,885 women interviewed were matched with household data. Below is the code I used (saving the hh data file as mdhs_hh and the women's file as mdhs_women). I used the women's data set as the base file, as recommended on the DHS Program merging datasets webpage. Any advice for why so few of the women are merging with the household data file? I checked the MDHS report and I could find no indication of why this may be. Thanks for any advice you may have.
use "C:\Users\qlu4\Desktop\mdhs_hh.dta"
gen v001=hv001 //recode hh survey cluster number variable to match women's data set
gen v002 = hv002 //recode hh survey household number variable to match women's data set
gen v003 = hv003 //recode hh
keep v001 v002 v003 sh148 sh148f sh149 sh150 sh151 sh152 sh153 sh154 sh155 sh156 sh157 sh158 sh159 sh160 sh161 //keep only relevant variables
sort v001 v002 v003
save "C:\Users\qlu4\Desktop\mdhs_hh.dta", replace
use "C:\Users\qlu4\Desktop\mdhs_women.dta"
sort v001 v002 v003
merge 1:m v001 v002 v003 using "C:\Users\qlu4\Desktop\mdhs_hh.dta"
-----------------------------------------
Result # of obs.
not matched 15,501
from master 7,943 (_merge==1)
from using 7,558 (_merge==2)
matched 4,942 (_merge==3)
I also tried merge 1:1 v001 v002 v003 using "C:\Users\qlu4\Desktop\mdhs_hh.dta", which gave me the same results...
Best,
Stephanie
|
|
|
Re: Merging household and women's individual data Myanmar 2015-2016 [message #21993 is a reply to message #21897] |
Thu, 14 January 2021 13:50 |
Bridgette-DHS
Messages: 3189 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS Specialist, Kerry MacQuarrie:
Dear Stephanie,
You have renamed and matched the cluster and household number appropriately. However, hv003 does not match with v003. The variable hv003 refers to the line number of the person who answered the household questionnaire, not the line number of all individual women. You don't need it. Try the following:
use "C:\Users\qlu4\Desktop\mdhs_hh.dta"
gen v001=hv001 //recode hh survey cluster number variable to match women's data set
gen v002 = hv002 //recode hh survey household number variable to match women's data set
keep v001 v002 sh148 sh148f sh149 sh150 sh151 sh152 sh153 sh154 sh155 sh156 sh157 sh158 sh159 sh160 sh161 //keep only relevant variables
sort v001 v002
save "C:\Users\qlu4\Desktop\mdhs_hh.dta", replace
use "C:\Users\qlu4\Desktop\mdhs_women.dta"
sort v001 v002
merge 1:m v001 v002 using "C:\Users\qlu4\Desktop\mdhs_hh.dta"
In the Myanmar DHS, this matches 12,885 cases and leaves 3,095 cases in the HR file unmatched (ie households that did not have a corresponding eligible woman in the IR file)
-
Attachment: mrg.png
(Size: 10.33KB, Downloaded 805 times)
|
|
|
|
|
|