Home » Countries » Ethiopia » Calculating stillbirth using Ethiopia DHS 2000
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.
|
|
|
 |
|
Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Wed, 01 June 2016 07:07
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 06 June 2016 10:15
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 06 June 2016 10:20
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 06 June 2016 22:19
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Fri, 24 June 2016 02:13
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Thu, 18 August 2016 21:41
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 22 August 2016 06:54
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: chr8850 on Sat, 24 September 2016 02:23
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: chr8850 on Sun, 25 September 2016 08:36
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 30 January 2017 05:38
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Tue, 28 August 2018 21:03
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Wed, 29 August 2018 15:50
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Mon, 08 October 2018 02:42
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Wed, 29 August 2018 16:29
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Sami on Thu, 30 August 2018 20:28
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Abe Kiyu on Wed, 29 January 2020 08:00
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
By: Abe Kiyu on Fri, 21 February 2020 01:47
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Ethiopia DHS 2000
|
 |
|
Re: Calculating stillbirth using Pakistan DHS 2006-07
|
 |
|
Re: Calculating stillbirth using Pakistan DHS 2006-07
|
Goto Forum:
Current Time: Wed Mar 12 07:19:10 Coordinated Universal Time 2025
|