The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Mortality » Calculating perinatal death
Calculating perinatal death [message #30363] Wed, 13 November 2024 02:45 Go to next message
fahmidarima7 is currently offline  fahmidarima7
Messages: 4
Registered: August 2023
Member
**For ENMR, use BR file*****
* create a child Alive or Died variable using the b5 variable
gen alive=b5
lab def alive 0 "Died" 1 "Alive"
lab val alive alive
lab var alive "Alive or Died by the time of survey"

** Age at death using variables b6 and b5
gen age_death=.
replace age_death = 0 if b6<=106 & b5==0
replace age_death = 1 if b6>=107 & b6<=130 & b5==0
replace age_death = 2 if (b6> 130 & b6<=999) | b5==1
lab def age_death 0 "Early Neonatal Death" 1 "Late Neonatal Death" 2 "Survived Neonatal Period"
lab val age_death age_death
lab var age_death "Neonatal Mortality Status"
tab age_death

gen wt=v005/1000000
svyset v021 [pw=wt], strata(v023)

svy: tab age_death if v008-b3<60, per count form(%7.3g)
svy: tab age_death if v008-b3<60, per col form(%7.3g)
************************************************************ *******************************

************************************************************ ************************************
**For stillbirth, use IR file***
*Calculate still births in the last 5 years
gen stillbirths = 0
gen births = 0
gen nlbirths = 0

*Set length of calendar to use
gen callen = v018 + 59
* If calendar is aligned right (as in original dataset), use the following:
gen beg = v018
gen end = callen
* If calendar is aligned left (as it appears to be), use the following:
*gen beg = 1
*gen end = 60
* Loop through calendar summing births, non-live pregnancies and stillbirths
forvalues i = 1/80 {
replace births = births+1 if `i' >= beg & `i' <= end & substr(vcal_1,`i',1) == "B"
replace nlbirths = nlbirths+1 if `i' >= beg & `i' <= end & substr(vcal_1,`i',1) == "T"
replace stillbirths = stillbirths+1 if `i' >= beg & `i' <= end & substr(vcal_1,`i',7) == "TPPPPPP"
}

* total pregnancies in last 5 years
gen totpreg5 = births+nlbirths
* total pregnancies of 7+ months in last 5 years (all live births, plus the stillbirths)
gen totpreg7m = births+stillbirths

* Create weight variable.
gen wgt = v005/1000000

* Set up svyset parameters for complex samples.
svyset v021 [pweight=wgt], strata(v023)

* Produce number of stillbirths
svy: tab stillbirths, cell count
************************************************************ ***************************************
******Merge BR and IR file*****************************
* preamble
numlabel,add
set more off
clear
////merge birth recode and individual recode/////
//merge with individual recode
use "/Users/Documents/BDIR81DT/BDIR81FL.DTA"

**BR file***
use "/Users/Documents/BDBR81DT/BDBR81FL.DTA", replace

keep b3 b5 b6 v005 v008 v021 v023

**merge**
merge 1:1 _n using "/Users/Documents/BDIR81DT/BDIR81FL.DTA"

keep if _merge==3
*******************************************************
I have prepared a syntax for calculating the perinatal mortality rate in Stata with guidance from this forum. However, my results do not match the numbers in the official report, and I am unsure where I might have gone wrong. Could you please review my syntax to help identify any errors? Additionally, I am finding the syntax on GitHub for calculating perinatal deaths quite complex. If possible, could you provide a simplified version of perinatal death equation in Stata?
Re: Calculating perinatal death [message #30374 is a reply to message #30363] Fri, 15 November 2024 19:42 Go to previous messageGo to next message
Janet-DHS is currently offline  Janet-DHS
Messages: 893
Registered: April 2022
Senior Member
Following is a response from DHS staff member, Tom Pullum:

With DHS-8 data and the birth histories it is now much easier to calculate the perinatal mortality rate. I will paste below the Stata lines to do it, using the new GR file. It includes code for one covariate (wealth quintiles) and the total.

We have written new Stata code for Chapters 5 and 8 but it may not yet be posted on the GitHub site.

* Table 8.4 in Bangladesh 2022 DHS final report

* Use the GR file for DHS8 surveys

 

use "...BDGR81FL.DTA", clear

 

* Reduce the file to births and stillbirths in months 0-59 before the survey

keep if p19<60 & (p32==1 | p32==2)

 

gen wt=v005/1000000

 

* Construct the outcome variables

 

gen stillbirth=0

gen  enn_death=0

replace stillbirth=1 if p32==2

replace  enn_death=1 if p32==1 & p6<=106

 

replace stillbirth=stillbirth*wt

replace enn_death=enn_death*wt

gen case=wt

 

collapse (sum) stillbirth enn_death case, by(v190)

gen st_rate=1000*stillbirth/case

gen enn_rate=1000*enn_death/case

gen peri_rate=st_rate+enn_rate

gen ratio=stillbirth/enn_death

list, table clean

 

collapse (sum) stillbirth enn_death case

gen st_rate=1000*stillbirth/case

gen enn_rate=1000*enn_death/case

gen peri_rate=st_rate+enn_rate

gen ratio=stillbirth/enn_death

list, table clean
Re: Calculating perinatal death [message #30425 is a reply to message #30374] Wed, 27 November 2024 01:22 Go to previous message
fahmidarima7 is currently offline  fahmidarima7
Messages: 4
Registered: August 2023
Member
Wow, it's great! I also want to know regarding essential newborn care, if data on "baby dried <5 min of birth" and "baby wrapped <5 min of birth" are available in DHS-8. If so, could you let me know the variable numbers.
Previous Topic: Pregnancy duration from vcal_1
Next Topic: Children ever death and children ever died
Goto Forum:
  


Current Time: Wed Nov 27 13:53:33 Coordinated Universal Time 2024