Cross tabulation with a controlling variable

The real use of Proc Freq comes when we produce n-way or cross-tables with more than two variables. In the following example, we introduce a three-way cross-tabulation by including the Weight variable. Notice that the output is segregated into two tables with the first specified variable, Class, being the common factor:

Proc Freq Data = Class;Table Class*Weight*Height / nocol norow nocum nofreq;Run;

This results in the following output:

The order of the variables in the Proc Freq statement is important in determining the controlling variable for a cross-tabulation output. Look at how not putting ...

Get Hands-On SAS for Data Analysis 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.