LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2009, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: Randy <randistan69@hotmail.com>
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


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