10ANALYZING COUNTS AND TABLES

Data that are collected as counts require a specific type of treatment. It doesn't make sense to calculate means and standard deviations on this type of data. Instead, categorical data (also called qualitative data) are often analyzed using frequency and cross-tabulation tables. The primary procedure within SAS® for this type of analysis is PROC FREQ.

10.1 USING PROC FREQ

PROC FREQ is a multipurpose SAS procedure for analyzing count data. It can be used to obtain frequency counts for one or more individual variables or to create two-way tables (cross-tabulations) from two variables. (Tables using three variables are discussed later in the chapter.)

PROC FREQ can also be used to perform statistical tests on count data. The syntax for PROC FREQ and commonly used options and statements that are discussed in this chapter is as follows:

PROC FREQ <options(s)>; <statements> TABLES requests </options> ;

Some common options for PROC FREQ are listed in Table 10.1.

Table 10.1 Common Options for PROC FREQ

Option Meaning
DATA=dataname Specifies which data set to use
ORDER=option Specifies the order in which results are listed in the output ...

Get SAS Essentials: Mastering SAS for Data Analytics, 2nd 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.