The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Merging Datasets PDHS
Re: Merging Datasets PDHS [message #25467 is a reply to message #25456] Tue, 25 October 2022 08:42 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3040
Registered: February 2013
Senior Member
Following is a response from DHS staff member, Tom Pullum:

I suggest that you use the PR file, but just keep the line for the household head (the household member with hv101=1), since you have a special interest in that person's characteristics. The following Stata lines show how to do that. Good luck!

* specify workspace
cd e:\DHS\DHS_data\scratch

use "...PKPR71FL.DTA", clear 
keep if hv101==1
gen cluster=hv001
gen hh=hv002
sort cluster hh
save PKtemp.dta, replace


use "...PKKR71FL.DTA", clear 
gen cluster=v001
gen hh=v002
sort cluster hh
merge cluster hh using PKtemp.dta

tab _merge

* _merge is 2 for households that do not have a child in the KR file
keep if _merge==3
drop _merge

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merging KR with PR
Next Topic: Obtaining BMI data for males in MR dataset DHS 2019-2021: NFHS5
Goto Forum:
  


Current Time: Thu Apr 25 12:00:18 Coordinated Universal Time 2024