Date: Sun, 2 Nov 2008 08:58:37 -0500
Reply-To: Ken Borowiak <EvilPettingZoo97@AOL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ken Borowiak <EvilPettingZoo97@AOL.COM>
Subject: Re: Means
On Sun, 2 Nov 2008 08:44:30 -0500, Randy <randistan69@HOTMAIL.COM> wrote:
>Dear all:
> Is there a one step data process to calculate the means of the entire
>sample; and the means according to the class.
>So, for example;
>
>Class VarA
>A 20
>A 31
>B 22
>A 12
>B 4
>
>I want the mean of VarA for all the observations and according to Class A
>and Class B. I would like to do this in one data step. Is this possible?
> Randy
Randy,
Try PROC SUMMARY *without* using the NWAY option.
data sup ;
input Class $ VarA ;
datalines ;
A 20
A 31
B 22
A 12
B 4
;
run ;
proc summary data=sup ;
class class ;
var vara ;
output out=sup2 mean= / autoname ;
run ;
hth,
Ken
|