Turn a One-Dimensional Table into a Two-Dimensional Table

Add the Columns

The easiest way to build a two-dimensional table is to build it one dimension at a time. First, we will build the columns, and then we will add the rows.
For this first table, we will keep things simple. This is a table with two columns: one showing the number of observations for INCOME and another showing the mean of INCOME.
PROC TABULATE DATA=TEMP;
   VAR INCOME;
   TABLE INCOME*N INCOME*MEAN;
RUN;
Output 5.1 shows the results.
Output 5.1 One–Dimensional Table with Two Columns
dimensional table with Two Columns

Add the Rows

To turn this table into a two-dimensional table, we will add another variable ...

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.