Sentry Page Protection
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
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
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;
The NLevels option shows the number of levels the variable Make has in the data set.
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.
Locate the FISH data set from the SASHelp library.
Compute the number of species listed in the data set.
Need some help?
Fill out my online form.