The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Variable midx
Re: Variable midx [message #16090 is a reply to message #16035] Fri, 02 November 2018 14:43 Go to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3139
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:


There are several ways to do this, without using midx. For example, if you want the number of live births in the past 3 years (completed months 0-35) you could do this:

gen ch_35=0
local li=1
while `li'<=6 {
replace ch_35=ch_35+1 if b19_0`li'<35
local li=`li'+1
}
tab ch_35


If you want the number of children born in the past 3 years who are still alive (b5=1) then use the following:


gen ch_35=0
local li=1
while `li'<=6 {
replace ch_35=ch_35+1 if b19_0`li'<35 & b5_0`li'==1
local li=`li'+1
}
tab ch_35


For the number of children born in the past 3 years who died (b5=0) use this:

gen ch_35=0
local li=1
while `li'<=6 {
replace ch_35=ch_35+1 if b19_0`li'<35 & b5_0`li'==0
local li=`li'+1
}
tab ch_35


For the last 5 years (months 0-59), just replace 35 with 59.

All the births in the birth histories are live births. b5 describes survival between the birth and the interview with the mother.

 
Read Message
Read Message
Previous Topic: Use of svy fxn in urban strata analysis
Next Topic: computing Concentration curves and Indices using stata
Goto Forum:
  


Current Time: Sun Aug 18 19:20:57 Coordinated Universal Time 2024