Merging IR and HR files for Bangladesh [message #27301] |
Sat, 15 July 2023 10:53 |
Ghose
Messages: 17 Registered: May 2018
|
Member |
|
|
Hi,
I am trying to merge the IR and HR files for Bangladesh, and getting a very small number of matched observations. In comparison, merging IR with PR retains all observations, which is confusing me.
So, could you check the codes and please let me know if this is the right way to do the matching?
1. IR & HR merge
. use "/Users/ghose/Downloads/BDHR7RDT/BDHR7RFL.DTA"
. rename (hv001 hv002 hvidx_01) (v001 v002 v003)
. sort v001 v002 v003
. merge m:1 v001 v002 v003 using "/Users/ghose/Downloads/BDIR7RDT/BDIR7RFL.DTA"
Result # of obs.
-----------------------------------------
not matched 35,510
from master 17,420 (_merge==1)
from using 18,090 (_merge==2)
matched 2,037 (_merge==3)
-----------------------------------------
2. IR & PR merge
. rename (hv001 hv002 hvidx) (v001 v002 v003)
. sort v001 v002 v003
. merge m:1 v001 v002 v003 using "/Users/ghose/Downloads/BDIR7RDT/BDIR7RFL.DTA"
Result # of obs.
-----------------------------------------
not matched 69,692
from master 69,692 (_merge==1)
from using 0 (_merge==2)
matched 20,127 (_merge==3)
Thanks in advance!
|
|
|
|
|
Re: Merging IR and HR files for Bangladesh [message #27331 is a reply to message #27327] |
Wed, 19 July 2023 12:10 |
Bridgette-DHS
Messages: 3214 Registered: February 2013
|
Senior Member |
|
|
Following is a response from Senior DHS staff member, Tom Pullum:
I recommend that you do the merging first, and then the appending. Note that some variables are survey-specific, for example region. When you append surveys, you will lose the labels, or the labels in the last survey in the append will over-write the earlier labels. You can keep survey-specific variables separate by giving them a new name that identifies the country and survey. In pooled files there can also be discrepancies, from one survey to another, in codes that you may think are standard, such as type or birth attendant or type of health facility. It's a good idea to do a lot of checking for comparability.
|
|
|