The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Child Health » Vaccination (Table 10.4) - SADHS 2016
Vaccination (Table 10.4) - SADHS 2016 [message #17879] Tue, 02 July 2019 05:02
Dr_Tsawe
Messages: 76
Registered: February 2017
Location: Cape Town
Senior Member
Hello,

I need assistance with Table 10.4 of the South Africa Demographic and Health Survey (2016). I am trying to replicate the table, but I have not been able to figure out the figures (though close) for Polio (Polio1) and DPT-HepB-Hib (DPT_HepB_Hib2 and DPT_HepB_Hib3).

Following is the Stata code I used:

clear all
set matsize 800
set maxvar 10000
set mem 1g
cd "C:\Users\...\Desktop\SADHS 2016 DATA\DATASETS\ZAKR71DT"
use "ZAKR71FL", 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)
*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 = b19
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

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

** Recode of vaccination variables

gen	BCG			=	inrange(h2,1,3)

gen Polio0			=	inrange(h0,1,3)

gen DPT_HepB_Hib	        =	inrange(h3,1,3)+inrange(h5,1,3)+inrange(h7,1,3)

gen HepB			=	inrange(h61,1,3)+inrange(h62,1,3)+inrange(h63,1,3)

gen Polio			=	inrange(h4,1,3)+inrange(h6,1,3)+inrange(h8,1,3)

gen pneumococcal	       =	inrange(h54,1,3)+inrange(h55,1,3)+inrange(h56,1,3)

gen rotavirus		       =	inrange(h57,1,3)+inrange(h58,1,3)+inrange(h59,1,3)

**gen pv			=	inrange(pv1,1,3)+inrange(pv2,1,3)+inrange(pv3,1,3)

gen measles			=	inrange(h9,1,3)+inrange(h9a,1,3)

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

forvalues x = 1/3 {
	gen BCG`x' 			=	(BCG>=`x')
	gen Polio`x' 		=	(Polio>=`x')
	gen DPT_HepB_Hib`x'	=	(DPT_HepB_Hib>=`x')
	gen HepB`x'			=	(HepB>=`x')
	gen pneumococcal`x'	=	(pneumococcal>=`x')
	gen rotavirus`x'	=	(rotavirus>=`x')
	gen measles`x'  	=	(measles>=`x')
}
**

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

*** CHECKING TABLE 10.4 BY WEALTH QUINTILE ***
svy: tab wealth BCG, percent format(%9.1f) miss row 			// matches table 10.4
svy: tab wealth Polio0, percent format(%9.1f) miss row			// matches table 10.4
svy: tab wealth Polio1, percent format(%9.1f) miss row			// does not match table 10.4
svy: tab wealth Polio2, percent format(%9.1f) miss row			// not in table 10.4
svy: tab wealth DPT_HepB_Hib1, percent format(%9.1f) miss row	        // matches table 10.4
svy: tab wealth DPT_HepB_Hib2, percent format(%9.1f) miss row	        // does not match table 10.4
svy: tab wealth DPT_HepB_Hib3, percent format(%9.1f) miss row	        // does not match table 10.4
svy: tab wealth HepB1, percent format(%9.1f) miss row			// matches table 10.4
svy: tab wealth HepB2, percent format(%9.1f) miss row			// matches table 10.4
svy: tab wealth HepB3, percent format(%9.1f) miss row			// matches table 10.4
svy: tab wealth pneumococcal1, percent format(%9.1f) miss row	        // matches table 10.4
svy: tab wealth pneumococcal2, percent format(%9.1f) miss row	        // matches table 10.4
svy: tab wealth pneumococcal3, percent format(%9.1f) miss row	        // matches table 10.4
svy: tab wealth rotavirus1, percent format(%9.1f) miss row		// matches table 10.4
svy: tab wealth rotavirus2, percent format(%9.1f) miss row		// matches table 10.4
svy: tab wealth measles1, percent format(%9.1f) miss row		// matches table 10.4

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

/* BCG, three doses of DTaP-IPV-Hib, and one dose of measles vaccine */

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

svy: tab wealth vaccination, percent format(%9.1f) miss row

exit
Previous Topic: calculating height for age for children in Ghana
Next Topic: Correct derivation of Age-appropriate vaccination
Goto Forum:
  


Current Time: Tue Sep 17 23:50:40 Eastern Daylight Time 2019