MODE inputVector resultVariable

Replaces the contents of the result variable with the most frequently occurring value from the input vector. If two or more values occur with the same frequency, the lowest value is chosen. If all values are unique, the lowest value is chosen.

Missing values (represented by "." or "NaN"), are ignored in the computation.

NOTE: this command is designed for use with input vectors whose contents are from a discrete distribution. If you want to compute the mode for data from a continuous distribution you should use the MODE_CONTINUOUS subroutine that is in the library.

COPY 3#4 4#5 2#6 A
MODE A mode
PRINT A mode

The above program produces the following output:

A: (4.0 4.0 4.0 5.0 5.0 5.0 5.0 6.0 6.0)

mode: 5.0