12.4 - Changing the Table Format12.4 - Changing the Table Format
When three or more variables are specified, the multiple levels of n-way tables can produce lots of output. Such bulky and complex crosstabulations are often easier to read as a continuous list. To tell SAS to generate list output for crosstabulations rather than the default tables, simply use the LIST tables option.
The following FREQ procedure illustrates the LIST option:
PROC FREQ data=icdb.back; title 'Crosstabulation of SEX and RACE: In List Format'; tables sex*race/list; RUN;
Launch and run the SAS program. Review the output to convince yourself that rather than creating a two-way table, SAS prints the requested two-way table as a list. I tend to prefer the LIST format for such cross-tabulations, as long as I'm not in need of the (conditional) row and column percentages (which, as you can see, are not reported in LIST format).
Incidentally, the LIST option cannot be used when the TABLES statement requests statistical tests or measures of association to be included in the output. (We'll be discussing such tests and measures later in this lesson.) Also, expected cell frequencies are not printed when the LIST option is specified, even if the EXPECTED option is invoked.
An alternative to the LIST option is the CROSSLIST table option. When you add the CROSSLIST option to your TABLES statement, SAS displays crosstabulation tables in the standard Output Delivery System (ODS) column format. The benefit of doing so probably won't make much sense until we learn about ODS in Stat 481. The option creates a table that has a table definition that you can customize by using the TEMPLATE procedure. For now, let's just be satisfied with looking at an example to see what the output looks like when you use the CROSSLIST option.
The following FREQ procedure illustrates the CROSSLIST option:
PROC FREQ data=icdb.back; title 'Crosstabulation of SEX and RACE: In Crosslist Format'; tables sex*race/crosslist; RUN;
Launch and run the SAS program, and review the output to familiarize yourself with the appearance of the output when you use the CROSSLIST option.