The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Kenya » Table 5.12 in KDHS 2022 Report
Table 5.12 in KDHS 2022 Report [message #27752] Fri, 29 September 2023 10:30 Go to next message
sokiya is currently offline  sokiya
Messages: 80
Registered: May 2017
Location: Nairobi
Senior Member
Hi,

I am trying to replicate table 5.12 in KDHS 2022 Report using attached do file but I can't seem to see the indicator on ever been pregnant. Any help will be appreciated.
Thanks in advance!
Stephen.
  • Attachment: FE_FERT.do
    (Size: 9.11KB, Downloaded 109 times)
Re: Table 5.12 in KDHS 2022 Report [message #27775 is a reply to message #27752] Mon, 02 October 2023 09:44 Go to previous messageGo to next message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3208
Registered: February 2013
Senior Member
Following is a response from Senior DHS staff member, Tom Pullum:

Below I will paste the Stata code to construct the indicators in table 5.12, on Teenage Pregnancy, in the Kenya 2022 report. I just wrote this as a one-off program but I believe it is included in the new GitHub programs for DHS-8 surveys. The pregnancy history variable p32 is crucial for new tables such as this one.

use "...KEIR8AFL.DTA", clear

* Construct table 5.12, teenage pregnancy for Kenya 2022 DHS survey
* Two columns can be constructed without the pregnancy history
* Two columns require the pregnancy history

* v201: number of live births
* v213: currently pregnant


gen ever_birth=0
replace ever_birth=100 if v201>0

gen curr_preg=0
replace curr_preg=100 if v213==1


* ever_loss and ever_preg require the use of p32_*
label list P32_01

*remove leading zeros
rename *_0* *_*

gen nlosses=0
forvalues lp=1/20 {
replace nlosses=nlosses+1 if p32_`lp'>1 & p32_`lp'<.
}

gen ever_loss=0
replace ever_loss=100 if nlosses>0

gen ever_preg=0
replace ever_preg=100 if p32_1<. | v213==1

label variable ever_birth "Ever had a live birth"
label variable ever_loss  "Ever had a pregnancy loss"
label variable curr_preg  "Currently pregnant"
label variable ever_preg  "Ever pregnant"

local lcovars v012 v025 v106 v190
foreach lc of local lcovars {
tabstat ever_birth ever_loss curr_preg ever_preg [fweight=v005] if v013==1, statistics(mean) by(`lc') format(%6.1f)
}

Re: Table 5.12 in KDHS 2022 Report [message #28068 is a reply to message #27775] Tue, 07 November 2023 11:58 Go to previous message
sokiya is currently offline  sokiya
Messages: 80
Registered: May 2017
Location: Nairobi
Senior Member
Thanks so much for the help. I sincerely appreciate
Previous Topic: KDHS 2014 : Table 14.10.1 Health insurance coverage: Women
Next Topic: Figure 10.1 Trends in childhood vaccinations
Goto Forum:
  


Current Time: Thu Dec 12 22:02:58 Coordinated Universal Time 2024