The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Biomarkers » Merging CR and PR file (merge husband's information in CR file)
Merging CR and PR file [message #19322] Fri, 29 May 2020 23:16 Go to next message
nagar002 is currently offline  nagar002
Messages: 9
Registered: April 2018
Member
Hi DHS users,


I am looking for some help about merging the CR file with the PR file (need to bring husband's anemia from the PR file to the CR file). I have written the following code and I'll appreciate if someone can provide feedback about the correct way to do this. I couldn't find any post about the link of CR and PR file.

And are the duplicates in line three of the code below due to one man married to more than one female?




use "IACR74FL.DTA", clear
sort v001 v002 v034
quietly by v001 v002 v034: gen dup = cond(_N==1,0,_n) //why are there duplicates here?
drop if dup>0
tempfile cr
save `cr', replace


use "IAPR74FL.DTA", clear
ren hv001 v001
ren hv002 v002
clonevar v034=hvidx
sort v001 v002 v034
keep v001 v002 v034 hb57
merge 1:1 v001 v002 v034 using `cr'
keep if _m==3

<This example is for India. I have more countries in my sample, but I believe the basic idea can be used as it is for other surveys.>

In essence, my question is can we use v034 (the variable that identifies the husband in CR file) to bring information from the PR file about the husband?


Thanks you for any help.

[Updated on: Fri, 29 May 2020 23:18]

Report message to a moderator

Re: Merging CR and PR file [message #19334 is a reply to message #19322] Mon, 01 June 2020 19:48 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User, please refer to The Guide to DHS Statistics. The section on Matching and Merging datasets starts on P 1.49.

[Updated on: Mon, 01 June 2020 19:51]

Report message to a moderator

Previous Topic: Micronutrient survey/other biomarkers
Next Topic: BMI FOR AGE
Goto Forum:
  


Current Time: Sun Sep 27 03:54:01 Eastern Daylight Time 2020