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