LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (October 2001, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 29 Oct 2001 16:20:19 -0500
Reply-To:   Jay Weedon <jweedon@EARTHLINK.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jay Weedon <jweedon@EARTHLINK.NET>
Organization:   http://extra.newsguy.com
Subject:   Re: stepping through arrays ...
Content-Type:   text/plain; charset=us-ascii

On 29 Oct 01 20:28:09 GMT, bnewlin@INSMED.COM (Stumped) wrote:

>I have a list of variables d1-dnth and I'm looking for a quick solution to >computing the average of d1-d5, d6-d10, etc. AND and also compute the >average of d1-d5, d2-d6, d3-d7, etc. Then compare the differences in >averages between the two methods. > >I've played around with it but now i'm resorting to SAS-L hoping to get >someone to point me in the right direction.

As far as I can see, the 1st set of averages is a subset of the 2nd no? The first elements of both sets are the same, the 2nd element of the 1st set is the same as the 6th element of the 2nd set etc.

If you just want to calculate all these averages you can use something like:

%macro whatever(n); data new; set old; %do ave=1 %to &n-4; ave_&ave._%eval(&ave+4)=mean(d&ave-d%eval(&ave+4)); %end; run; %mend;

So if the d's end at d100 run

%whatever(100)

JW


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