The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use (other programs) » Merging PR and KR file NFHS
Merging PR and KR file NFHS [message #25577] Fri, 11 November 2022 12:23 Go to next message
Lincoln is currently offline  Lincoln
Messages: 31
Registered: July 2022
Member
Hi, I am having some problems with merging NFHS-5 file merging PR with KR file: Here are codes and result:

PR data
drop if hc60>30
rename hvidx cline
rename v001 clusterline
rename hv001 clusterline
rename hv002 hhline
rename hv024 state
rename hc60 motherline
sort cline clusterline hhline state motherline

. save "/temp

. clear

. use "KR data"

drop if b16==0
drop if b16==.
rename b16 cline
rename v001 clusterline
rename v002 hhline
rename v024 state
rename v003 motherline
sort cline clusterline hhline state motherline
. merge 1:1 cline clusterline hhline state motherline using
"temp
(variable motherline was byte, now int to accommodate using data's values)

Result Number of obs
-----------------------------------------
Not matched 734
from master 727 (_merge==1)
from using 7 (_merge==2)

Matched 221,256 (_merge==3)
-----------------------------------------


Please help.

Regards
Lincoln
Re: Merging PR and KR file NFHS [message #25587 is a reply to message #25577] Mon, 14 November 2022 09:47 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3199
Registered: February 2013
Senior Member

Following is a response from Senior DHS staff member, Tom Pullum:

I tried this merge with my own code and got the same results, 727 and 7 non-matches. I also tried it with hv112 in place hc60, which gave MORE non-matches. I also tried including age in months (hc1 in the PR file and hw1 in the KR file), which again gave 727 and 7 non-matches.

If the number of cases with _merge=1 were about the same as the number with _merge=2, then it would be possible that something is keeping them from merging with each other. However, almost all of the unmatched children (727) are in the KR file only (_merge=1). There are only 7 children who are in the PR file only (_merge=2). Even if you could match the 7 cases with _merge=2, there would still be 720 unmatched cases with _merge=1. I don't think there's anything you can do to improve the merge. It only affects about 1/3 of one percent of the children in the PR file.
Re: Merging PR and KR file NFHS [message #25595 is a reply to message #25577] Tue, 15 November 2022 10:32 Go to previous message
Lincoln is currently offline  Lincoln
Messages: 31
Registered: July 2022
Member
Many thanks for the kind response. I will put this as limitation and continue with my analysis.

Regards
Lincoln
Previous Topic: respondents not visiting health facility
Next Topic: NFHS-5 Disability and health seeking
Goto Forum:
  


Current Time: Sat Nov 23 16:23:04 Coordinated Universal Time 2024