Add a Class Variable
After seeing the tables
that we have built so far in this chapter, you are probably asking
yourself, "Why use PROC TABULATE? Everything I’ve seen
so far could be done with PROC MEANS."
One answer to this question
is class variables. By specifying a variable to categorize your data,
you can produce a concise table that shows values for various subgroups
in your data. For example, it would be more interesting to look at
mean income if it were broken down by the education level of the survey
respondent. This is the third piece of the example table for this
chapter.
To break down income by education level, we use EDUC as a class variable. Just as we used a VAR statement to identify our analysis variable, we use a CLASS statement ...
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.