Skip to content

Instantly share code, notes, and snippets.

@abhishekdagarit
Last active September 23, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhishekdagarit/fa5e986c35885cebe7c2ccbccc1c2cf4 to your computer and use it in GitHub Desktop.
Save abhishekdagarit/fa5e986c35885cebe7c2ccbccc1c2cf4 to your computer and use it in GitHub Desktop.
Frequency in SAS

Frequency in SAS

Used using the proc freq statement

complete frequency table

proc freq data=work.test;
run;

Frequency of only one variable. This uses the table keyword.

Table

proc freq data=work.test;
table post;
run;

Two table

proc freq data=work.test;
table post project;
run;

Two way tables

proc freq data=work.test;
table post*project;
run;

Three way tables

proc freq data=work.test;
table post*project*salary;
run;

List view

proc freq data=work.test;
table post*rating/list;
run;

Removing cummulative value

proc freq data=work.test;
table post/nofreq;
run;

Removing percentage

proc freq data=work.test;
table post/nopercent;
run;

Removing cummulative values from only one in the two tables

proc freq data=work.test;
table post;
table project/nocum;
run;

Removing row in the two way tables

proc freq data=work.test;
table post*rating/norow;
run;

Removing row and percentage in the two way tables

proc freq data=work.test;
table post*rating/norow nopercent;
run;

Removing row, percentage and freq as well in the two way tables

proc freq data=work.test;
table post*rating/norow nopercent nofreq;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment