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?
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 previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3061
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
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 May 18 07:08:11 Coordinated Universal Time 2024