Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Data Analysis [15-15]


(OUT=) Option
Just like Proc Univariate and Proc Means, you can create an output data set for the analysis results for Proc Freq as well.

​Let's take a look at the CS data set again.
Picture

To create an output data set, simply add the (OUT=) option to the TABLE statement.

Example

Proc Freq Data=CS;
Table Rating / Out=Stat;
Run;
Picture

The (OUT=) option creates the output data set that contains the frequency statistics such as count and percent:
Picture

2-Way Crosstabulation Table

Creating the output data set for a 2-way crosstabulation table is just the same.

Example

​Proc Freq Data=CS;
Table Gender * Rating / Out=Stat2;
Run;
Picture

The (OUT=) option will create an output data set that has the frequency statistics across both the Gender and Rating.
Picture

What if you want to include the row and column percentage as well?


​Simply add the OUTPCT option after the (OUT=) option.

Example

​Proc Freq Data=CS;
Table Gender * Rating / Out=Stat2 OUTPCT;
Run;
Picture

The output data set will include the row and column percentage:
Picture

Exercise

Locate the CLASS data set from the SASHelp library.

The CLASS data set contains a list of students as well as their gender (sex) and age.

Create a 2-way crosstabulation table across gender and age. Suppress the results on the Results window and save the results in a data set instead.
Next

Need some help? 


HINT:
Use the Noprint option to suppress results showing on the Results window.


SOLUTION:
Proc Freq Data=SASHelp.Class Noprint;
Table Sex*Age / Out=Class2;
Run;


Fill out my online form.

Already a member? Go to member's area.