The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Reproductive Health » Kenya 2022 DHS - Postnatal Care (Replicating county level indicators for PNC indicators )
Kenya 2022 DHS - Postnatal Care [message #28560] Tue, 30 January 2024 17:29 Go to previous message
valeriekscott is currently offline  valeriekscott
Messages: 1
Registered: January 2024
Member
Dear all,

I am working with Kenya 2022 DHS data and attempting to replicate county-level statistics for the variable "Percentage of women
with a postnatal check during the first 2 days after birth" from the published full report table Table 9.11C Timing of first postnatal check for the mother by county. I am using the DHS-Indicators-Stata repository of code from the DHS program codeshare at https://github.com/DHSProgram and just slightly updating the code to be specific to Kenya 2022. When I attempt to replicate the county estimates for this table, most of the counties match exactly, but my code produces slight overestimates for 19 of the counties. I think this: 1) must be something specific to code changes needed for the Kenya data; 2) my code produces correct Ns; and 3) my code only produces overestimates and not underestimates, so it seems there is something about my construction of the variable rh_pnc_wm_2days that gives me a slightly higher numerator. Possibly something with the coding for type of health worker...I'm attaching here the relevant survey question from the Kenya women's long questionnaire.

/index.php?t=getfile&id=2245&private=0

The DHS code share project uses three do files: !RH_main.do to run the other two do files, RH_PNC.do to generate the indicators, and RH_tables.do to generate the tables. I attempted to copy below only the relevant code to this particular variable. I think the problem must be in the variable construction done in RH_PNC.do. I think the weights were applied correctly using iweight. I didn't use svyset, but don't think that's necessary for descriptive statistics. I believe the variable was correctly restricted to livebirths only (m80==1) as done in the published report table. Would be grateful for any thoughts you might have on why I am getting these overestimates!

Thank you in advance for any help :)


***********************
//!RH_main.do
***********************

*** User information for internal DHS use. Please disregard and adjust paths to your own. ***

cd "insertfilepath"

global datapath "insertfilepath"


* select your survey
* NR Files
global nrdata "KENR8BDT/KENR8BFL"

****************************

* open dataset
use "$datapath/$nrdata.dta", clear

cap label define yesno 0"No" 1"Yes"

gen file=substr("$nrdata", 3, 2)

*keep if birth if under 24 months and is last live birth or last still birth
keep if p19 < 24 & (m80 == 1 | m80 == 3)

/*! Note: the ANC and PNC indicators have three denominators reported in the DHS Final reports.
To match the livebirths only, tabulate the indicators with the condition m80==1
To match the stillbirths only, tabulate the indicators with the condition m80==3
To match live births and stillbirths, tabulate the indicators with the condition (_n == 1 | caseid != caseid[_n-1]) to keep either the last livebirth or last stillbirth.
For ANC components indicators there is an additional condition to select for women who have had at least one ANC visit or all women.
*/

*
do RH_ANC.do
*Purpose: Code ANC indicators

*
do RH_PNC.do
*Purpose: Code PNC indicators for mother and newborn

*
do RH_tables.do
*Purpose: Produce tables ANC and PNC indicators computed from above do files.


***********************
//RH_PNC.do
***********************
Variables created in this file:
rh_pnc_wm_timing "Timing after delivery for mother's PNC check"
rh_pnc_wm_2days "PNC check within two days for mother"
rh_pnc_wm_pv "Provider for mother's PNC check"

*** Mother's PNC ***

//PNC timing for mother
*did the mother have any check
gen momcheck = 0 if p19<24 // baby under age 24 months
replace momcheck = 1 if (m62==1 | m66==1) & p19<24 // m62=Respondent's health checked before discharge; m66=Respondent's health checked after discharge/delivery at home

*create combined timing variable
gen pnc_wm_time = 999 if (p19<24 & momcheck==1)

*start with women who delivered in a health facility with a check
replace pnc_wm_time = m63 if inrange(m64,11,22) & p19<24 // m63=How long after delivery respondent's health check took place before discharge; m64=Who checked respondent health before discharge if in range between 11 (doctor) and 22 (CHW)

*Account for provider of PNC- country specific- see table footnotes
replace pnc_wm_time = 0 if (pnc_wm_time < 1000 & m64 >22 & m64 < 100 & p19<24)

*Add in women who delivered at home with a check
replace pnc_wm_time = m67 if (pnc_wm_time == 999 & inrange(m68,11,22) & p19<24) // m67=How long after discharge/delivery at home respondent health check took place; m68=Who checked respondent health after discharge/delivery at home

*Account for provider of PNC- country specific- see table footnotes
replace pnc_wm_time = 0 if m67 < 1000 & m68 >22 & m68 < 100 & p19<24

*Add in women who had no check
replace pnc_wm_time = 0 if momcheck == 0 & p19<24

*Recode variable into categories as in FR
recode pnc_wm_time (0 242/299 306/899 = 0 "No check or past 41 days") ( 100/103 = 1 "<4hrs") (104/123 200 = 2 "4-23hrs") (124/171 201/202 = 3 "1-2days") ///
(172/197 203/206 = 4 "3-6days") (207/241 300/305 = 5 "7-41days") (else = 9 "Don't know/missing") if p19<24, gen(rh_pnc_wm_timing)
label var rh_pnc_wm_timing "Timing after delivery for mother's PNC check"

//PNC within 2days for mother
recode rh_pnc_wm_timing (1/3 = 1 "Within 2 days") (0 4 5 9 = 0 "Not in 2 days"), gen(rh_pnc_wm_2days)
label var rh_pnc_wm_2days "PNC check within two days for mother"


***********************
//RH_tables.do
***********************
* indicators from NR file - ANC/PNC denominator
if file=="NR" {

cap gen wt=v005/1000000

* three denominators
* recent livebirth
gen select = m80==1

****************************************************
//PNC within 2days for mother

*residence
tab v025 rh_pnc_wm_2days if select==1 [iw=wt], row freq

*region
tab v024 rh_pnc_wm_2days if select==1 [iw=wt], row freq

*education
tab v106 rh_pnc_wm_2days if select==1 [iw=wt], row freq

*wealth
tab v190 rh_pnc_wm_2days if select==1 [iw=wt], row freq

* output to excel
tabout v025 v106 v024 v190 rh_pnc_wm_2days using Tables_PNC.xls if select==1 [iw=wt] , c(freq row) f(1) append
*/


 
Read Message
Read Message
Previous Topic: Regarding term pregnancy
Next Topic: Regarding term pregnancy
Goto Forum:
  


Current Time: Sun Nov 24 08:51:38 Coordinated Universal Time 2024