10-24-2016 05:48 PM
I am trying to calculate percentages for the following data. The count of all records wil be my denominator.
I did a proc Summary and got the numerators very easily. It was difficult to put the denominator besides each category as shown below.
I created a variable cnt=1 for all records in the data step and used another proc summary step and merge it to the initial results. But this gave me denominator only once.(just the first record gets it)
Can someone help me with any easy methods available?
Num Den Percent
High 3 6 3/6*100
Low 2 6 2/6*100
Med 1 6 1/6*100
10-24-2016 09:59 PM - edited 10-24-2016 10:00 PM
And, in addition to PROC FREQ, you wouldn't want PROC TABULATE or PROC REPORT to feel left out! All 3 procedures will use the Grand Total of the count as the denominator when you ask for the percent or the PCTN statistic as shown below.