Add Subtotals

Overview

ALL can do a lot more for your tables than just add totals. You can also use it to create subtotals when you have nested class variables. The following examples show how you can create a variety of different subtotals for the same table.
This is the original code. It produces the basic table that we have been working with throughout the chapter. It has nested row headings and a single column variable.
PROC TABULATE DATA=TEMP;
   CLASS EDUC2 GENDER FULLTIME;
   TABLE EDUC2*GENDER, FULLTIME*N;
RUN;

Add Subtotals to the Bottom of the Table

The next examples show two of the many ways that you can add subtotals to this table. The first method puts subtotals for each gender at the bottom of the table.
PROC TABULATE DATA=TEMP; ...

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.