The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » General Data Questions » Is HW included in KR and IR/MR included in PR?
Is HW included in KR and IR/MR included in PR? [message #14850] Wed, 09 May 2018 09:01 Go to next message
nibiti is currently offline  nibiti
Messages: 20
Registered: April 2018
Location: Göttingen
Member
Hi all,

I am struggling to understand the exact coverage of the different recodes.

In particular, I am wondering if I need to merge HW, KR, IR, MR, PR and HR into one dataset. Or if HW is entirely included in KR and if IR and MR are entirely included in the PR datasets? If the latter was true, then it would of course be sufficient for me to only merge together KR, PR and HR.

I am using waves 3 to 7. Not sure if for example IR/MR are entirely included in PR in one wave but are not for another wave.

I've searched the DHS page and forum for some time now and don't find an answer. Maybe anyone could help?

Many thanks!!

Best,
Timo
Re: Is HW included in KR and IR/MR included in PR? [message #14955 is a reply to message #14850] Mon, 21 May 2018 08:50 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3215
Registered: February 2013
Senior Member

Following is a response from Senior DHS Stata Specialist, Tom Pullum:

It's likely that you don't need to do any merging at all. What are your cases (households, household members, women, men, couples, or children) and what variables are you using?
Re: Is HW included in KR and IR/MR included in PR? [message #14960 is a reply to message #14955] Tue, 22 May 2018 08:23 Go to previous messageGo to next message
nibiti is currently offline  nibiti
Messages: 20
Registered: April 2018
Location: Göttingen
Member
Hi Tom,

I am using data for females and males between 0 and 25 years on an individual level. Hence, I am using PR as my base dataset.

From IR and KR I am only interested in v104-106 (and mv104-106) which describes childhood residence, years lived in current residence and type of place of previous residence.

For KR I am interested in data about children who have been born and how many of them died (v206-208) as well as birth weights, antenatal visits for pregnancy and literacy.

As far as I can tell, none of those data is available in the PR file, which is why I need to merge.

Best
Timo
Re: Is HW included in KR and IR/MR included in PR? [message #14962 is a reply to message #14960] Tue, 22 May 2018 08:38 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3215
Registered: February 2013
Senior Member
Please specify the survey you are working with: country name and year.
Re: Is HW included in KR and IR/MR included in PR? [message #14963 is a reply to message #14962] Tue, 22 May 2018 08:53 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3215
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:

Sorry to have to say this, but I don't think this makes sense. You can get adults 15-24 in the IR and MR files, and children 0-4 in the KR file. The IR file includes v206-208. Why do you want to merge with the PR file? Most household-level and individual-level characteristics are included in the IR, MR, and KR files. I suggest you think more carefully about what you want to produce, perhaps as tables. And produce this with one survey before expanding to all surveys in all of sub-Saharan Africa. It's usually a good idea to start simple, and then add complexity.
Re: Is HW included in KR and IR/MR included in PR? [message #14964 is a reply to message #14963] Tue, 22 May 2018 09:24 Go to previous messageGo to next message
nibiti is currently offline  nibiti
Messages: 20
Registered: April 2018
Location: Göttingen
Member
Hi Tom,

should have been more specific, I guess. What I wrote before was just the variables that I needed from the IR, MR and KR files. I chose the PR file as base, because I need anthropometric information, as well as hemoglobin and anemia information. From IR, MR and KR files I then need the variables stated above. This is why I indeed do need to merge the datasets.

Because of the anthropometric information, my original question was whether the HW datasets are entirely included in the PR files.


I think I figured it out now, though. By the time of my question, I still hadn't.

But I think it would be a great idea to publish a list of variables that can be found in multiple recodes. This would allow checking from the beginning, whether you neeed to merge or not. To my knowledge, such a list does not exist, so that if you are looking for variable-overlaps between the recodes, you have to manually open the datasets and check for the variable, which is very time-consuming.

Best
Re: Is HW included in KR and IR/MR included in PR? [message #14965 is a reply to message #14964] Tue, 22 May 2018 10:01 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3215
Registered: February 2013
Senior Member
Following is another response from Senior DHS Stata Specialist, Tom Pullum:

The anthropometry and hemoglobin variables are included in the IR, MR, and KR files, as well as the PR file. You do not need to do a merge to get those variables.

The files are defined by the units or cases that they include, not by the variables they include. The variables are specific to the cases and to whether they come from the household survey or the individual surveys of men and women. The children's data come mainly from the interview with the mother. The data structure is not simple, but it is simpler than you seem to think it is.

Below I will paste Stata lines to do what you say you want to do. You should insert lines for each file to save just the variables you need. Otherwise you will end up with an unmanageable number of variables and some duplicates, especially from the IR and KR variables. You will have to set the paths.

* Prepare IR file for merge
use IR.dta, clear 
gen in_IR=1
rename v001 hv001
rename v002 hv002
rename v003 hvidx
sort hv001 hv002 hvidx
save IRtemp.dta, replace

* Prepare MR file for merge
use MR.dta, clear 
gen in_MR=1
rename mv001 hv001
rename mv002 hv002
rename mv003 hvidx
sort hv001 hv002 hvidx
save MRtemp.dta, replace

* Prepare KR file for merge
use KR.dta, clear 
gen in_KR=1
rename v001 hv001
rename v002 hv002
rename b16 hvidx
sort hv001 hv002 hvidx
save KRtemp.dta, replace

* Prepare PR file for merge
use PR.dta, clear 
gen in_PR=1
sort hv001 hv002 hvidx

* Merge PR with IR
merge hv001 hv002 hvidx using IRtemp.dta
rename _merge _merge_PR_IR
sort hv001 hv002 hvidx

* Merge with MR
merge hv001 hv002 hvidx using MRtemp.dta
rename _merge _merge_PR_MR
sort hv001 hv002 hvidx

* Merge with KR
merge hv001 hv002 hvidx using KRtemp.dta
rename _merge _merge_PR_KR

Re: Is HW included in KR and IR/MR included in PR? [message #14966 is a reply to message #14965] Tue, 22 May 2018 10:31 Go to previous messageGo to next message
nibiti is currently offline  nibiti
Messages: 20
Registered: April 2018
Location: Göttingen
Member
Hi Tom,

thanks for your reply and for your code.


Nevertheless, I believe that it may not be true that anthropometric, hemoglobin and anemia data are in the MR file. It is indeed included in IR and KR but is not in the MR. So if one wants to have this information for males above 5, you have to use the PR file. I have just cross-checked this for MR files of several Sub-Saharan African countries in waves 4-7 and have not found these data, whereas in the PR file they are present.
Please correct me if I'm wrong.


Regarding the merge: I have asked this in another thread already, but maybe you can answer this as well (please let me know, if you prefer to have it answered in the other thread and I will delete this part here and post it in the other thread).

Using basically the same code you posted, there are several countries for which the three variables are not unqiue identifiers. Some of them in the Master (this is always a merged dataset of PR and GE datasets) data and some of them in the Using data (IR, MR and KR datasets). As said, I am using Sub-Saharan African countries in waves 3 to 7. I have excluded KR from wave 3 because the b16 identifier does not exist there. Also, I have always used "drop if b16==0" and "drop if b16=."
Here's a list of the countries that do not work:

Wave 3:
IR: ML, NI, TG --> all not uniquely identified in the Using data

Wave 4:
IR: ML, SN --> all not uniquely identified in the Using data

Wave 6:
KR: BJ, LS, ML --> all not uniquely identified in the Using data


Separately for each wave, I am using a loop over all countries. For all other countries it works fine. So the code is not the problem - it should be something about the raw data, is what I suspect. Maybe you have an idea?


Thanks and best
Timo

[Updated on: Wed, 23 May 2018 07:05]

Report message to a moderator

Re: Is HW included in KR and IR/MR included in PR? [message #14977 is a reply to message #14966] Wed, 23 May 2018 07:52 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3215
Registered: February 2013
Senior Member

Following is another response from Senior DHS Stata Specialist, Tom Pullum:

Regarding what's in what file--you may have found some exceptions to the general pattern. Also there have been some changes over time; what's standard now has not always been standard.

Yes, there are some surveys with files that are difficult to merge. If you don't have b16, then you can't merge the KR and PR files with complete reliability, but apart from that some merges are difficult.

Try the following example of a PR / KR merge, which uses caseid and hhid. (You will want to include more variables in the "keep" lines and change the paths.) It should work on some of those difficult merges but probably not all. Let me know which ones remain.

I want DHS to prepare a library of merge programs for these difficult cases. The basic problem is that in some surveys there is a sub-household id and it's not well documented.

use "C:\Users\2626I\ICF\Analysis - Shared Resources\Data\DHSdata\PEKR6IFL.DTA" , clear
gen hhid=substr(caseid,1,12)
rename b16 hvidx
gen in_KR=1
keep hhid hvidx in*
sort hhid hvidx
save e:\DHS\DHS_data\scratch\PEKR6Itemp.dta, replace

use "C:\Users\2626I\ICF\Analysis - Shared Resources\Data\DHSdata\PEPR6IFL.DTA" , clear
gen in_PR=1
keep hhid hvidx in*
sort hhid hvidx
merge hhid hvidx using e:\DHS\DHS_data\scratch\PEKR6Itemp.dta
tab _merge
Re: Is HW included in KR and IR/MR included in PR? [message #15010 is a reply to message #14965] Fri, 25 May 2018 00:33 Go to previous message
Hassen
Messages: 121
Registered: April 2018
Location: Ethiopia,Africa
Senior Member
Thank you very much Dr.Tom Pullum and Bridgette!! This forum is really like a system thinking to learn and develope one's capacity.
Wishing you have a long lifetime guys.
With Best wishes,Hassen


Hassen Ali(Chief Public Health Professional Specialist)
Previous Topic: Is there a Recode Manual for KR, PR and HW datasets?
Next Topic: Recode Manual for DHS-VII
Goto Forum:
  


Current Time: Sat Dec 28 04:10:43 Coordinated Universal Time 2024