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 [14-17]


NLEVELS Option
NLevels is another useful option from Proc Freq. 

It displays the number of levels for the variables listed in the TABLE statement.

​Let's take a look at the CARS data set from the SASHelp library.

Example
Picture

How many car makers are there in the data set?

We can find that out by checking the number of levels the variable Make has in the data set.

Example

Proc Freq Data = SASHelp.cars NLevels;
Table Make;
​Run;
Picture

The NLevels option shows the number of levels the variable Make has in the data set.
Picture

The table shows that there are 38 levels from the variable Make.

There are 38 car makers in the data set.

Exercise

Locate the FISH data set from the SASHelp library.

Compute the number of species listed in the data set.
Next

Need some help? 

Get Hint
Get Solution

Fill out my online form.
Already a member? Go to member's area.