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 (July 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 19 Jul 2009 18:08:58 -0700
Reply-To:     Tom Abernathy <tom.abernathy@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tom Abernathy <tom.abernathy@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Re: PROC SUMMARY
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

You can add a WHERE dataset option to your output dataset name to delete the rows with A=0 or B=0 ... You can use the _TYPE_ variable to determine the group. Either recode it in another datastep or attach a format. _TYPE_=1 is D _TYPE_=2 is C _TYPE_=4 is B _TYPE_=8 is A In general _type_ = 2**(i-1) is the ith variable in your CLASS list.

On Jul 19, 4:31 pm, stats...@GMAIL.COM (OR Stats) wrote: > thnx!! right now though the results look like the following > A B C D SummaryStat > 0 ## > 1 ## > 0 ## > 1 ## > 0 ## > 1 ## > 0 ## > 1 ## > > how can we change it so that we have simply > Group SummaryStat > A ## > B ## > C ## > D ## > > > > On Sun, Jul 19, 2009 at 1:15 PM, Joe Matise <snoopy...@gmail.com> wrote: > > Sounds like a CLASS situation to me... > > > proc means data=have; > > var y; > > class a b c d; > > types a b c d; > > output out=want mean=; > > run; > > > or whatever. If you just want the A=1 etc. (not 0) then put a where > > condition on your output dataset to require A or B or C or D to be 1. > > > -Joe > > > On Sun, Jul 19, 2009 at 12:50 PM, OR Stats <stats...@gmail.com> wrote: > > >> Hello: > > >> I would like to do a PROC SUMMARY for the means and size of the group > >> membership of my data. The problem is that each record can belong to more > >> than one group. And I would like to calculate the summary statistics for > >> the groups in a non-exclusive way. > > >> Group membership is currently captured across binary columns of my data. > > >> record_id A B C D y > >> 1 1 0 0 0 # > >> 2 0 1 0 0 # > >> 3 1 1 1 1 # > > >> Group is therefore A, B, C, or D. In the output summary table, I would > >> have > >> summarized y by groups A, B, C, and D.And I would like to get the summary > >> statistic for y by Group, where A includes records 1, 2 and 3; B is just 2 > >> and 3; C is just record 3; and D is also just record 3. > > >> Can I do this in one PROC SUMMARY datastep? Or do I need an intermittent > >> dataset to reorganize my table above? > > >> Thank you!!- Hide quoted text - > > - Show quoted text -


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