Friday, December 11, 2015

SAS: Count the number of distinct levels of a variable

Starting in SAS 9.2, PROC FREQ has an option to count the number of unique levels of a variable. Very handy.

proc freq data=sashelp.class nlevels;
   tables name age sex;
title 'Number of distinct values for each variable'; 

From .

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner