** ALL BASIC VACCINATIONS: NDHS 2008 ** ** ========================================================================== ** ********************************* M. Tsawe, PhD ********************************* *********************** North West University, Mmabatho ************************ ********************************* South Africa ********************************* ************************ 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) ** ========================================================================== ** 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) ** ========================================================================== ** /* 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 ** ========================================================================== ** * Mother's age at birth cap drop agebirth gen agebirth=(b3-v011)/12 cap drop age_at_birth recode agebirth (min/19.91667=1 "<20") (20/34.91667=2 "20-34") /// (35/max=3 "35-49"), gen(age_at_birth) label var age_at_birth "Mother's age at birth" label val age_at_birth age_at_birth svy:tab age_at_birth, col per format(%4.1f) ***************************************** * Birth order gen birth_order1 = bord replace birth_order1 = bord-1 if b0 == 2 replace birth_order1 = bord-2 if b0 == 3 recode birth_order1 (1=1 "1") (2/3=2 "2-3") (4/5=3 "4-5") /// (6/20=4 "6+"), gen(birth_order) label var birth_order "Birth order" label values birth_order birth_order svy:tab birth_order, col per format(%4.1f) ***************************************** cap drop card_seen recode h1 (1=1 "Seen") (else=0 "Not seen/none"), gen(card_seen) label var card_seen "Vaccination card" label values card_seen card_seen svy:tab card_seen, col per format(%4.1f) *==============================================================================* ** DROP IF NOT WITHIN SAMPLE keep if vaccination !=. *==============================================================================* ** CHECK svy: tab vaccination, count format(%4.0f) svy: tab vaccination, percent format(%4.1f) ******************************************************************************** ******************************************************************************** ** Table 10.3 Vaccinations by background characteristics ** ssc install tabout ** CHECK 2 ** global backvar "child_age b4 birth_order age_at_birth card_seen age v131 v130 v149 education wealth residence region" ***************** ** T1 ** tabout $backvar vaccination using table1_2008.xlsx, /// replace style(xlsx) font(bold) f(1 2) /// c(row ci) twidth(12) mult(100) svy /// title(Table 1: Percentage of children age 12-23 months who received all /// basic vaccinations by background characteristics) /// fn(Source: Own calculations from NDHS 2008) /* ** T1 (N) ** tabout $backvar vaccination using table1N_2008.xlsx, /// replace style(xlsx) font(bold) f(0) /// /*c(row ci) twidth(12) mult(100)*/ svy /// title(Table 1: Distribution of children age 12-23 months by vaccination status & /// background characteristics) /// fn(Source: Own calculations from NDHS 2008) */ ** ========================================================================== ** ssc install hplot, replace //needs internet connection ssc install catplot, replace //needs internet connection catplot vaccination [aw=weight], by(region, compact note("") col(1)) /// bar(1, blcolor(gs8) bfcolor(brown*.4)) blabel(bar, format(%9.1f) /// pos(base)) percent(region) subtitle(, pos(9) ring(1) bcolor(none) nobexpand place(e)) /// ytitle(Percentage of all basic vaccinations by region) var1opts(gap(*0.1) axis(noline)) /// var2opts(gap(*.2)) ysize(5) yla(none) ysc(noline) /// plotregion(lcolor(none)) graph export "Percentage of all basic vaccinations by region.png", replace ********** catplot vaccination wealth [aw=weight], percent(wealth) stack asyvars /// bar(1, bcolor(gold)) bar(2, bcolor(ltblue)) bar(3, bcolor(gs0)) /// blabel(bar, format(%9.1f) pos(center)) bar(4, bcolor(g)) ytitle(%) /// title(Percentage of all basic vaccinations by wealth index) subtitle(Nigeria DHS 2018) *graph export "Percentage of all basic vaccinations by wealth index.pdf", replace graph export "Percentage of all basic vaccinations by wealth index.png", replace ** ========================================================================== ** exit