Home » Data » Merging data files » Merge PR and KR in wave 3, b16 does not exist
Merge PR and KR in wave 3, b16 does not exist [message #14951] |
Sat, 19 May 2018 12:59 |
nibiti
Messages: 20 Registered: April 2018 Location: Göttingen
|
Member |
|
|
Hi all,
I am trying to merge PR with KR datasets for Sub-Saharan Africa, using PR as the base file. I have encountered a problem that many seem to have faced in this forum. My Stata tells me that my "variables hv001 hv002 and hvidx do not uniquely identify the observations in the using data".
Now, I have tried to find an answer in other forum threads (like this one: https://userforum.dhsprogram.com/index.php?t=msg&goto=28 46&) and the suggested answer seems to use b16 as identifier instead.
However, I face two problems:
1. b16 seems to not have been part of wave 3 and is not included in any of the wave 3 datasets. Is there a way in which I can still merge PR and KR datasets for wave 3? What identifier should be used instead?
Edit: I found my own answer here: https://userforum.dhsprogram.com/index.php?t=msg&th=1900 &goto=10942&S=Google where it says that wave 3 is indeed not available.
2. For wave 4 to 7 I still receive the same error message again. That my variables (hv001/v001, hv002/v002, hvidx/b16) do not uniquely identify my observations.
Edit: I also tried dropping b16 for values of 0 or 99, but the error message remains.
Many thanks in advance!
Best regards
Timo
[Updated on: Sat, 19 May 2018 13:37] Report message to a moderator
|
|
|
|
|
|
Re: Merge PR and KR in wave 3, b16 does not exist [message #15379 is a reply to message #14951] |
Sun, 08 July 2018 23:16 |
kingx025
Messages: 95 Registered: August 2016 Location: Minneapolis. Minnesota
|
Senior Member |
|
|
I'm not sure what data you need to secure by merging the PR and KR observations. If you need some background characteristics about the households, such as type of toilet facility, source of drinking water, etc. as well as the child data, an alternative approach may be to go to IPUMS-DHS (www.idhsdata.org), choose children as your unit of analysis (data from the KR file), and select additional variables relating to the mother's or household characteristics. We have merged the household file (HR) to the mother's (IR) files, and merged both to children's records (and birth records). Thus, if you create a customized dataset using IPUMS-DHS and children as the unit of analysis, you can add any characteristics related to the child's mother (including some not included in the original KR files, such as experience of domestic violence) and summary variables about the mother's household, such as type of toilet facility, source of water, wealth index, housing characteristics, agricultural and non-agricultural possessions, anti-malarial measures, nutritional indicators (such as iodized salt), and summary geography indicators.
The linking problems referred to in other messages in this thread did not affect our linking households to women (HR to IR) and linking women/mothers to children (IR to KR), so the approach described above may be a more general as well as a less labor-intensive solution.
Miriam King
Dr. Miriam King
IPUMS-DHS Project Manager (www.idhsdata.org)
|
|
|
|
Re: Merge PR and KR [message #21769 is a reply to message #14951] |
Wed, 16 December 2020 06:34 |
ask_ans_sri
Messages: 2 Registered: June 2018 Location: DELHI
|
Member |
|
|
I have used the following syntax for merging PR and KR files on NFHS-4
use kr.dta
rename (v001 v002 b16)(hv001 hv002 hvidx)
drop if hvidx==0 | hvidx==.
save kr.dta
use pr.dta
sort hv001 hv002 hvidx
merge m:m hv001 hv002 hvidx using kr.dta
The results are as follows
Result # of obs.
-----------------------------------------
not matched 2,624,197
from master 2,624,194 (_merge==1)
from using 3 (_merge==2)
matched 244,855 (_merge==3)
I am working on KR file. I have estimated stunting varibale from KR file and need some variables from PR file.
The stunting estimate is matching with the reported figure.
. ta child_stunt [aw=wt]
child_stunt Freq. Percent Cum.
0 143,158.22 61.59 61.59
1 37,867.5617 16.29 77.88
2 51,414.222 22.12 100.00
Total 232,440 100.00
in child_stunt 1 is below -300.
But I am having issue of tallying the frequencies. The frequency I am getting is not matching with the report (page 337).
Please do let me know if I am doing anything wrong.
Thanks in advance.
|
|
|
Goto Forum:
Current Time: Fri Nov 8 00:17:26 Coordinated Universal Time 2024
|