

Here the value of the variable is taken as the number of observations instead of the count of value. With the weight option we can calculate the frequency distribution biased with the weight of the variable.
#Proc freq sas code#
When the above code is executed, we get the following result − Frequency Distribution with Weight In the below example we calculate the frequency distribution for the make of a car for grouped by car type and also the frequency distribution of each type of car grouped by each make. We can find the frequency distributions for multiple variables which groups them into all possible combinations. Below we show the SAS code and the output for proc freq. When the above code is executed, we get the following result − Multiple Variable Frequency Distribution SELECT make, model, type, invoice, horsepower, length, weight We can see the result divided into two categories of results.

In the below example we find the frequency distribution of the variable horsepower for the dataset named CARS1 which is created form the library SASHELP.CARS. The result also shows the percentage distribution, cumulative frequency and cumulative percentage. In this case the result will show the frequency of each value of the variable. We can determine the frequency distribution of a single variable by using PROC FREQ. Variables_2 is the variables which categorised the frequency distribution result. Variables_1 is the variable names of the dataset whose frequency distribution needs to be calculated. The basic syntax for calculating frequency distribution in SAS is −įollowing is the description of the parameters used − PROC FREQ groups a variables values according to the formatted values. To get the FREQ procedure to count missing values, use three tricks: Specify a format for the variables so that the missing values all have one value and the nonmissing values have another value.

SAS provides a procedure called PROC FREQ to calculate the frequency distribution of data points in a data set. The FREQ procedure is a SAS workhorse that I use almost every day. Each entry in the table contains the frequency or count of the occurrences of values within a particular group or interval, and in this way, the table summarizes the distribution of values in the sample. A frequency distribution is a table showing the frequency of the data points in a data set.
