|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:
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).