The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Child immunization (Child immunization for Nigeria)
Child immunization [message #20123] Sun, 27 September 2020 19:14 Go to next message
Ugonna is currently offline  Ugonna
Messages: 7
Registered: June 2020
Member
Hello everyone.

I am working with Stata where I'm trying to combine the different variables on child vaccination into one variable that will show that a child received all the basic vaccines, but the result I'm getting for Nigeria is different from what is on the report.

Here is my code:

gen vacn=bcg&dpt1&dpt2&dpt3&polio1&polio2&am p;polio3&measles
tab vacn [iw=wt]
label values vacn yesno
label var vacn "child received basic vaccination"
tab vacn [iw=wt]

I don't know what I am doing wrong.
Can someone help me please?

Thank you
Re: Child immunization [message #20134 is a reply to message #20123] Mon, 28 September 2020 13:03 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 45
Registered: August 2020
Location: USA
Member
Hello,

For vaccination please refer to our code share library in Chapter 10. Specifically the indicators you are interested in are found in CH_VAC.do file. The variable you are looking for in this do file is ch_allvac_either. Please read the readme file and the main file for the chapter before running any code. The link is: https://github.com/DHSProgram/DHS-Indicators-Stata
Please go to Chap10_CH folder on this site.

Please also refer to the Guide to DHS Statistics for further details on how vaccination indicators are computed.
Link: https://www.dhsprogram.com/Data/Guide-to-DHS-Statistics/inde x.htm#t=Vaccination.htm

Thank you.
Best,
Shireen Assaf
The DHS Program
Re: Child immunization [message #20325 is a reply to message #20134] Thu, 22 October 2020 17:46 Go to previous messageGo to next message
Ugonna is currently offline  Ugonna
Messages: 7
Registered: June 2020
Member
Hello Shireen,

Thank you for your response.
I have tried running the codes from your github page, but I got a much higher rate than what is on the NDHS report.
See the code I ran below

//***DHS user forum codes***//

*** BCG ***
//BCG either source
recode h2 (0 8=0) (else=1), gen(ch_bcg_either)
tab ch_bcg_either [iw=wt]
label var ch_bcg_either "BCG vaccination according to either source"


*** Pentavalent ***
//DPT 1, 2, 3 either source
recode h3 (0 8=0) (else=1), gen(dpt_1)
recode h5 (0 8=0) (else=1), gen(dpt_2)
recode h7 (0 8=0) (else=1), gen(dpt_3)
gen dptsum= dpt_1+dpt_2+dpt_3

tab dptsum

* this step is performed for multi-dose vaccines to take care of any gaps in the vaccination history. See DHS guide to statistics
* for further explanation
gen ch_dpt1_either=dptsum>=1
label var ch_dpt1_either "Pentavalent 1st dose vaccination according to either source"

gen ch_dpt2_either=dptsum>=2
label var ch_dpt2_either "Pentavalent 2nd dose vaccination according to either source"

gen ch_dpt3_either=dptsum>=3
label var ch_dpt3_either "Pentavalent 3rd dose vaccination according to either source"


drop dpt_1 dpt_2 dpt_3 dptsum


*** Polio ***

//polio 0, 1, 2, 3 either source
recode h0 (0 8=0) (else=1), gen(ch_polio0_either)
label var ch_polio0_either "Polio at birth vaccination according to either source"

recode h4 (0 8=0) (else=1), gen(polio_1)
recode h6 (0 8=0) (else=1), gen(polio_2)
recode h8 (0 8=0) (else=1), gen(polio_3)
gen poliosum=polio_1 + polio_2 + polio_3

tab poliosum


* this step is performed for multi-dose vaccines to take care of any gaps in the vaccination history. See DHS guide to statistics
* for further explanation
gen ch_polio1_either=poliosum>=1
label var ch_polio1_either "Polio 1st dose vaccination according to either source"

gen ch_polio2_either=poliosum>=2
label var ch_polio2_either "Polio 2nd dose vaccination according to either source"

gen ch_polio3_either=poliosum>=3
label var ch_polio3_either "Polio 3rd dose vaccination according to either source"

drop poliosum polio_1 polio_2 polio_3



*** Measles ***
//measles either source
recode h9 (0 8=0) (else=1), gen(ch_meas_either)
label var ch_meas_either "Measles vaccination according to either source"


*** All vaccinations ***
gen ch_allvac_either=ch_bcg_either==1&ch_dpt3_either==1& ch_polio3_either==1&ch_meas_either==1
label var ch_allvac_either "All basic vaccinations according to either source"
tab ch_allvac_either [iw=wt]

***2008 NDHS report gives 22.7% while the output here is 27.7%***

Please what could be wrong?

Thank you.
Re: Child immunization [message #20333 is a reply to message #20325] Fri, 23 October 2020 08:41 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 45
Registered: August 2020
Location: USA
Member
Hello Ugonna,

I ran the code and I get 23% for 4945 children. I am slightly off and will have to look into this further. It appears the problem is with the polio and dpt vaccines that are slightly off. The measles and bcg match the report. However, the percentage I get for all basic vaccinations is closer than your value to 22.7% and the number of children matches.

Have you ran the following code before you ran the vaccination code:

gen age = v008 - b3
gen agegroup=0
replace agegroup=1 if age>=12 & age<=23
* selecting children
keep if agegroup==1
keep if b5==1

Thank you.

Shireen
Re: Child immunization [message #20336 is a reply to message #20325] Fri, 23 October 2020 22:25 Go to previous messageGo to next message
Mlue
Messages: 88
Registered: February 2017
Location: North West
Senior Member
Hello Ugonna & Shireen,

Check this code out. It should work.

-------------------------

** ALL BASIC VACCINATIONS: NDHS 2008 **

** ========================================================================== **
********************************* M. Tsawe, PhD *********************************
************************ Last modified: 24 October 2020 ************************
** ========================================================================== **

clear all
set maxvar 20000
set mem 1g
cd "C:\Users\...\NGKR53DT"
use "NGKR53FL", clear
set more off

** ========================================================================== **

** WEIGHT VARIABLE
gen weight = v005/1000000

** ========================================================================== **

** SURVEY SET
gen psu = v021
gen strata = v023
svyset psu [pw = weight], strata(strata) vce(linearized) singleunit(scaled)
*svydes

** ========================================================================== **

// RENAME

rename v013 age
rename v106 education
rename v190 wealth
rename v025 residence
rename v024 region

** ========================================================================== **

** Child_age = 12-23 months old
gen months = (v008-b3)
keep if b5 == 1 & months >= 12 & months <=23

gen child_age = months
replace child_age = 1 if b5 == 1 & months >= 12 & months <=13
replace child_age = 2 if b5 == 1 & months >= 14 & months <=15
replace child_age = 3 if b5 == 1 & months >= 16 & months <=17
replace child_age = 4 if b5 == 1 & months >= 18 & months <=19
replace child_age = 5 if b5 == 1 & months >= 20 & months <=21
replace child_age = 6 if b5 == 1 & months >= 22 & months <=23
label define child_age 1"12-13" 2"14-15" 3"16-17" 4"18-19" 5"20-21" 6"22-23"
label var child_age "Child age in months"
label val child_age child_age
svy:tab child_age, percent format (%4.1f) miss

** =========================================================================== **

** RECODE OF VACCINATION VARIABLES
gen BCG = inrange(h2,1,3)
gen Polio0 = inrange(h0,1,3)
gen Polio = inrange(h4,1,3)+inrange(h6,1,3)+inrange(h8,1,3)
gen DPT = inrange(h3,1,3)+inrange(h5,1,3)+inrange(h7,1,3)
gen measles = inrange(h9,1,3)

** ========================================================================== **

*** Loop ***
forvalues x = 1/3 {
	gen BCG`x' = (BCG>=`x')
	gen Polio`x' = (Polio>=`x')
	gen DPT`x' = (DPT>=`x')
	gen measles`x' = (measles>=`x')
}
**
recode h4 (1/3=1) (else=0), gen(Polios1)

** check if loop worked **
svy: tab wealth DPT3, percent format(%9.1f) miss row
svy: tab wealth DPT3, count format(%9.0f) miss

** ========================================================================== **

/* 
ALL BASIC VACCINATIONS:
----------------------
	BCG, measles and three doses each of DPT and 
	polio vaccine (excluding polio vaccine given at birth)
*/

cap drop vaccination
gen vaccination = (BCG==1 & DPT3==1 & Polio3==1 & measles1==1)
label var vaccination "Received all basic vaccinations"
label define vaccination 0"No" 1"Yes"
label values vaccination vaccination

*==============================================================================*
** DROP IF NOT WITHIN SAMPLE
keep if vaccination !=.

*==============================================================================*

** CHECK
svy: tab vaccination, count format(%4.0f)
svy: tab vaccination, percent format(%4.1f)

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

exit
Re: Child immunization [message #20345 is a reply to message #20333] Sun, 25 October 2020 19:34 Go to previous messageGo to next message
Ugonna is currently offline  Ugonna
Messages: 7
Registered: June 2020
Member
Hello Shireen and Mlue,

Thanks a lot for your assistance. Really appreciate it.

After dropping children not one year old, Shireen I was able to get 23.01% using DHS codes and Mlue I got 21.9% when I ran your codes.

Initially, I didn't want to exclude other children from the dataset because I still need to run further analysis (for instance logistics and cox proportional regression) where all children u5 will be needed in other covariates.
Please is there a way of including a conditional statement in the immunization codes so it calculates for only 12-23 months old children, instead of dropping other children from the dataset?

Thank you
Re: Child immunization [message #20346 is a reply to message #20345] Sun, 25 October 2020 20:03 Go to previous messageGo to next message
Ugonna is currently offline  Ugonna
Messages: 7
Registered: June 2020
Member
Hi again,

I included "if b5 == 1 & oneyr ==1" in the code for basic vaccinations below and I got 25.6% for 5900 children in 2013, while the official 2013 NDHS report has 25.3%

gen ch_allvac_either=ch_bcg_either==1&ch_dpt3_either==1& ch_polio3_either==1&ch_meas_either==1 if b5 == 1 & oneyr ==1
label var ch_allvac_either "All basic vaccinations according to either source"
tab ch_allvac_either [iw=wt]

I think this works better than dropping all other children from the dataset

Thanks again.
Re: Child immunization [message #20378 is a reply to message #20346] Mon, 26 October 2020 13:34 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 45
Registered: August 2020
Location: USA
Member
Hello Ugonna,

We found the issue with our code. Thank you for bringing this to our attention.

Instead of coding the vaccination is this way:
recode h2 (0 8=0) (else=1), gen(ch_bcg_either)
we should have used:
recode h2 (1 2 3=1) (else=0), gen(ch_bcg_either)

The difference is minimal since it's just the missing (value 9) that would have been incorrectly coded. This change should apply to all the vaccinations. I've corrected the code on GitHub so you will see the updated version.

I checked this new code with the 2008 Nigeria survey and matched the table exactly, 22.7%.

Also your work around to not drop children is correct. Another way to to replace your indicator as missing for children outside the age group.

Thank you.

Best,

Shireen Assaf
The DHS Program
Re: Child immunization [message #20397 is a reply to message #20123] Tue, 27 October 2020 17:43 Go to previous messageGo to next message
Ugonna is currently offline  Ugonna
Messages: 7
Registered: June 2020
Member
Hello Shireen,

Thank you for the update.
I suspected the problem could be with missing value '9' since the code gave the exact result for 2018 NDHS because it didn't have any coded missing value '9', just didn't know how to go about it.

It's good that the GitHub has been corrected too.

Thank you,
Ugonna
Re: Child immunization [message #20444 is a reply to message #20134] Mon, 02 November 2020 13:59 Go to previous message
mikestanley464 is currently offline  mikestanley464
Messages: 1
Registered: November 2020
Member
please refer to our code share library in Chapter 10. Specifically the indicators you are interested in are found in CH_VAC.do file. The variable you are looking for in this do file is ch_allvac_either. Please read the readme file and the main file for the chapter before running any code.
Hotstar for PChttps://bluestacks.redOmegle

[Updated on: Fri, 06 November 2020 03:51]

Report message to a moderator

Previous Topic: mege databases of multiple countries over several years
Next Topic: Child health and literacy
Goto Forum:
  


Current Time: Mon Nov 30 12:21:22 Coordinated Universal Time 2020