The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » NFHS 4 Data (Merging of PR and KR data file)
NFHS 4 Data (Merging of PR and KR data file) [message #13952] Mon, 29 January 2018 08:29 Go to next message
Jayanta is currently offline  Jayanta
Messages: 28
Registered: September 2017
Member
Dear DHS team,

I was looking the previous comments on PR and KR file merging codes and applying it to NFHS4 data and found error message as given below.

"variables v001 v002 v003 b16 do not uniquely identify observations in the master data".

Your help will be appreciated in this regards.


Regards,
Jayanta

[Updated on: Mon, 29 January 2018 08:30]

Report message to a moderator

Re: NFHS 4 Data (Merging of PR and KR data file) [message #13958 is a reply to message #13952] Mon, 29 January 2018 20:13 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3013
Registered: February 2013
Senior Member

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

The following lines will work. You do not need to include v003 at all. b16 is the line number of the child in the household file. You may have been confusing it with bidx, which is the number of the child in the birth history (with 1 for the most recent birth), or bord, which is birth order (with 1 for the first birth). That is, the values of bidx and bord are nested within v003, but b16 is comparable to v003 and to hvidx--as a line number nested within the household.

* Prepare KR file for merge
use e:\DHS\DHS_data\KR_files\IAKR71FL.dta, clear 
gen hv001=v001
gen hv002=v002
gen hvidx=b16
sort hv001 hv002 hvidx
save e:\DHS\DHS_data\scratch\IAKRtemp.dta, replace


* Prepare PR file for merge
use e:\DHS\DHS_data\PR_files\IAPR71FL.dta, clear
sort hv001 hv002 hvidx

* Merge KR with PR
merge hv001 hv002 hvidx using  e:\DHS\DHS_data\scratch\IAKRtemp.dta
tab _merge
Re: NFHS 4 Data (Merging of PR and KR data file) [message #13978 is a reply to message #13958] Wed, 31 January 2018 04:16 Go to previous message
Jayanta is currently offline  Jayanta
Messages: 28
Registered: September 2017
Member
Thanks a ton for your help.
Previous Topic: Merging Individual and HH Member Recode Files
Next Topic: Merging children to their mothers
Goto Forum:
  


Current Time: Tue Mar 19 03:55:09 Coordinated Universal Time 2024