Percentages for Analysis Variables

Generally, when you use percentages, you want to compare various categories of your data. For example, you might want to know what percentage of college graduates are male versus female. However, you can also use percentages to compare two analysis variables.
The following code produces a table with columns for two different analysis variables: INCOME and NEWINC:
PROC TABULATE DATA=TEMP;
   CLASS GENDER EDUC;
   VAR INCOME NEWINC;
   TABLE GENDER*EDUC, INCOME*MEAN NEWINC*MEAN;
RUN;
When you look at Output 8.18, you can see the two income measures side by side. But the table would be more useful if you could add a column that quantified the difference between the two measures.
Output 8.18 Table Showing Mean Income ...

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.