The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Pakistan DHS (2012-13) Stillbirth variable
Pakistan DHS (2012-13) Stillbirth variable [message #13248] Mon, 09 October 2017 02:56 Go to next message
jahm3675 is currently offline  jahm3675
Messages: 2
Registered: August 2017
Location: Sydney
Member
Hi

I have run the following codes for the Pakistan DHS 2012-13 to calculate the stillbirth variable but it gives me 351 stillbirths and 11634 live births instead of 412 stillbirths in the 5 years preceding the survey (or 401 in table 5.15) in the DHS report.

Can anyone help, where I have done the error or why is such a huge difference in the numbers.

Thanks

gen pregs = 0

forvalues i = 1/80 {
gen cmc`i' = V017 + 80 - `i'
gen event`i' = substr(VCAL_1, `i', 1)
gen type`i' = .
replace type`i' = 1 if substr(VCAL_1,`i',1) == "B"
replace type`i' = 3 if substr(VCAL_1,`i',1) == "T"
replace type`i' = 2 if substr(VCAL_1,`i',7) == "TPPPPPP"
replace pregs = pregs+1 if (substr(VCAL_1,`i',1) == "B" | substr(vcal_1,`i',1) == "T")
}
* Drop cases with no pregnancies
drop if pregs == 0

reshape long cmc event type, i(CASEID) j(ix)

lab def type 1 "Birth" 2 "Stillbirth" 3 "Miscarriage/abortion"
lab val type type
lab var type "Type of pregnancy"
lab var cmc "Century month code of event"
lab var event "Calendar event code"

* 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 is in some datasets), use the following:
*gen beg = 1
*gen end = 60

* Include only the five year period
keep if ix >= beg & ix <= end

* Create weight variable.
gen wgt = V005/1000000

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


* check the pregnancy types
tab type [iw=V005/1000000]

* keep only births and stillbirths
keep if type == 1 | type == 2

* Produce number of stillbirths
svy: tab type, cell count


Re: Pakistan DHS (2012-13) Stillbirth variable [message #14136 is a reply to message #13248] Thu, 22 February 2018 17:23 Go to previous message
Liz-DHS
Messages: 1516
Registered: February 2013
Senior Member
User has sorted out.

[Updated on: Fri, 23 February 2018 09:38]

Report message to a moderator

Previous Topic: Unintended pregnancy and contraception use
Next Topic: Early neonatal mortality variable
Goto Forum:
  


Current Time: Fri Dec 27 09:58:18 Coordinated Universal Time 2024