The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Merging data files » Linking adult children (>15) to their parents
Linking adult children (>15) to their parents [message #12784] Thu, 13 July 2017 06:18 Go to previous message
Juliette is currently offline  Juliette
Messages: 3
Registered: February 2015
Member
Dear DHS-experts,

I'm currently trying to link parents and children living in the same household in order to compare some answer in the women and men questionnaires, hence I want both parents and children who answered the "over 15" questionnaire in the same database.
Do you have any advice in creating such a database?

Here's what I've tried for the case Ivory Coast, DHS 1994.
Quote:

use "$path/CIPR35FL.DTA", clear
* no line number of parents if children are older than 15
* keep heads of hh, their spouses & children
keep if hv101==1 | hv101==3 | hv101==2
*
gen eligibility=1 if hv117==1 |hv118==1
gen sondaughter=1 if hv101==3 & eligibility==1
gen head=1 if hv101==1 & eligibility==1
gen spouse=1 if hv101==2 & eligibility==1
bysort hhid: egen nbsd=count(sondaughter)
bysort hhid: egen nbhead=count(head)
bysort hhid: egen nbspouse=count(spouse)
*
gen keephh=1 if nbhead==1 & nbsd>=1 & nbspouse>=1
recode keephh (.=0)
*
keep if keephh==1
* MERGING WITH DATA FROM WOMEN AND MEN FILES
* ID: cluster_hh_line nb_age_survey
egen wuid=concat(hv001 hv002 hvidx hv007), punct(_)
egen muid=concat(hv001 hv002 hvidx hv007), punct(_)
drop if eligi!=1
*
merge 1:1 wuid using "$path/CI_women_94.DTA"
drop if _merge==2
merge 1:1 muid using "$path/CI_men.DTA", gen(merge)
drop if merge==2


Many thanks for your help!

[Updated on: Thu, 13 July 2017 07:18]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Senegal continuous DHS - combine 2014 and 2015 for regional representability?
Next Topic: Combining PR and KR to get child-specific malaria test results
Goto Forum:
  


Current Time: Sat Dec 21 22:59:07 Coordinated Universal Time 2024