IMSTAT Procedure (Analytics)

FREQUENCY Statement

The FREQUENCY statement is used to calculate a frequency distribution for one or more variables.

Syntax

FREQUENCY variable-list </ options>;

Required Argument

variable-list

specifies the numeric and character variables to use for calculating the frequency distribution. The distribution is calculated for the unique formatted values of the variables.

FREQUENCY Statement Options

DESCENDING

specifies that the levels of the GROUPBY variables are to be arranged in descending order.

Alias DESC

FORMATS=("format-specification", ...)

specifies the format to apply to each variable. Specify the list as a comma-separated list and enclose each format specification in quotation marks. If you do not specify a format, then the default format for the variable is used.

MERGEBINS=b

specifies the number of bins to create when a numeric GROUPBY variable exceeds the MERGELIMIT=n specification. If you specify a MERGELIMIT, but do not specify a value for the MERGEBINS= option, the server automatically calculates the number of bins.

MERGELIMIT=n

specifies that when the number of unique values in a numeric GROUPBY variable exceeds n, the variable is automatically binned and the GROUPBY structure is determined based on the binned values of the variable, rather than the unique formatted values.

For example, if you specify MERGELIMIT=500, any numeric GROUPBY variable with more than 500 unique formatted values is binned. Instead of returning results for more than 500 groups, the results are returned for the bins. You can specify the number of bins with the MERGEBINS= option.

NOEMPTY

specifies that empty cells are not returned to the SAS session (only full cells are returned). When this option is specified, the server eliminates all levels with zero frequency from the result set.

Alias FULLCELL

NOMISS

specifies that missing values are excluded in the calculation of formatted values. By default, levels with missing values are included.

Alias NOMISSING

RAWORDER

specifies that the ordering of the GROUP BY value is based on the raw values of the variables instead of the formatted values.

SAVE=table-name

saves the result table so that you can use it in other IMSTAT procedure statements like STORE, REPLAY, and FREE. The value for table-name must be unique within the scope of the procedure execution. The name of a table that has been freed with the FREE statement can be used again in subsequent SAVE= options.

SETSIZE

requests that the server estimate the size of the result set. The procedure does not create a result table if the SETSIZE option is specified. Instead, the procedure reports the number of rows that are returned by the request and the expected memory consumption for the result set (in KB). If you specify the SETSIZE option, the SAS log includes the number of observations and the estimated result set size. See the following log sample:

NOTE: The LASR Analytic Server action request for the STATEMENT
      statement would return 17 rows and approximately
      3.641 kBytes of data.
The typical use of the SETSIZE option is to get an estimate of the size of the result set in situations where you are unsure whether the SAS session can handle a large result set. Be aware that in order to determine the size of the result set, the server has to perform the work as if you were receiving the actual result set. Requesting the estimated size of the result set does consume resources on the server. The estimated number of KB is very close to the actual memory consumption of the result set. It might not be immediately obvious how this size relates to the displayed table, since many tables contain hidden columns. In addition, some elements of the result set might not be converted to tabular output by the procedure.

TEMPEXPRESS="SAS-expressions"

TEMPEXPRESS=file-reference

specifies either a quoted string that contains the SAS expression that defines the temporary variables or a file reference to an external file with the SAS statements.

Alias TE=

TEMPNAMES=variable-name

TEMPNAMES=(variable-list)

specifies the list of temporary variables for the request. Each temporary variable must be defined through SAS statements that you supply with the TEMPEXPRESS= option.

Alias TN=

Details

ODS Table Names

The FREQUENCY statement generates the following ODS table for each analysis variable.
ODS Table Name
Description
Option
Frequency
Frequency information for one column
Default
For information about using the ODS table with SAVE= option, see the Details section of the STORE statement.