IStatistics.Mode

Syntax

Mode(Sample: Array): Double;

Parameters

Sample. Data array.

Description

The Mode method returns a mode, that is the most frequently occurring value in a data array.

Comments

The Mode function is a measure of value positional relationship. If all values of source data array are unique (occur only once), then Mode returns NODATA (equal to 1#.QNAN).

Example

To execute the example, add a link to the Stat system assembly.

Sub UserProc;
Var
    st: Statistics;
    d0: Double;
    y: Array Of Double;
Begin
    y := New Double[10];
    y[00] := 14;
    y[01] := 17;
    y[02] := 9;
    y[03] := 15;
    y[04] := 21;
    y[05] := 15;
    y[06] := 20;
    y[07] := 9;
    y[08] := 14;
    y[09] := 9;
    st := New Statistics.Create;
    d0 := st.Mode(y);
    Debug.WriteLine("Mode: " + d0.ToString);
End Sub UserProc;

Executing the example shows a mode in the console window:

Unit execution started

Mode: 9

Unit execution finished

See also:

IStatistics