Add a Third Dimension
Because the two-dimensional
table here looks correct, we will go on to adding the third dimension.
Just like when we converted a one-dimensional table to a two-dimensional
table, we add a new dimension with a comma operator in the TABLE statement.
We add the new variable SECTOR to the existing TABLE statement with
a comma to separate it from the row and column definitions.
You might think that
the following code is the correct way to add the third dimension to
the TABLE statement. However, what this would generate is a table
with GENDER as the rows, SECTOR as the columns, and OCCUP as the pages!
TABLE OCCUP, (GENDER ALL)*INCOME*MEAN, SECTOR;
To add the third dimension
to a table correctly, you add it at the beginning
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.