The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Child mortality
Child mortality [message #15595] Sun, 19 August 2018 08:42 Go to next message
Eman Dahab is currently offline  Eman Dahab
Messages: 3
Registered: August 2018
Location: Egypt
Member

Dears
I am trying to calculate the infant and under five child mortality rates using the DHS row dataset 2014 for Egypt, i need the SPSS or STATA syntax for calculating the child mortality, so i highly appreciate if you can help me and share the syntax.

Looking forward to hearing from you
Best regards; Eman
Re: Child mortality [message #15619 is a reply to message #15595] Fri, 24 August 2018 10:10 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
Please follow this thread for message# 15608 by Trevor Croft
Thank you!
Re: Child mortality [message #15722 is a reply to message #15619] Thu, 06 September 2018 10:21 Go to previous messageGo to next message
Eman Dahab is currently offline  Eman Dahab
Messages: 3
Registered: August 2018
Location: Egypt
Member

Dear
Thanks a lot for your replay, i tried to use the do-file, but i had an error starting from " Loop through 5-year time periods " step, that the commands are not written correctly
so appreciate if you could help, and i highly appreciate if you can send me a syntax in SPSS format if it's available.
Your response is highly needed and appreciated

Best regards; Eman
Re: Child mortality [message #15743 is a reply to message #15722] Mon, 10 September 2018 09:29 Go to previous messageGo to next message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User, Please share your code. Other users from the user community may be able to help if they can look at your code. thank you!
Re: Child mortality [message #15791 is a reply to message #15743] Mon, 17 September 2018 07:02 Go to previous messageGo to next message
Eman Dahab is currently offline  Eman Dahab
Messages: 3
Registered: August 2018
Location: Egypt
Member

Dear this is the stata code for your kind review


* Open DHS dataset - births recode file
use v005 v008 b3 b5 b7 using "IABR71FL.DTA", clear

* Create variables for time period limits - need to use variables as these change from case to case
gen t1 = .
gen t2 = .
* Initialize local variable lists used later
local vlist
local vlist2

* Loop through 5-year time periods
forvalues period = 0/4 {

* Calculate upper limit of time period
replace t2 = v008 - 60*`period'
* Calculate lower limit of time period
replace t1 = t2 - 60
* List age group lower limits
local agegroups 0 1 3 6 12 24 36 48 60
* Turn thse into tokens to use for the upper limits of the age groups
tokenize `agegroups'
* Loop through the age groups
foreach age of numlist `agegroups' {
* Ignore the 60+ age group - this was just to set the upper limit for the last age group - see a2
if (`age' < 60) {
* Create local for lower limit of age group - use locals as these are constants
local a1 = `age'
* Create local for upper limit of age group = the lower limit of the next age group
local a2 = `2'

* Cohort A numerator
gen numA`age'_`period' = ((`a1' <= b7 & b7 < `a2') & (t1 - `a2' <= b3 & b3 < t1 - `a1'))
* Cohort B numerator
gen numB`age'_`period' = ((`a1' <= b7 & b7 < `a2') & (t1 - `a1' <= b3 & b3 < t2 - `a2'))
* Cohort C numerator
gen numC`age'_`period' = ((`a1' <= b7 & b7 < `a2') & (t2 - `a2' <= b3 & b3 < t2 - `a1'))
* Cohort A denominator
gen denA`age'_`period' = ( (b5 == 1 | `a1' <= b7) & (t1 - `a2' <= b3 & b3 < t1 - `a1'))
* Cohort B denominator
gen denB`age'_`period' = ( (b5 == 1 | `a1' <= b7) & (t1 - `a1' <= b3 & b3 < t2 - `a2'))
* Cohort C denominator
gen denC`age'_`period' = ( (b5 == 1 | `a1' <= b7) & (t2 - `a2' <= b3 & b3 < t2 - `a1'))

* Count half for deaths for cohort C, except for the last period where all deaths are counted
local f = 0.5
if (`period' == 0) {
local f = 1
}
* Sum numerators from cohorts A, B and C for this case
gen num`age'_`period' = 0.5*numA`age'_`period' + numB`age'_`period' + numC`age'_`period'*`f'
* Sum denominators from chorts A, B and C for this case
gen den`age'_`period' = 0.5*denA`age'_`period' + denB`age'_`period' + denC`age'_`period'*0.5

* Generate list of numerator and denominator variables for period and age for collapse command below
local vlist `vlist' num`age'_`period' den`age'_`period'
* Similarly generate list of numerator and denominator variables for period only for reshape command below
if (`period' == 0) {
local vlist2 `vlist2' num`age'_ den`age'_
}
}
* Shift the token list to the next age group
mac shift
}
}


* Sum all numerators and denominators - weighted sum
collapse (sum) `vlist' [pw=v005/1000000]

* Add a variable to act as ID for the reshape
gen x = 0
* Reshape long by age group
reshape long `vlist2', i(x) j(period)
* Drop the underscore (_) on the end of variable names
rename *_ *

* Reshape now for periods
reshape long num den, i(period) j(a1)
* Drop the x variable as we no longer need it
drop x

* Generate the upper bounds of the age groups
gen a2 = a1[_n+1]
replace a2 = 60 if a1 == 48

* Calculate the age group mortality probabilities
gen death = num / den
* Calculate the age group survival probabilities
gen surv = 1 - death

* Generate product of survival probabilities:
gen prodsurv = surv if a1 == 0
replace prodsurv = surv * prodsurv[_n-1] if a1 > 0
* Generate product of survival probabilities for child mortality rate, starting at 12 months
gen prodsurv2 = surv if a1 == 12
replace prodsurv2 = surv * prodsurv2[_n-1] if a1 > 12

* Neonatal mortality rate
gen nmr = 1000*(1-prodsurv) if a2 == 1
* Postneonatal mortality rate (calculated later)
gen pnmr = .
* Infant mortality rate
gen imr = 1000*(1-prodsurv) if a2 == 12
* Child mortality rate
gen cmr = 1000*(1-prodsurv2) if a2 == 60
* Under-five mortality rate
gen u5mr = 1000*(1-prodsurv) if a2 == 60

* Capture just the rates
collapse (min) nmr pnmr imr cmr u5mr, by(period)

* Postneonatal mortality rate = IMR - NMR
replace pnmr = imr - nmr



Re: Child mortality [message #15797 is a reply to message #15791] Mon, 17 September 2018 10:55 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
Dear User,
We have an updated resource: The Guide to DHS Statistics. You can fully search this document. Please review. After reviewing, if you still need assistance, feel free to post again. In the meantime, other users may be able to assist by reviewing your code.
Thank you!
Previous Topic: Ethical Approval
Next Topic: Measle vaccine coverage in Rwanda RDHS 2014-15
Goto Forum:
  


Current Time: Tue Oct 15 18:56:51 Coordinated Universal Time 2024