Date: Mon, 30 Mar 2009 00:31:14 +0530
Reply-To: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Anindya Mozumdar <anindya.lugbang@GMAIL.COM>
Subject: Re: Means
In-Reply-To: <200903291859.n2TAknX0013080@malibu.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Mar 30, 2009 at 12:29 AM, Randy <randistan69@hotmail.com> wrote:
> I want to find the means by two class of groups -- Group_one and Group_two.
> Group_one goes from 1 - 100 and Group_two from 1 - 10. There may be some
> groups that have 0 observations. In the output if a group has no
> observations I want to include the fact that that group has 0 observations.
> I wrote the following code
>
> proc means data = have noprint nway nmiss ;
> var Var_A ;
> by Flag_One;
> class Group_one Group_two ;
> output out = want_means
> sum = Agg_VarA
> min = Min_VarA
> max = Max_VarA
> mean = Avg_VarA ;
> run;
>
> What mistake am I making?
>
If you want group one-two combinations which do not appear in the data
you are summarizing, then you need to create another dataset
containing all possible combinations and then merge it with the output
dataset of the above.
Regards,
Anindya
|