The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Is there a way to add household member's information to birth's recode file?
Re: Is there a way to add household member's information to birth's recode file? [message #9541 is a reply to message #9487] Mon, 11 April 2016 10:08 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3230
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:


If the child has died or is alive but not living with the mother, then it sounds like you want to link with the household information about the mother. I suggest that you use b16 as the line number if the child is alive and living with the mother, and otherwise use v003 (the mother's line number) as the child's line number. I recommend constructing a "child_status" variable along the way. I believe the following lines will work.

use BRfile

* You will not use "child_status" in the merge but it will help in the analysis
gen child_status=.
replace child_status=1 if b5==1
replace child_status=2 if b5==1 & (hv112==0 | hv112>=98)
replace child_status=3 if b5==0
tab child_status,m

label define child_status 1 "Alive and with mother" 2 "Alive and not with mother" 3 "Dead"
label values child_status child_status

rename v001 hv001
rename v002 hv002
gen hvidx=b16
replace hvidx=v003 if child_status>1
sort hv001 hv002 hvidx
save BRtemp


use PRfile

sort hv001 hv002 hvidx
merge hv001 hv002 hvidx using BRtemp
 
Read Message
Read Message
Previous Topic: treatment seeking for ARI: Bangladesh DHS 2014
Next Topic: Variables missed after appending two de-normalized DHS datasets
Goto Forum:
  


Current Time: Thu Jan 30 23:57:51 Coordinated Universal Time 2025