TABMODE procedure

Forms summary tables of modes of values (R.W. Payne).


Options

PRINT = string
Controls whether or not the modes are printed (mode); default * i.e. no printing

CLASSIFICATION = factors
Factors classifying the tables; if unset, the overall mode is formed for all the values in each DATA vector


Parameters

DATA = variates or factors
Data values whose modes are to be formed

MODES = tables or scalars
Save the modes for each DATA vector


Description

TABMODE forms tables summarizing the values in a variate of factor by their modes i.e. by the values that occur most often. The variates or factors are specified by the DATA parameter, and the modes can be saved using the MODES parameter. The CLASSIFICATION option can supply a list of factors, so that MODES will then be a table giving the mode for the DATA values with each combinations of the factor levels. Alternatively, if CLASSIFICATION is not set, MODES is a scalar containing the mode of all the values in DATA. You can request for the modes to be printed by setting option PRINT=modes.

 

Options: PRINT, CLASSIFICATION.

Parameters: DATA, MODES.


Method

TABMODE converts any DATA variates into factors (with a level for each distinct value) using GROUPS. It then uses TABULATE to form tables of counts, classified by the CLASSIFICATION factors (if any) and by the DATA factor. CALCULATE is then used to identify the mode. If there are several values occurring the maximum number of times, TABMODE will take the middle one.


Action with RESTRICT

TABMODE takes account of any restrictions defined on the DATA variates or factors.