One-Way Frequency of Eye Color By Region
Overview
Use the Frequency transformations to produce one-way to n-way frequency and
contingency (crosstabulation) tables. The Frequency transformations are based on the
FREQ procedure, which generates frequency statistics. For more information about this
procedure, see "The FREQ Procedure" section in Base SAS Procedures Guide.
There are two Frequency transformations: Frequency and One-Way Frequency. The
Frequency transformation uses PROC FREQ to compute statistics for complex tests,
measures of association, and stratified analysis of one-way to n-way tables. The One-
Way Frequency transformation is used for simpler PROC FREQ analysis on one-way
tables to examine the relationship between two classification variables. It can also be
used to compute statistics for equal proportions, specified proportions, or the binomial
proportion. The One-Way Frequency transformation also has a subset of the options
available for the Frequency transformation.
Both Frequency transformations control many aspects of the analysis, including the
following:
grouping of rows by the values in one or more columns
how the rows appear in the report
which column or columns are analyzed
You can use the Frequency transformations to generate frequency statistics in a target
and on the Output tab of the Job Editor. ODS output in the form of HTML, PDF, or
RTF can be sent to a folder on the SAS Application Server that executes the job. ODS
output can also be sent to any folder with access to that SAS Application Server.
The target receives data only for the source columns that are involved in the analysis.
The target requires two columns that either Frequency transformation populates: Count
receives the total number of occurrences in a category, and Percent receives the
percentages for each category.
You can specify grouping columns in the Frequency transformations. When you do this,
a SAS BY statement orders target rows according to the values in the grouping columns.
The Frequency transformations require that grouping columns be sorted in ascending
order in the source. If you specify grouping columns, you can sort those columns before
the Frequency transformation using a SAS Sort transformation.
For examples of how you can use the Frequency transformations, see the Frequency of
Eye Color By Hair Color Crosstabulation at “Frequency of Eye Color By Hair Color
Crosstabulation” on page 385 and the One-Way Frequency transformation example at
“One-Way Frequency of Eye Color By Region” on page 398.
Problem
You want to generate simple frequency statistics.
398 Chapter 18 Working with Analysis Transformations
Solution
You can use the One-Way Frequency transformation in a SAS Data Integration Studio
job to produce one-way frequency and crosstabulation (contingency) tables. For
example, you can create a job similar to the sample job featured in this topic. This
sample job generates a list of the numbers of individuals with particular combinations of
hair and eye color by geographical region. The frequency statistics are sent to a target
and to the Output tab in the Job Editor window. The sample job includes the following
tasks:
“Create and Populate the Job” on page 399
“Configure Analytical Options” on page 400
“Configure Reporting Options” on page 402
“Run the Job and View the Output” on page 403
Tasks
Create and Populate the Job
Perform the following steps to create and populate the job:
1. Create an empty SAS Data Integration Studio job.
2. Select and drag a One-Way Frequency transformation from the Access folder in the
Transformations tree. Then, drop it in the empty job on the Diagram tab in the Job
Editor window.
3. Select and drag the source table from its folder and drop it before the One-Way
Frequency transformation on the Diagram tab.
4. Drag the cursor from the source table to the input port of the One-Way Frequency
transformation. This action connects the source to the transformation.
5. Right-click the One-Way Frequency transformation, and click Add Output Port
from the Ports option in the drop-down menu. This step enables you to add an
output port to the transformation.
6. Select and drag the source table from the Inventory tree. Then, drop it after the One-
Way Frequency transformation on the Diagram tab.
7. Drag the cursor from the One-Way Frequency transformation output port to the
target table. This action connects the target to the transformation.
The following display shows a sample process flow diagram for a job that contains the
One-Way Frequency transformation:
Display 18.37 Sample Process Flow
One-Way Frequency of Eye Color By Region 399

Get SAS Data Integration Studio 4.9 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.