The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » 2017 Ghana Maternal Health Survey (Total Pregnancy Outcomes)
Re: 2017 Ghana Maternal Health Survey [message #17824 is a reply to message #16558] Tue, 18 June 2019 12:09 Go to previous messageGo to previous message
lmallick is currently offline  lmallick
Messages: 22
Registered: June 2019
Member
Dear user,

You will need to use the BQ file, which is typically the raw births record file. In the case of the Ghana Maternal Health Survey, it houses the pregnancy history. The unit of analysis in this file is pregnancies. If you are seeking to identify the pregnancies in the last 5 years, you can use the code below. Please note that in the coming weeks, The DHS Program will release a recode file which may be easier to work with.

use GHBQ7IFL.DTA, clear

*generate weight
gen wt = qweight/1000000

*time in months since birth/termination using cdc
gen pregend = int((qintcd - q215cd)/ 30.4375)

*all pregnancies that occured in the last 5 years
gen pregall5yr = 1 if pregend <60

However, if you want to examine only the pregnancies that resulted in a live or still birth and were the most recent live or stillbirth (in order to match tables in Chapter 5, you would need to go a few extra steps.

*all pregnancies in the last 5 years that resulted in a live or stillbirth
gen pregbirth5yr = 1 if pregall5yr ==1 & pregout <3

*most recent pregnancies in the last 5 years that resulted in a live or stillbirth
*this is to match the tables in Chapter 5
*first create a variable that is the total number of children born alive or still born
egen maxbirth = max(q212) if pregout<3, by(qline qhnumber qhclust)

*then flip the variable so 1 is the most recent birth
gen flipq212= (1 + maxbirth) - q212

*if pregnancy ended in a live or stillbirth in the last 5 years
gen birth5yrmr = 1 if pregbirth5yr ==1 & pregout <3 & flip==1

ta birth5yrmr [iw=wt]


*the denominator for most tables in chapter 5
*will need to limit to two years (if pregend <24) for postnatal care questions


Thank you,
Lindsay Mallick
Lead Research Analyst
The DHS Program
  • Attachment: BQ raw.do
    (Size: 1.10KB, Downloaded 422 times)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Family Planning in young women
Next Topic: Merging dataset (IR and KR) of Pakistan 2017-18
Goto Forum:
  


Current Time: Tue Dec 24 08:58:57 Coordinated Universal Time 2024