Mode(Sample: Array): Double;
Sample. Data array.
The Mode method returns a mode, that is the most frequently occurring value in a data array.
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).
Sub Main;
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 Main;
Executing this example shows a mode in the console window:
Module execution started
Mode: 9
Module execution finished
See also: