Percentages with Subtotals
After you start building
complex tables with percentages, overall totals might not be enough
to make the tables understandable to the reader. You can also add
subtotals to make things clearer. With subtotals, even an extremely
long table can be easily understood.
For example, when you
have a table with nested classifications, you might want to show how
things add up within the nestings as well as overall. To illustrate
the use of subtotals, we can use the basic table that we have been
working with all along in this chapter. This code produces a basic
table with column percentages:
PROC TABULATE DATA=TEMP; CLASS GENDER CTRY CUSTTYPE; TABLE CTRY*GENDER ALL, CUSTTYPE*PCTN<CTRY*GENDER ALL>; RUN;
As you can see, Output ...
Get PROC TABULATE by Example, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.