Calculating stillbirth using Ethiopia DHS 2000 [message #9859] |
Wed, 01 June 2016 07:07 |
Sami
Messages: 27 Registered: May 2016 Location: Nepal
|
Member |
|
|
Dear DHS forum,
I was trying to calculate total number of stillbirth five years preceding the survey using Ethiopia DHS 2000 individual recode data file. I could not find calander, pregnancy history and pregnancy outcome variables in this data file. Can anyone help me what variables I should be working with to calculate stillbirths for Ethiopia 2000 DHS?
Thank you heaps
Sammy
|
|
|
|
|
|
|
|
|
|
|
Re: Calculating stillbirth using Ethiopia DHS 2000 [message #10623 is a reply to message #10620] |
Fri, 19 August 2016 17:33 |
Trevor-DHS
Messages: 805 Registered: January 2013
|
Senior Member |
|
|
A few problems with the code you provided. You cannot mix the b* variables with the s2* variables and the m* variables. The b* and m* variables are for births and bidx_01 and midx_1 are the same birth, so you can use these together in a reshape command. However, the s2*, idx97* and ord97* variables are for pregnancies, not births and so idx97_01 and bidx_01 are not necessarily the same pregnancy/birth.
For the stillbirths, you don't need the b* and m* variables.
Here is a revised piece of code:
use "PKIR61FL.DTA", clear
keep caseid v001 v002 v003 v005 v008 v011 v012 v013 v021 v022 v023 v024 v025 v201 v208 v211 v212 v218 v222 v224 v225 v228 v229 v230 v231 v232 v233 v234 v235 v239 v240 v241 v242 idx97_* ord97_* s2*_*
rename *_0* *_*
local varlist idx97_ ord97_ s215_ s216_ s217_ s219_ s220m_ s220y_ s220c_ s220f_ s225c_ s225f_ s221_ s222_ s223_ s224_ s225u_ s225n_ s226m_ s226y_ s227_ s228_ s229_
* capture the variable labels
foreach v of local varlist {
di "`v'"
local l`v' : variable label `v'1
}
reshape long `varlist', i(caseid) j(idx)
* copy the variable labels back to the variables
foreach v of local varlist {
label variable `v' `"`l`v''"'
}
rename s*_ s*
rename idx97_ idx97
rename ord97_ ord97
drop if idx97==.
keep if v008-s220c < 60
gen type = .
replace type = 1 if s216==1 | s217==1
replace type = 2 if type==. & s227 >= 7 & s227 < 98
replace type = 3 if type==. & (s227 < 7 | s227 >= 98) & s228 == 1
replace type = 4 if type==. & (s227 < 7 | s227 >= 98)
lab def type 1 "Live birth" 2 "Stillbirth" 3 "Abortion" 4 "Miscarriage"
lab val type type
lab var type "Type of pregnancy"
tab type [iw=v005/1000000]
I also added code above to carry the variable labels over from before the reshape to the new variables after the reshape.
This code produces slightly more stillbirths than in the DHS report as the DHS report calculates stillbirths from the calendar where a stillbirth at the time of live birth is not included, and where twin stillbirths are only counted once. Thus this code is producing about 12 extra stillbirths than the code based on the calendar, and similarly the total pregnancies of 7 months or more is high by the same number.
|
|
|
|
Re: Calculating stillbirth using Ethiopia DHS 2000 [message #10848 is a reply to message #10623] |
Sat, 24 September 2016 02:23 |
chr8850
Messages: 20 Registered: July 2016
|
Member |
|
|
Hi Trevor,
I am doing a similar analysis with Pakistan DHS data using pretty much the same code you posted and wondered about your statement on mixing the b* m* and s* variables. Is it ok to include some of the m* (with the idx and s variables) variables in the reshape in order to look at the maternity care variables for the live and non-live births?
Regards
|
|
|
Re: Calculating stillbirth using Ethiopia DHS 2000 [message #10853 is a reply to message #10848] |
Sun, 25 September 2016 08:36 |
chr8850
Messages: 20 Registered: July 2016
|
Member |
|
|
Also just in addition to the same dataset I have a query about the index variables idx97, idx, and midx. When i look at the last live birth for each mother and tabulate that by restricting to idx==1 (or idx97 gives the same number) i get 10,476 births, but when i look at the data when midx==1 there is data for only 6,892 and the remainder appears to be missing/not applicable. Does this mean that not all of the mothers last births are included in the maternity care section? I'm just trying to understand why the data is not collected for all of the 10,476 births or if I have done something incorrectly.
|
|
|
|
|
Re: Calculating stillbirth using Ethiopia DHS 2000 [message #15678 is a reply to message #15665] |
Wed, 29 August 2018 14:44 |
Trevor-DHS
Messages: 805 Registered: January 2013
|
Senior Member |
|
|
1) The main problem you have is that you cannot reshape births and pregnancies together at the same time. Some of the variables relate to pregnancies (including births, still births, miscarriages and pregnancies) and some just to births. The b*_1 variables and the s2*_1 variables are not about the same pregnancy if the last pregnancy was not a live birth, so you cannot reshape them into the same record - you would be mixing up births and pregnancies.
For example, if a pregnancy history was like the following:
_1 Miscarriage 08/2015
_2 Live birth 06/2014
_3 Abortion 02/2012
_4 Live birth 06/2009
then the birth history would look like:
_1 Live birth 06/2014
_2 Live birth 06/2009
if you reshape the pregnancy history and birth history data together it would mix the records together as below and would not match them up properly:
_1 Miscarriage 08/2015 _1 Live birth 06/2014
_2 Live birth 06/2014 _2 Live birth 06/2009
_3 Abortion 02/2012 empty
_4 Live birth 06/2009 empty
If you need to use both history variables and pregnancy history variables then you have to reshape the pregnancy history first and save the file, and then merge it to the birth history data in the BR file.
2) In reviewing this I discovered that there were errors in the construction of the pregnancy history variables in the Nepal 2011 survey and some variables (not all) were reversed (s220c s220f s225c s225f s226c s226f sprego). Essentially the data in these variables is in the reverse order from the order for other variables, so s2nn_x has the data for s2nn_y and vice versa. The below code fixes the problem and corrects the reversal for these variables.
use "NPIR60FL.DTA", clear
rename *_0* *_*
* fix for pidx97 pord97 s220c s220f s225c s225f s226c s226f and sprego
replace s209 = 0 if s209 == .
capture gen tot_pregs = v201 + s209
capture gen flipmax = int(tot_pregs/2)
capture gen tempvar = .
* reverse values of some variables to fix errors in the data file
capture program drop flip_var
program flip_var
syntax anything if
replace tempvar = `1'_`2' `if'
replace `1'_`2' = `1'_`3' `if'
replace `1'_`3' = tempvar `if'
end
local vlist pidx97 pord97 s220c s220f s225c s225f s226c s226f sprego
* maximum of 15 entries used in pregnancy history, minimum of 2 as no need to flip when only 1 pregnancy
forvalues p = 2/15 {
forvalues i = 1/7 {
local j = `p'-`i'+1
if `j' > `i' {
foreach v of local vlist {
flip_var `v' `i' `j' if tot_pregs == `p'
di "flip_var `v' `i' `j' if tot_pregs == `p'"
}
}
}
}
drop flipmax tempvar
* end of fix for s220c s220f s225c s225f s226c s226f and sprego
The datasets will be corrected and an updated version of the data will be available in the future.
3) Below is code for reshaping the pregnancy history, after applying the corrections above, and checking the number of stillbirths in the five years preceding the interview:
* keep just the variables needed
keep caseid v001 v002 v003 v005 v008 v011 v013 v017 v018 v019 v021 v022 v023 v024 v025 v201 tot_pregs b3_1 ///
pidx97_* pord97_* bidx97_* s215_* s216_* s217_* s219_* s220m_* s220y_* s220c_* s220f_* s220a_* s221_* ///
s226m_* s226y_* s226c_* s226f_* s227_* s228_* s229_* sprego_*
* set up list for reshape
local varlist pidx97_ pord97_ bidx97_ s215_ s216_ s217_ s219_ s220m_ s220y_ s220c_ s220f_ ///
s220a_ s221_ s226m_ s226y_ s226c_ s226f_ s227_ s228_ s229_ sprego_
* capture the variable labels
foreach v of local varlist {
local l`v' : variable label `v'1
}
* reshape into long format file of pregnancies
reshape long `varlist', i(caseid) j(p)
* copy the variable labels back to the variables
foreach v of local varlist {
label variable `v' `"`l`v''"'
}
* drop the empty pregnancy records
drop if pidx97_==.
* rename the variables
rename pidx97_ pidx97
rename pord97_ pord97
rename s*_ s*
* create cmc date of pregnancy for all pregnancies
gen cmc_preg = s220c
replace cmc_preg = s226c if cmc_preg == .
* compute the weight
gen wt=v005/1000000
* tabulate outcome for births and stillbirths
tab sprego [iw=wt] if v008 - cmc_preg < 60 & sprego <= 2
* tabulate outcome dropping stillbirth twin of live birth to match calendar approach
tab sprego [iw=wt] if v008 - cmc_preg < 60 & s226c != b3_1 & sprego <= 2
In the last line I restrict the tabulation of the live and still births to exclude stillbirths that are twins of a live birth. This is to match the number of stillbirths from the calendar where a stillbirth that is a twin of a live birth is not shown in the calendar as only one character can be included in any month of the calendar and the births take precedence.
4) You have also included some m*_ variables in your list of variables, but these also cannot be reshape with the pregnancy history as this series is only for live births and you would be mixing births and pregnancies as in 1) above. It is also of no use to link the m* series of variables as there is no data for non-live births. This also answers the question from chr8850 as there is no maternity data collected for non-live births.
[Updated on: Thu, 30 August 2018 11:39] Report message to a moderator
|
|
|
|
|
|
|
Re: Calculating stillbirth using Ethiopia DHS 2000 [message #15696 is a reply to message #15690] |
Thu, 30 August 2018 20:28 |
Sami
Messages: 27 Registered: May 2016 Location: Nepal
|
Member |
|
|
Dear Trevor,
Thank you very much for all your support throughout. i can immagine it could not have have been resolved by me anyway. One last quarry: I used 'pregint' variable to contstruct Previous pregnancy interval in months; but i could not match the number as shown in the Nepal DHS 2011 report(table 8.4).
Your guidence on above matter would be highly appricated.
Thank you.
Sammy
[Updated on: Thu, 30 August 2018 20:45] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|