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: 26
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: 140
Registered: August 2020
Location: USA
Senior 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: 26
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: 140
Registered: August 2020
Location: USA
Senior 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: 92
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: 26
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: 26
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: 140
Registered: August 2020
Location: USA
Senior 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: 26
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 #23199 is a reply to message #20134] Thu, 29 July 2021 09:20 Go to previous messageGo to next message
helenagva is currently offline  helenagva
Messages: 4
Registered: July 2021
Member
Dear all,

I am trying to do an analysis related to this on ALBANIA, and desperately need your help.
On pg 140 of the Albania DHS final report, it is stated that 0.2% of children received no vaccinations.

However, when I use the code provided on GitHub (which I am extremely grateful for) the result is 6.47%. I have been trying to do this for days but I am stuck on this variable.

Ultimately, I would like to know the percentage distribution of fully and non-immunized children which is the outcome variable of my study.


Please help in any way you can,

Best regards
Re: Child immunization [message #23204 is a reply to message #23199] Thu, 29 July 2021 12:41 Go to previous messageGo to next message
helenagva is currently offline  helenagva
Messages: 4
Registered: July 2021
Member
Moreover, can I join these two variables (ch_allvac_either and ch_novac_either) into one, in order to compare fully and non-immunized with other groups?
Re: Child immunization [message #23222 is a reply to message #23204] Mon, 02 August 2021 09:15 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello Ugonna,

Thank you for your question. The Albania 2017 used different variable for the pentavalent or dpt vaccine. So instead of h3 it should be h51, h5 should be h52, and h7 should be h53. Also you need to drop children that are h1==0. The code for the changes you need to the CH_VAC.do file are bellow. You can make those changes then run the rest of the code without changes. After these changes I get a match of 75% for all basic vaccinations and 0.2 for no vaccinations for children 12-23 (458 children) using this code.

I did not understand your questions about combining ch_allvac_either and ch_novac_either. Do you mean you want a variable that has three categories of : 1. all basic vaccinations, partially vaccinated, and no vaccinations? I suggest a crosstab of these two variables to understand what you are looking for.

Hope this helps.

Best,
Shireen Assaf
The DHS Program

Stata code:

gen age=b19

*** Two age groups used for reporting.
* choose age group of interest
*
gen agegroup=0
replace agegroup=1 if age>=12 & age<=23
*/

/*
gen agegroup=0
replace agegroup=1 if age>=24 & age<=35
*/

* selecting children
keep if agegroup==1
keep if b5==1

*For Albania 2017 survey
drop if h1==0

*** Pentavalent ***
//DPT 1, 2, 3 either source
recode h51 (1 2 3=1) (else=0), gen(dpt1)
recode h52 (1 2 3=1) (else=0), gen(dpt2)
recode h53 (1 2 3=1) (else=0), gen(dpt3)
gen dptsum= dpt1+dpt2+dpt3
Re: Child immunization [message #23224 is a reply to message #23222] Mon, 02 August 2021 16:17 Go to previous messageGo to next message
helenagva is currently offline  helenagva
Messages: 4
Registered: July 2021
Member
Dear Shireen,

I just want to say thanks a lot! I had already figured out that the penta variable changed, however, I think the main problem was dropping h1 == 0. THANKS SO MUCH FOR THIS! I really appreciate it.

I just want to ask one last thing which will be the cherry on top if I can get a solution. I am struggling with exporting the weighted dataset into R, or simply saving it as a new dataset.
If I can do this, it will make my work so much easier because I am using R for the tables and visualizations. Therefore do you have any suggestions on how to save a weighted dataset as a new dataset, which will contain the population estimates?

Please let me know.

Kindest regards
Re: Child immunization [message #23231 is a reply to message #23224] Tue, 03 August 2021 08:11 Go to previous messageGo to next message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello,

You're very welcome. Glad I could help.

For working in R, what I know is that you would need to use the survey package and supply the weight (v005), PSU(v021), and strata (usually v023) to the survey command in R to produce the correct estimates if you are producing confidence intervals. If you only are producing the percentages then you only need to use the weight. In that case you can still use the survey package but only supply the weight or use some other packages for weighted tables. You can check how we do this in the R code available on GitHub and check the main file for the packages needed that are listed at the top, then the table file for how we tabulate the variables.
https://github.com/DHSProgram/DHS-Indicators-R

Good luck with your research.

Best,
Shireen Assaf
The DHS Program
Re: Child immunization [message #23243 is a reply to message #23231] Thu, 05 August 2021 17:35 Go to previous messageGo to next message
helenagva is currently offline  helenagva
Messages: 4
Registered: July 2021
Member
Thanks Shireen.

I would like to ask one more thing. Most of the recent DHS surveys (e.g. Tajikistan 2017) use a different categorization for "all basic vaccines". BCG, Polio and DTP are considered for children 12-23 months and measles is considered for children 24-35 months.
How does the code change based on this categorization?

I assume that is why on Table 11.3 pg 149 in the final report (https://dhsprogram.com/pubs/pdf/FR341/FR341.pdf), all basic vaccinations for 12-23 months is N/A?

Best regards
Re: Child immunization [message #23248 is a reply to message #23243] Fri, 06 August 2021 08:21 Go to previous message
Shireen-DHS is currently offline  Shireen-DHS
Messages: 140
Registered: August 2020
Location: USA
Senior Member
Hello,

The code should be the same, you just need to change the age group selection. That part of the code is in the beginning of the vaccination do file.

Best,
Shireen
Previous Topic: Child Discipline - Myanmar DHS 2015-2016
Next Topic: do files for cleaning the children's birth month and year
Goto Forum:
  


Current Time: Thu Oct 10 20:09:50 Coordinated Universal Time 2024