O'Reilly logo

SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition by Wayne A. Woodward, Alan C. Elliott

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required