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 (February 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 9 Feb 2005 21:19:29 -0800
Reply-To:     nevin <nevinkrishna@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         nevin <nevinkrishna@HOTMAIL.COM>
Organization: http://groups.google.com
Subject:      mean function for many variables
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I have a dataset with 95 columns..each column contains temperatue readings..I wish to create a new variable that is the mean of all temps for all columns (except new variable). note that the column names are sequential (COL1 COL2 COL3....COL95). typically i use something like this..

newvar=mean(col1,col2,col3,etc...)

Is there an easier way to accomplish this without writing all the variables? such as newvar=(COL1-COL95)....that actually works?

Thanks, Nevin


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