Creating Two-Way Tables

So far, you have used the FREQ procedure to create one-way frequency tables. However, it is often helpful to crosstabulate frequencies of two or more variables. For example, census data is typically crosstabulated with a variable that represents geographical regions.
The simplest crosstabulation is a two-way table. To create a two-way table, join two variables with an asterisk (*) in the TABLES statement of a PROC FREQ step.
General form, TABLES statement for crosstabulation:
TABLES variable-1 *variable-2 <* ... variable-n>;
where (for two-way tables)
  • variable-1 specifies table rows
  • variable-2 specifies table columns.
When crosstabulations are specified, PROC FREQ produces tables with cells ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third 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.