The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Post Natal Care check (PNC_CHECKINGIN WITHIN 2DAYS)
Post Natal Care check [message #23781] Tue, 30 November 2021 02:34 Go to next message
Francois is currently offline  Francois
Messages: 9
Registered: February 2017
Location: KIGALI
Member
Hello,
I am trying to reproduce the Table 9.9 and Table 9.11 ,The percentage of women with a pnc chek during the first 2days after birth for both mothers and newborn using GITHUB Codes. I am getting the different numbers in frequencies and percentages, Probably variables used changed but don't know where are mistakes. Thank you for your assistance
Here are the codes used:

*=====PNC INDICATORS========
cd"C:\Users\ICF Rwanda\Desktop\district\DHS6"
use RWIR81FL, clear

gen age = v008 - b3_01
gen w=v005/1000000

scalar drop _all

** To check if survey has m51_1, which was in the surveys before 2005.

scalar m51_included=1
capture confirm numeric variable m51_1, exact
if _rc>0 {
* m51_1 is not present
scalar m51_included=0
}
if _rc==0 {
* m51_1 is present; check for values
summarize m51_1
if r(sd)==0 | r(sd)==. {
scalar m51_included=0
}
}

*** Mother's PNC ***

if m51_included==1 {

//PNC timing for mother
recode m51_1 (100/103 = 1 "<4hr") (104/123 200 = 2 "4-23hrs") (124/171 201/202 = 3 "1-2 days") ///
(172/197 203/206 = 4 "3-6 days") (207/241 301/305=5 "7-41 days") ///
(198/199 298/299 398/399 998/999 = 9 "dont know/missing") (242/297 306/397 = 0 "no pnc check") , g(rh_pnc_wm_timing)
replace rh_pnc_wm_timing = 0 if m50_1==0 | m50_1==9
replace rh_pnc_wm_timing = 0 if (m52_1>29 & m52_1<97) | m52_1==.
replace rh_pnc_wm_timing=. if age>=24 | bidx_01!=1
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 "Visit w/in 2 days") (0 4 5 9 = 0 "No Visit w/in 2 days"), g(rh_pnc_wm_2days)
label var rh_pnc_wm_2days "PNC check within two days for mother"

//PNC provider for mother
** This is country specific and could be different for different surveys, please check footnote of the table for this indicator in the final report.
recode m52_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( else = 9 "Don't know or missing") if age<24 & rh_pnc_wm_2days==1, gen(rh_pnc_wm_pv)
replace rh_pnc_wm_pv = 0 if rh_pnc_wm_2days==0 & age<24
label var rh_pnc_wm_pv "Provider for mother's PNC check"
}

if m51_included==0 {
cap drop rh_pnc_wm_timing

//PNC timing for mother
*did the mother have any check
gen momcheck = 0 if age<24
replace momcheck = 1 if (m62_1==1 | m66_1==1) & age<24

*create combined timing variable
gen pnc_wm_time = 999 if (age<24 & momcheck==1)
*start with women who delivered in a health facility with a check
replace pnc_wm_time = m63_1 if inrange(m64_1,11,29) & age<24
*Account for provider of PNC- country specific- see table footnotes
replace pnc_wm_time = 0 if (pnc_wm_time < 1000 & m64_1 >30 & m64_1 < 100 & age<24)
*Add in women who delivered at home with a check
replace pnc_wm_time = m67_1 if (pnc_wm_time == 999 & inrange(m68_1, 11,29) & age<24)
*Account for provider of PNC- country specific- see table footnotes
replace pnc_wm_time = 0 if m67_1 < 1000 & m68_1 >30 & m68_1 < 100 & age<24
*Add in women who had no check
replace pnc_wm_time = 0 if momcheck == 0 & age<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 301/305 = 5 "7-41days") (else = 9 "Don't know/missing") if age<24, gen(rh_pnc_wm_timing)
*label variable
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"

//PNC provider for mother
** This is country specific and could be different for different surveys, please check footnote of the table for this indicator in the final report.

*Providers of PNC for facility deliveries
recode m64_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( else = 9 "Don't know or missing") if age<24 & rh_pnc_wm_2days==1, gen(pnc_wm_pv_hf)
replace pnc_wm_pv_hf = 0 if rh_pnc_wm_2days==0 & age<24

*Providers of PNC for home deliveries or checks after discharge
recode m68_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( else = 9 "Don't know or missing") if age<24 & rh_pnc_wm_2days==1 , gen(pnc_wm_pv_home)
replace pnc_wm_pv_home = 0 if rh_pnc_wm_2days==0 & age<24

*Combine two PNC provider variables
clonevar rh_pnc_wm_pv = pnc_wm_pv_hf
replace rh_pnc_wm_pv = pnc_wm_pv_home if (pnc_wm_pv_hf==9 & rh_pnc_wm_2days==1 & age<24)
*label variable
label var rh_pnc_wm_pv "Provider for mother's PNC check"
}



*** Newborn's PNC ***

* some surveys (usally older surveys) do not have PNC indicators for newborns. For this you would need variables m70_1, m71_1, ..., m76_1
scalar m70s_included=1
forvalues i=1/6 {
capture confirm numeric variable m7`i'_1, exact
if _rc>0 {
scalar m70s_included=0
}
if _rc==0 {
summarize m7`i'_1
if r(sd)==0 | r(sd)==. {
scalar m70s_included=0
}
}
}

*survey has newborn PNC indicators
if m70s_included==1 {

if m51_included==1 {

//PNC timing for newborn
recode m71_1 (207/297 301/397 = 0 "No check or past 7 days") ( 100 = 1 "less than 1 hour") (101/103 = 2 "1-3 hours") (104/123 200 = 3 "4 to 23 hours") (124/171 201/202 = 4 "1-2 days") ///
(172/197 203/206 = 5 "3-6 days new") (198/199 298/299 398/399 998/999 = 9 "dont know/missing") if age<24 , gen(rh_pnc_nb_timing)

*Recode babies with no check and babies with check by unskilled prov back to 0
replace rh_pnc_nb_timing = 0 if (m70_1==0 | m70_1==9)
*Account for provider of PNC- country specific- see table footnotes
replace rh_pnc_nb_timing = 0 if (m72_1>29 & m72_1<97) | m72_1==.
replace rh_pnc_nb_timing = . if age>=24 | bidx_01!=1

*label variable
label var rh_pnc_nb_timing "Timing after delivery for newborn's PNC check"

//PNC within 2days for newborn
recode rh_pnc_nb_timing (1/4 = 1 "Visit within 2 days") (0 5 9 = 0 "No Visit within 2 days"), g(rh_pnc_nb_2days)
*label variable
label var rh_pnc_nb_2days "PNC check within two days for newborn"

//PNC provider for newborn
** this is country specific, please check table in final report
recode m72_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( 98/99 = 9 "Don't know or missing") if age<24 & rh_pnc_nb_timing<9 & rh_pnc_nb_timing>0, gen(rh_pnc_nb_pv)
replace rh_pnc_nb_pv = 0 if rh_pnc_nb_2days ==0 & age<24
label var rh_pnc_nb_pv "Provider for newborn's PNC check"

}

if m51_included==0 {

//PNC timing for newborn

*Newborn check
gen nbcheck = 1 if (m70_1==1 | m74_1==1 )
*create combined timing variable
gen pnc_nb_timing_all = 999 if age<24 & nbcheck==1

*start with women who delivered in a health facility with a check
replace pnc_nb_timing_all = m75_1 if inrange(m76_1,11,29) & age<24
*Account for provider of PNC- country specific- see table footnotes
replace pnc_nb_timing_all = 0 if pnc_nb_timing_all < 1000 & m76_1 >30 & m76_1 < 100 & age<24

*Add in women who delivered at home with a check
replace pnc_nb_timing_all = m71_1 if (pnc_nb_timing_all==999 & inrange(m72_1,11,29) & age<24)
*Account for provider of PNC- country specific- see table footnotes
replace pnc_nb_timing_all = 0 if (m71_1 < 1000 & m72_1 >30 & m72_1 < 100 & age<24)
*Add in women who had no check
replace pnc_nb_timing_all = 0 if (nbcheck!=1) & age<24

*Recode variable into categories as in FR
recode pnc_nb_timing_all (0 207/297 301/397 = 0 "No check or past 7 days") ( 100=1 "less than 1 hour") (101/103 =2 "1-3 hours") (104/123 200 = 3 "4 to 23 hours") (124/171 201/202 = 4 "1-2 days") ///
(172/197 203/206 = 5 "3-6 days new") (else = 9 "Don't know or missing") if age<24 , gen (rh_pnc_nb_timing)
*label variable
label var rh_pnc_nb_timing "Timing after delivery for mother's PNC check"

//PNC within 2days for newborn
recode rh_pnc_nb_timing (1/4 = 1 "visit within 2 days") (0 5 9 = 0 "No Visit within 2 days"), g(rh_pnc_nb_2days)
label var rh_pnc_nb_2days "PNC check within two days for newborn"

//PNC provider for newborn
** This is country specific and could be different for different surveys, please check footnote of the table for this indicator in the final report.

*Providers of PNC for home deliveries or checks after discharge
recode m72_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( else = 9 "Don't know or missing") if age<24 & rh_pnc_nb_2days==1, gen(pnc_nb_pv_home)
replace pnc_nb_pv_home = 0 if rh_pnc_nb_2days==0 & age<24

*Providers of PNC for facility deliveries
recode m76_1 (0 = 0 "No check") (11 = 1 "Doctor") (12/13 = 2 "Nurse/Midwife") ( 14/15 = 3 "Other skilled provider") (16/90 = 4 "Non-skilled provider") (96 = 5 "Other") ///
( else = 9 "Don't know or missing") if age<24 & rh_pnc_nb_2days==1 , gen(pnc_nb_pv_hf)
replace pnc_nb_pv_hf = 0 if rh_pnc_nb_2days==0 & age<24

*Combine two PNC provider variables
clonevar rh_pnc_nb_pv = pnc_nb_pv_hf
replace rh_pnc_nb_pv = pnc_nb_pv_home if (pnc_nb_pv_hf ==9) & rh_pnc_nb_2days ==1 & age<24
*label variable
label var rh_pnc_nb_pv "Provider for newborns's PNC check"

}
}

*survey does not have newborn PNC indicators
if m70s_included==0 {
* replace indicators as missing
gen rh_pnc_nb_timing = .
gen rh_pnc_nb_2days = .
gen rh_pnc_nb_pv = .
}

*=======TABLES PRODUCED=======
ta rh_pnc_nb_2days[iw=w] //for Newborn


PNC check within two
days for newborn
Freq. Percent Cum.

No Visit within 2 days 798.142952 25.19 25.19
visit within 2 days 2,370.5574 74.81 100.00

Total 3,168.7003 100.00


ta rh_pnc_wm_2days[iw=w] // for Mom or mother
PNC check
within two
days for
mother
Freq. Percent Cum.

Not in 2 days 932.12392 29.42 29.42
Within 2 days 2,236.5764 70.58 100.00

Total 3,168.7003 100.00









AF
Re: Post Natal Care check [message #23788 is a reply to message #23781] Tue, 30 November 2021 14:29 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello Francois,

Hope you are doing well.

I was able to match the tables using the GitHub code. I suspect the problem is because you computed age and did not use b19_01 for age. If you check the RH_age_period.do file you will see that if b19 is present in the data file, then this should be used for age. So instead of age=v008- b3_01 you should use gen age=b19_01. Then run the entire RH_PNC.do file to get a match. See the attached Stata output screenshot.

Hope this helps.
Best,
Shireen Assaf
The DHS Program

  • Attachment: RW_PNC.png
    (Size: 30.52KB, Downloaded 259 times)
Re: Post Natal Care check [message #23791 is a reply to message #23781] Wed, 01 December 2021 06:00 Go to previous messageGo to next message
Francois is currently offline  Francois
Messages: 9
Registered: February 2017
Location: KIGALI
Member
Dear Shireen,

Thank you very much. It works!

So is this the same variable used determining age for ANC while calculating the women" Received 2+ tetanus injections during last pregnancy" and
women "Protected against neonatal tetanus"?
Also, the variable "Period" is similar with which variable?
Thank you very much

Francois


AF
Re: Post Natal Care check [message #23792 is a reply to message #23791] Wed, 01 December 2021 06:20 Go to previous messageGo to next message
Francois is currently offline  Francois
Messages: 9
Registered: February 2017
Location: KIGALI
Member
Dear Shireen,
Ignore the questions for ANC!! Also, it works!!
Thank you


AF
Re: Post Natal Care check [message #23793 is a reply to message #23792] Wed, 01 December 2021 08:27 Go to previous message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Great to hear it worked for you.

Yes the age would be the same for the ANC. Please read the main file and the age_period file.
The period is usually births in the last past 5 years for ANC indicators (i.e. 60 months) or the past 2 years for PNC indicators (i.e. 24 months). For Rwanda you dont need to change anything because the code is set up for these periods. For other surveys you need to see what it says in the table title (births in the last 5 years or other).

Best,
Shireen
Previous Topic: How is sampling done for child development and child diet?
Next Topic: Child Birth Weight - Not Recorded Data
Goto Forum:
  


Current Time: Thu Dec 12 04:56:19 Coordinated Universal Time 2024