IStatistics.Median

Syntax

Median(Values: Array): Double;

Parameters

Values. The set of values median of which is to be found.

Description

The Median method returns the median of specified numbers.

Comments

Median is a number which is the middle of a number set, that is, half of numbers has values greater than the median and the other half has values less than the median.

Example

Sub Main;

Var

st: Statistics;

d0: Double;

y: Array Of Double;

Begin

y := New Double[10];

y[00] := 1.6;

y[01] := 1.7;

y[02] := 1.8;

y[03] := 1.9;

y[04] := 2;

y[05] := 2.1;

y[06] := 2.2;

y[07] := 2.3;

y[08] := 2.4;

y[09] := 2.8;

st := New Statistics.Create;

d0 := st.Median(y);

Debug.WriteLine("Median: " + d0.ToString);

End Sub Main;

Executing this example shows a median in the console window:

Module execution started

Median: 2.0499999999999998

Module execution finished

See also:

IStatistics