Lesson 12: Summarizing Categorical Data

Overview Section

In this lesson, we'll investigate the FREQ procedure as a tool for summarizing and analyzing categorical data. The procedure is a descriptive procedure, as well as a statistical procedure. It allows you to produce one-way to n-way frequency and cross tabulation tables. For two-way tables, the FREQ procedure also computes chi-square tests and measures of association. And, for n-way tables, the FREQ procedure also performs stratified analyses, computing statistics within as well as across strata. The FREQ procedure can also be used to output summary statistics, such as counts and percentages, to a SAS data set.

Objectives

Upon completion of this lesson, you should be able to:

Upon completing this lesson, you should be able to use the FREQ procedure to summarize a data set numerically in a variety of ways, including:

  • create simple one-way, two-way, ... and n-way table summaries
  • use the NOCUM option to suppress the printing of cumulative statistics in a table
  • use the PAGE option to tell SAS to print only one table per page
  • know how to read the values from a two-way table created by the FREQ procedure
  • create two-way (and in general, n-way) tables using the available shortcuts
  • use the NOROW, NOCOL, and NOPERCENT options to suppress some of the default output in each of the cells of an n-way table
  • request additional output in each of the cells of an n-way table, such as EXPECTED, DEVIATION, and CELLCHI2
  • use the LIST and CROSSLIST tables options to print n-way tables in a list format rather than as crosstabulation tables
  • use a BY statement to tell SAS to perform an operation for each level of the BY-group
  • use the MISSING tables option tells SAS to treat missing values as nonmissing values, and to therefore include them in the calculation of the statistics
  • use the MISSPRINT option tells SAS to treat missing values as nonmissing values when printing the frequencies, but to not include them in the calculation of the statistics
  • use the FREQ procedure create new SAS data sets containing summary statistics of categorical variables
  • use the NOPRINT tables option to tell SAS to suppress printing the n-way crosstabulation
  • use the SPARSE tables option tells SAS to print information about all possible combinations of levels of the variables in the table request, even when some combinations of levels do not occur in the data
  • invoke statistics table options, such as CHISQ, MEASURES, CMH, ALL, and EXACT