Two–Dimensional Tables

Let’s look at what a comma does to the table structure. Consider the following code, with two different TABLE statements, but using the same variables in two different arrangements:
PROC TABULATE DATA=CHPT01;
   CLASS GENDER;
   VAR INCOME;
   1 TABLE GENDER ALL, INCOME;
   2 TABLE INCOME, GENDER ALL;
RUN;
The comma in each TABLE statement tells PROC TABULATE to build a new dimension. So for the first TABLE statement, the output has the table for GENDER and ALL in the row dimension and the column for the sum of INCOME values in the column dimension. Notice in the first TABLE statement that the comma operator separates GENDER ALL from INCOME. So, in Output 2.5, you can see that INCOME is in the column dimension, while GENDER and ALL ...

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.