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 (September 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 17 Sep 2010 20:02:40 -0400
Reply-To:   Cassandra Tucker <cbtucker@UCDAVIS.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Cassandra Tucker <cbtucker@UCDAVIS.EDU>
Subject:   all categories of a variable; PROC FREQ or...?
Content-Type:   text/plain; charset=ISO-8859-1

I have subsets of data where a category of a variable does not have any values. When calculating the percentage of each category, I need to include the zeros:

Category % 1 25% 2 15% 3 35% 4 30% 5 0%

The missing category varies between datasets (e.g. could be 5 as in the example above, but also could be 1 or more of the other categories). To date, I've tried this calculation with PROC FREQ without success. Is there a way to have SAS recognize all levels of the variable in every BY subset? These values are not “missing” in the traditional sense, so none of the MISSING/SPARSE etc. options apply here (as far as I can tell).

I'd like to find a fairly automated way to do this because I'd like to calculate these % after PROC SURVEYSELECT, where more and more values will be removed (in order to determine sample size required to detect the % of the population with category 4+5, for example).

Many thanks, Cassandra


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