Put It All Together

This final example pulls together each of the PROC TABULATE features demonstrated in this chapter.
  1. The starting point for the table is the two-dimensional table that has rows showing occupation and columns showing income by gender.
    PROC TABULATE DATA=TEMP;
       CLASS OCCUP GENDER;
       VAR INCOME;
       TABLE OCCUP, (GENDER ALL)*INCOME*MEAN;
    RUN;
  2. Add the third dimension to a table by adding a page variable at the beginning of the TABLE statement.
    PROC TABULATE DATA=TEMP;
       CLASS OCCUP GENDER SECTOR;
       VAR INCOME;
       TABLE SECTOR, OCCUP, (GENDER ALL)*INCOME*MEAN;
    RUN;
    
  3. Add a page for the totals. All you have to do to get a final page with the totals is to add the class variable ALL to the page dimension. By using a space as the operator, ...

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.