The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » Merging KR and PR files
Merging KR and PR files [message #28006] Wed, 01 November 2023 12:09 Go to previous message
sokiya is currently offline  sokiya
Messages: 79
Registered: May 2017
Location: Nairobi
Senior Member
I am trying to merge the KR file with the PR file using the codes below

use "KEKR8AFL.DTA", clear
drop if b16 == .
duplicates tag v001 v002 b16, gen(dup)
drop if dup!=0
ren (v001 v002 b16) (hv001 hv002 hvidx)
merge 1:1 hv001 hv002 hvidx using "KEPR8AFL.dta"

However, a few issues arise
a) b16 is missing in some case
b) KR file has some duplicates cases in v001 v002 b16

Any help will be greatly appreciated.
Thanks in advance
 
Read Message
Read Message
Read Message
Previous Topic: Figure 4.4 Trends in early marriage
Next Topic: KDHS 2014 : Table 14.10.1 Health insurance coverage: Women
Goto Forum:
  


Current Time: Sun Dec 1 07:33:47 Coordinated Universal Time 2024