LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2011, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 30 Sep 2011 15:58:11 -0400
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Subject:      Re: Arrays and data import

It would be easier to loop over the individual ages and add them to the right bin.

I must be missing something in the structure of your data because I doubt that you have counts for 209 year olds?

DATA totalsexbyage; SET totalsexbyage; ARRAY ind PCT0120001 -- PCT0120209; ARRAY grp age1 - age16;

call missing(of grp(*)); do age=1 to dim(ind); group = 1+int(age/5) ; grp(group) = sum(grp(group),ind(age)); end; RUN;

On Fri, 30 Sep 2011 15:41:12 -0400, SUBSCRIBE SAS-L Jonathan Law <jmlaw@CBA.UA.EDU> wrote:

>The variables that go into the initialagegroups array are population for >single years of age (e.g. 38 years old, 39 years old, etc.). I'm trying to >aggregate them into 5-year age cohorts (e.g. 36-40 years old) by using the >do loop.


Back to: Top of message | Previous page | Main SAS-L page