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 (March 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 2 Mar 2011 10:10:02 -0600
Reply-To:     Joe Matise <snoopy369@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Joe Matise <snoopy369@GMAIL.COM>
Subject:      Re: Using "(OF" With Comma-Separated List
Comments: To: Kristin Graves <gravesk@coned.com>
In-Reply-To:  <201103021524.p22Bn2Ci012709@waikiki.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1

Remember, comma is separating arguments, so what is happening is you have your OF list first, then comma, then another argument. If you want another list, you need another OF.

mean(of var1-var10, of count1-count10)

As you noted earlier, space also works, as it's just extending the variable list (remember, the variable list basically just resolves to a space delimited list, so this is the equivalent of

mean(of var1 var2 var3 var4 ...)

-Joe

On Wed, Mar 2, 2011 at 9:24 AM, Kristin Graves <gravesk@coned.com> wrote:

> Hi - > > I regularly use the "(of" function -- as in mean(of var1-var10) > > Occasionally, I need to take the mean of a couple of lists of variables, as > in mean(of var1-var10, count1-count10) > > I always separated those lists with a comma, as shown above. But, a co- > worker happened to be trying to replicate some of my SAS results in Excel, > and we discovered that these two formulations provide different results: > > mean(of var1-var10, count1-count10) <-- with comma > mean(of var1-var10 count1-count10) <-- without comma > > The without-comma version appears to provide the correct results. But can > anyone tell me what the other with-comma formulation is doing instead? > > Just a user who is trying to understand why things work or don't work. > thanks, > Kristin Graves >


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