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 [11-15]


Proc Freq

​Proc Freq is another commonly used statistical procedures in SAS.

It computes the counting statistics on categorical variables.

Example​
Picture

The BULBS data set contains a list of light bulbs sold at a convenience store.

There are three types of light bulbs:
  • Halogen
  • Incandescent
  • LED

We can count the number of light bulbs of each type using Proc Freq.

Example

Proc Freq Data=Bulbs;
Table Type;
Run;
Picture

TABLE Statement

The TABLE statement tells SAS to count how many times each type of light bulbs appear in the data set (i.e. frequency statistics).

The results are shown in a 1-way frequency table below:
Picture

The halogen light bulb appears 2 times in the data set while the incandescent and LED light bulbs appear 4 and 6 times, respectively.
Picture

The procedure correctly computed the frequency statistics for each type of light bulbs.

In addition to the frequency statistics, Proc Freq also computes:
  • the percentage
  • the cumulative frequency
  • the cumulative percentage

Frequency/Counting statistics offer great insights about the distribution of the data.

​You will learn a few more examples later in this module.

Exercise

Copy and run the GUMSALES data set on SAS Studio:

The GUMSALES data set contains a list of transactions for the 3 brands of gum.

It contains 3 variables:
  • ReceiptID: the receipt number for the transaction
  • Brand: the brand of the gum
  • Price: the price of the gum

Count how many times each brand of gum is being sold.
Next

Need some help? 


HINT:
Make sure you use the TABLE statement in Proc Freq.


SOLUTION:
Proc Freq Data=Gumsales;
Table Brand;
Run;


Fill out my online form.

Already a member? Go to member's area.