I have a big dataset of county level demographics

"County Statename Year Agegroup"

where agegroup is broken up into 4 year intverals (0-4, 4-9, 10-14 etc)
I am trying to collapse the agegroup to have it in 9 year intervals (0-9, 10-19 etc...)
I tried collapse (sum) if AGEGRP = 1 2 but am getting the following error "invalid "1"
Any suggestions?