The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Infant death in last 5 years
Infant death in last 5 years [message #12551] Wed, 14 June 2017 03:12 Go to previous message
AnvitaDixit is currently offline  AnvitaDixit
Messages: 7
Registered: June 2017
Location: usa
Member
Hello. Can you help me on how to create a variable for "Whether the most recently born infant in last 5 years died by age 12 months" into yes/no..in stata?


//Last child born in 5 years preceding survey
gen bornlast5y = .
replace bornlast5y = 1 if b3_01 >= 1297 & b3_01<=1363
tab bornlast5y, mi
svy:tab bornlast5y
//Infant is alive now or died in infancy
gen infantalive = .
replace infantalive = 1 if bornlast5y == 1 & b5_01 == 1
replace infantalive = 0 if bornlast5y == 1 & b5_01 == 0 & b7_01 < 13
label variable infantalive "Whether infant is alive"
tab infantalive, mi
svy: tab infantalive

[Updated on: Wed, 14 June 2017 22:50]

Report message to a moderator

 
Read Message
Read Message
Previous Topic: Are cluster values the same across different years (versions)?
Next Topic: Question on using weights for svyset and finding ICC in svy:melogit
Goto Forum:
  


Current Time: Thu Mar 28 21:57:58 Coordinated Universal Time 2024