Date: Fri, 31 Aug 2007 06:08:57 +0000
Reply-To: Jindan Zhou <jindan@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jindan Zhou <jindan@GMAIL.COM>
Subject: How to calculate on selected observation and assign the result to
a variable?
Content-Type: text/plain; charset=ISO-8859-1
For example, my dataset(all_data) contains the following variables:
Class Estimate
Class1 2.29375
Class2 2.77788
Class3 3.30085
Class4 17.81447
Class5 4.57152
Class6 17.93637
Class7 17.85846
Class8 17.85846
Class9 17.93092
Class10 18.01070
How do I calculate, for example, average of Estimate over Class1-Class9 (note
Class10 is excluded), and assign the resulted value to a variable AVG?
Further, for AVG, the number of observation is 1, but the original dataset has
10 obs, so likely AVG will be created in another dataset,
Thanks,
Jindan
|