Chapter 20: Computing Frequencies

Introduction

You can use PROC FREQ to create one-way, two-way (row and column), and three-way (page, row, and column) tables. You can output counts and percentages as well as statistics such as chi-square and Fisher’s Exact test. This chapter shows you examples of these tasks.

Creating a Data Set to Demonstrate Features of PROC FREQ

The first step is to have some test data to demonstrate features of PROC FREQ. To this end, you can run Program 20.1 to generate a data set called Risk that includes the following variables:

Variable

Description

Subj

Subject number

Gender

1=Male, 2=Female

Age

Age in years

Chol

Cholesterol level

BP_Status

Blood pressure status (High or Low) ...

Get Getting Started with SAS Programming 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.