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)
2017 Ghana Maternal Health Survey [message #16558] Thu, 24 January 2019 15:49 Go to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
I have some few some issues with the recent 2017 Ghana Maternal Health Survey. The variable (total pregnancy outcomes) in the Stata version (q208b) in the individual raw data which I assume refers all pregnancies a woman has ever had (sample = 18,116). In the children's raw data, there is a similar variable (pregout) also referring to pregnancy outcomes (sample = 19,324). If I merge the child raw data to the individual raw data, the sample is 19,324 as in the child's raw data. So if these two variables represent the total number of pregnancies a woman has ever had and now I want to limit the total number of pregnancies to 5 years preceding the survey (2012 - 2017). How do I go about this?

Your timely response will be very helpful.
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 next message
lmallick is currently offline  lmallick
Messages: 6
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 53 times)
Re: 2017 Ghana Maternal Health Survey [message #17825 is a reply to message #17824] Tue, 18 June 2019 14:44 Go to previous messageGo to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Thank you very much for this response. I want to clarify one more thing. Does this syntax also applies to the number of abortions, miscarriages, and stillbirths in the last 5 years?
Re: 2017 Ghana Maternal Health Survey [message #17826 is a reply to message #17825] Tue, 18 June 2019 15:37 Go to previous messageGo to next message
lmallick is currently offline  lmallick
Messages: 6
Registered: June 2019
Member
The variable called pregall5yr would include all pregnancies in the last 5 years. You could cross tabulate pregall5yr with pregout and find out the number and percent of pregnancies ending in each potential outcome.

tab pregall5yr pregout [iw=wt], row freq
Re: 2017 Ghana Maternal Health Survey [message #17899 is a reply to message #16558] Tue, 09 July 2019 15:45 Go to previous messageGo to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Hello,

I still have some follow up questions on the 2017 Ghana Maternal Health Survey:

Q1. If I merge the raw births record file to the individual record file and then limit all pregnancy in the last 5 years and then apply the tab pregall5yr pregout [iw=wt], row freq for the number of pregnancy outcomes for the last 5 years (abortion, miscarriage and stillbirth). I want to create similar variables in the individual record file (q207a, q207b, q207c, q207d, q207e, q207f) for the last five years). Is there a way to create binary variables (0=No, 1=Yes) for abortion, miscarriage, and stillbirths in the last 5 years using the pregout variables). How to I create similar variables for (q207b q207d q207f) for pregnancies in the last 5 years?

Q2. What is the difference in the questions in the individual record file (q207b, q207d, q207f) and (q224a q224ay q224b q224by q224d)? Which ones are the index abortion, miscarriage, and stillbirth?

Q3. Is it possible to calculate the duration (weeks or months) of each pregnancy in the last 5 years to create a variable called "Preterm birth" (0=less than 37 weeks, 1= above 37 weeks).

Thank you.
Re: 2017 Ghana Maternal Health Survey [message #17905 is a reply to message #17826] Thu, 11 July 2019 13:18 Go to previous messageGo to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Hello,

I still have some follow up questions on the 2017 Ghana Maternal Health Survey:

Q1. If I merge the raw births record file to the individual record file and then limit all pregnancy in the last 5 years and then apply the tab pregall5yr pregout [iw=wt], row freq for the number of pregnancy outcomes for the last 5 years (abortion, miscarriage and stillbirth). I want to create similar variables in the individual record file (q207a, q207b, q207c, q207d, q207e, q207f) for the last five years). Is there a way to create binary variables (0=No, 1=Yes) for abortion, miscarriage, and stillbirths in the last 5 years using the pregout variables). How to I create similar variables for (q207b q207d q207f) for pregnancies in the last 5 years?

Q2. What is the difference in the questions in the individual record file (q207b, q207d, q207f) and (q224a q224ay q224b q224by q224d)? Which ones are the index abortion, miscarriage, and stillbirth?

Q3. Is it possible to calculate the duration (weeks or months) of each pregnancy in the last 5 years to create a variable called "Preterm birth" (0=less than 37 weeks, 1= above 37 weeks).

Q4. If I merge the raw births record file to the individual record file, and I do a cross tab of the year of most recent abortion (q501)for raw birth recode file and could decide on your own to get an abortion (q578_1) for individual file, there is nothing the q578_1.

Thank you.
Re: 2017 Ghana Maternal Health Survey [message #18023 is a reply to message #17905] Mon, 19 August 2019 14:38 Go to previous messageGo to next message
lmallick is currently offline  lmallick
Messages: 6
Registered: June 2019
Member
Dear user,

Response to Q1: The answer to this question depends on what you want to do- More information is needed about your research question in order to instruct the merge. Whether you merge the BQ file into the IR file or vice versa will depend on your intended unit of analysis. If you merge BQ into IR file, think about how you want to collapse the pregnancy history to the individual file- do you want to know if the woman, in the pregnancy history, reported ever having a miscarriage, for example? Or do you want to know the total number of miscarriages? You can create a dummy variable for outcome of each pregnancy in the BQ file with the command:

ta pregout, gen(pregout_dummy)

Response to Q2: Please refer to Appendix F (the questionnaire) to see how the different questions are posed. Q207 series asks about ever experience of terminated pregnancies and stillbirths, while the Q224 series is the pregnancy outcome for each pregnancy a woman has had.

Response to Q3: The survey only asked about gestational length of terminated pregnancy in terms of months.

Response to Q4: If you look in the questionnaire at the beginning of Section 5:Abortion, you will see that women who have had an abortion in the last 5 years were asked questions 502-574/5, then skipped to Q581. So only women who never had an abortion could have answered 578, so it is correct that a cross tab of q501 and q578_1 would be blank.

Thank you,
Lindsay Mallick
Re: 2017 Ghana Maternal Health Survey [message #18024 is a reply to message #18023] Mon, 19 August 2019 15:12 Go to previous messageGo to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Q1. My intention is to merge the BQ file into the IR file and limit it to the 5 years preceding the survey. My intention specifically is to know if a women has ever reported an abortion, a miscarriage or a still birth. And then create a dummy variables for the pregnancy outcomes (0= No (for women who haven't experienced any of these outcomes, 1= Yes (for women who have experience these pregnancy outcomes.

If a woman has ever reported an abortion, a miscarriage or a still: how many number of abortion, miscarriages, or stillbirths has a woman reported within 5 years preceding the survey? I hope this is clear?
A major challenge in merging the BQ file to the IR file is that after merging, the numbers are bloated.

[Updated on: Mon, 19 August 2019 15:24]

Report message to a moderator

Re: 2017 Ghana Maternal Health Survey [message #18025 is a reply to message #18024] Mon, 19 August 2019 15:50 Go to previous messageGo to next message
lmallick is currently offline  lmallick
Messages: 6
Registered: June 2019
Member
Then I would try to collapse the BQ file to what would be the caseid in an IR file: qhclust qhnumber qline using a count of each of the dummy pregnancy variables that you could create using the line above.

Does this help:

use GHBQ7IFL.DTA, clear

gen wt = qweight/1000000

ta pregout, gen(pregout_dummy)
sort qhclust qhnumber qline
collapse (count) live = pregout_dummy1 ///
still = pregout_dummy2 ///
miscar = pregout_dummy3 ///
abor = pregout_dummy4 ///
, by(qhclust qhnumber qline)

save GHpregout.dta, replace

use GHIQ7IFL.dta, clear

merge 1:1 qhclust qhnumber qline using GHpregout

Once merged, you could create a binary variable for ever had an abortion (Y/N) if abor is greater than or equal to 1. Then you could cross tab with q578_1.
Re: 2017 Ghana Maternal Health Survey [message #18028 is a reply to message #18025] Tue, 20 August 2019 13:34 Go to previous messageGo to next message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Thanks so much for your help. But if I merged that, the results are the same for all pregnancy outcomes:

For instance in the IR file q207a q207b q207c q207d q207e are binary variables. I want a clarification if these variables asked women if they have ever had an abortion, a miscarriage or stillbirth 5 years preceeding the survey. And if they are not how do I create similar variables related to the q207 series of questions.

Similarly, you will notice that in the IR file, q207b q207d q207f asked about the number of pregnancy outcomes for each individual woman, are these outcomes limited to the 5 years preceeding the survey? You will recalled that, I once asked about limiting the sample of women who had ever had a pregnancy within 5 years before the survey.



tab live

(count) |
pregout_dum |
my1 | Freq. Percent Cum.

1 | 3,154 17.41 17.41
2 | 2,952 16.29 33.71
3 | 2,857 15.77 49.48
4 | 2,548 14.06 63.54
5 | 2,093 11.55 75.09
6 | 1,695 9.36 84.45
7 | 1,178 6.50 90.95
8 | 824 4.55 95.50
9 | 424 2.34 97.84
10 | 244 1.35 99.19
11 | 79 0.44 99.62
12 | 46 0.25 99.88
13 | 12 0.07 99.94
14 | 7 0.04 99.98
15 | 2 0.01 99.99
16 | 1 0.01 100.00

Total | 18,116 100.00


tab miscar

(count) |
pregout_dum |
my3 | Freq. Percent Cum.

1 | 3,154 17.41 17.41
2 | 2,952 16.29 33.71
3 | 2,857 15.77 49.48
4 | 2,548 14.06 63.54
5 | 2,093 11.55 75.09
6 | 1,695 9.36 84.45
7 | 1,178 6.50 90.95
8 | 824 4.55 95.50
9 | 424 2.34 97.84
10 | 244 1.35 99.19
11 | 79 0.44 99.62
12 | 46 0.25 99.88
13 | 12 0.07 99.94
14 | 7 0.04 99.98
15 | 2 0.01 99.99
16 | 1 0.01 100.00

Total | 18,116 100.00

(count) |
pregout_dum |
my4 | Freq. Percent Cum.
------------+-----------------------------------
1 | 3,154 17.41 17.41
2 | 2,952 16.29 33.71
3 | 2,857 15.77 49.48
4 | 2,548 14.06 63.54
5 | 2,093 11.55 75.09
6 | 1,695 9.36 84.45
7 | 1,178 6.50 90.95
8 | 824 4.55 95.50
9 | 424 2.34 97.84
10 | 244 1.35 99.19
11 | 79 0.44 99.62
12 | 46 0.25 99.88
13 | 12 0.07 99.94
14 | 7 0.04 99.98
15 | 2 0.01 99.99
16 | 1 0.01 100.00
------------+-----------------------------------
Total | 18,116 100.00



Re: 2017 Ghana Maternal Health Survey [message #18029 is a reply to message #18028] Tue, 20 August 2019 14:05 Go to previous messageGo to next message
lmallick is currently offline  lmallick
Messages: 6
Registered: June 2019
Member
Dear user,

Please try to collapse using sum instead of count. That should work- but I didn't try it.

Any additional Stata questions I would recommend asking or searching for Stata posts; answering questions related to manipulating data using Stata or other programs is somewhat outside the scope of DHS staff role in the forum.

Q207 question series are not limited to women with a birth in the last 5 years, but you can tabulate that in the dataset to check. Please refer to the questionnaire posted at the end of the final report if you need more information on how the questions are phrased or to review any filters.

Thank you,
Lindsay
Re: 2017 Ghana Maternal Health Survey [message #18030 is a reply to message #18029] Tue, 20 August 2019 14:20 Go to previous message
ebanchani is currently offline  ebanchani
Messages: 7
Registered: January 2019
Member
Thank you so much for your help. I'm much grateful.

Emmanuel
Previous Topic: Family Planning in young women
Next Topic: family structure
Goto Forum:
  


Current Time: Tue Sep 17 17:32:06 Eastern Daylight Time 2019