| Timeliness of measles vaccination [message #10224] | 
			Mon, 11 July 2016 10:26   | 
		 
		
			
				
				
				
					
						  
						nkanagat
						 Messages: 4 Registered: July 2016  Location: Seattle, WA
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello, 
 
I am trying to calculate the timeliness of the measles vaccination in Tanzania from the DHS 2010 dataset, KR file. I need to calculate whether the measles vaccine was given early (before 9 months) on time (9 months) or late (after 9 months).  
 
I have set up the following code: 
 
**Healthcard 
gen healthcard=. 
replace healthcard = 1 if h1 == 1 
replace healthcard = 0 if inlist(h1, 0, 2, 3) 
replace healthcard = . if h1 == 9 
 
*generate age of each child in months 
g age=v008-b3 
g wgt=v005/1000000 
 
ta age if age>=12 & age<=23 & b5==1 [iw=wgt] 
 
**Measles 
recode h9 (0 2 3 8 9=0 "no") (1=1 "yes"), g(measles) 
ta measles if age>=12 & age<=23 & b5==1 [iw=wgt] 
 
**Timeliness by month 
recode h9m ( 1 2 3 4 5 6 7=0 "early") (9=1 "timely") (10 11 12=2 "late"), g (timely) 
ta measles timely 
 
 
In order to examine the timeliness of measles, is this the best way to set up my variables in stata?   
 
Thank you, 
Natasha 
 
		
		
		[Updated on: Mon, 11 July 2016 14:45] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	
		
		
			| Re: Timeliness of measles vaccination [message #10242 is a reply to message #10224] | 
			Tue, 12 July 2016 13:38    | 
		 
		
			
				
				
				
					
						
						Liz-DHS
						 Messages: 1516 Registered: February 2013 
						
					 | 
					Senior Member  | 
					 | 
		 
		 
	 | 
 
	
		Dear User, 
A response from Dr. Tom Pullum: 
Quote: 
Your approach was mostly correct but it did not take into account censoring, i.e. the fact that some children have not yet reached the ages you are interested in.  I would do it as given below. 
 
 
  
set more off
use .... TZKR62FL.dta, clear
gen current_age=.
replace current_age=1 if v008-b3<9
replace current_age=2 if v008-b3==9
replace current_age=3 if v008-b3>9 & v008-b3<=23
replace current_age=4 if v008-b3>23
* calculate cmc of immunization
gen cmc_when_immunized=h9m+12*(h9y-1900)
gen age_at_immunization=cmc_when_immunized-b3
tab age_at_immunization
gen timeliness=.
replace timeliness=1 if age_at_immunization<9
replace timeliness=2 if age_at_immunization==9
replace timeliness=3 if age_at_immunization>9 & age_at_immunization<=23
replace timeliness=4 if age_at_immunization>23 & age_at_immunization<. 
replace timeliness=5 if age_at_immunization==. 
replace timeliness=6 if h9==0 | h9>3 
replace timeliness=7 if h9==.
label define time 1 "Before 9 months" 2 "At 9 months" 3 "10-23 months" 4 "24-59 months" 5 "Received, no date" 6 "Not received" 7 "NA"
label values timeliness time
label values current_age time
tab timeliness current_age
tab timeliness current_age [iweight=v005/1000000]
  
		
		
		[Updated on: Tue, 12 July 2016 13:42] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	
		
		
			| Re: Timeliness of measles vaccination [message #11052 is a reply to message #10246] | 
			Fri, 21 October 2016 10:31    | 
		 
		
			
				
				
				
					
						  
						nkanagat
						 Messages: 4 Registered: July 2016  Location: Seattle, WA
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi again, 
 
I want to replicate Table 10.4 Vaccinations in the first year of life. Percentage of children age 12-59 months at the time of the survey who received specific vaccines by age 12 months, Zambia 2013-14  Link to table: https://www.dhsprogram.com/pubs/pdf/FR304/FR304.pdf 
 
I am using the KR file.  
 
I have the code below.  
 
*calculating age at measles immunization, in months, for those children with non-missing date; dob defined above in dpt3 code 
set more off 
tab1 h9* 
 
gen h9d_rev=h9d 
replace h9d_rev=. if h9d>31 
 
gen h9m_rev=h9m 
replace h9m_rev=. if h9m>12 
 
gen h9y_rev=h9y 
replace h9y_rev=. if h9y>v007 
 
gen h9_mdy=mdy(h9m_rev,h9d_rev,h9y_rev) 
 
gen dob_mdy=mdy(b1,hw16,b2) 
 
* "exact" age in months; the average days in a month is 365.25.12 = 30.4375 
gen h9_age_in_months=(h9_mdy-dob_mdy)/30.4375 
summarize h9_age_in_months  
 
tab h9_age_in_months 
 
* completed age in months 
gen h9_completed_age_in_months =int(h9_age_in_months) 
 
summarize h9_age_in_months 
 
tab h9_completed_age_in_months  
 
gen timely=. 
replace timely =1 if h9_completed_age_in_months <12 
replace timely = 0 if h9_completed_age_in_months >=12 
tab timely h9_completed_age_in_months 
 
tab timely if age2>=12 & age2<=23 & b5==1 [iw=wgt] 
 
tab timely if age2>=12 & age2<=59 & b5==1 [iw=wgt] 
 
I compared my output for children between the ages of 12-23 at the time of survey who received measles by age 12 months to table 10.4. 
I got 56.34 to 72.5 in the table.  
 
Not sure why there is a difference.  
 
Thanks, 
Natasha 
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	
		
		
			| Re: Timeliness of measles vaccination | Table 10.4 Zambia DHS  [message #11053 is a reply to message #11052] | 
			Fri, 21 October 2016 12:59   | 
		 
		
			
				
				
				
					
						  
						nkanagat
						 Messages: 4 Registered: July 2016  Location: Seattle, WA
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		I know what I am missing. 
 
I need to add mothers report bec in the Zambia table the footnote says "For children whose information is based on the mother's report, the proportion of vaccinations given during the first year of life is assumed to be the same as for children with a written record of vaccinations." 
 
Let me work on this and I will let you know if I run into any challenges. 
		
		
		
 |  
	| 
		
	 | 
 
 
 |