Hi All, I'm attempting to calculate age at Event (1st vaccination) for a data set I'm using. I've used this forum to find several different ways to calculate age at event, however, they all result in different values. I'm hoping to find out which of these calculations represents the true age at vaccination for this population. A few details- I calculated participants age at the start of the study ( 12-1-2016), which gave me an age range of 7-21 yrs ( Agetest). I'm using version 9.4. I want to exclude anyone who received a vaccination before age 9. Now, when I attempt to calculate participants' age at first vaccination ( Event), I get different values for how many are actually <9 at the event. With the coding below I get participants age at event as between 0-21. I'm assuming that some clinics erroneously listed the participant's dob and vaccination date as the same. What am I missing about this code that would explain these differences and which code reflects an accurate count at each age? Here's the code I've used thus far; data want; set have; today=MDY(12,01,2016); days=today-BIRTH_DATE; AGEtest= floor ((intck('month',BIRTH_DATE,today) - (day(today) < day(BIRTH_DATE))) / 12);*age at study start; AgeatVacc=INTCK ('YEAR', BIRTH_DATE, CHVaccDate_1);run; AgeVtest=floor ((intck('month',BIRTH_DATE,CHVaccDate_1) - (day(CHVaccDate_1) < day(BIRTH_DATE))) / 12); *age at first vacc date; AgeVtest2=floor ((intck('month',BIRTH_DATE,CHVaccDate_1)) / 12);*looking at diff btw birth date and 1st vacc date- gives different answers; AgeVTest5=floor ((intck('YEAR',BIRTH_DATE, CHVaccDate_1))); RUN;
... View more