Example 5.6 Calculating Percentages and Statistics That One Row Contributes to a BY Group
Calculate percentages that one row contributes to a BY group. Calculate statistics for the BY group, some of which are based on how the row contributes to the statistic for the BY group. Create columns to classify and contain the results of the calculations.
|Featured Step||PROC SQL|
|Featured Step Options and Statements||Aggregate functions
GROUP BY clauseORDER BY clause
|Related Technique||PROC MEANS, CLASS, OUTPUT, and TYPES statements DATA step, match-merging by a value|
Table DISTRICTLEVY contains levy voting results for four towns and their precincts. Counts of voters voting for the levy are in the "YES" column. ...