QuartileDcml(Data: Array; Quart: Integer): Decimal;
QuartileDcml(Data: System.Array; Quart: integer): decimal;
Data. Interval of numeric values related to probabilitites. Values in data array must be greater than zero.
Quart. The value to be returned. Valid values lie in the range [0; 4].
The QuartileDcml method returns quartile of data set of the Decimal type.
Quart value | Value returned by QuartileDcml |
0 | Minimum value. |
1 | First quartile (25-th percentile). |
2 | Median value (50-th percentile). |
3 | Third quartile (75th percentile). |
4 | Maximum value. |
Quartile is often used on analysis of sales to divide general set into groups.
To define numbers of the Decimal type in the array, it is necessary to write the "m" character after the value of each number. For example: 0.001m.
To execute the example, add a link to the Stat system assembly.
Sub UserProc;
Var
st: Statistics;
a: Array[5] Of Variant;
s: Decimal;
Begin
st := New Statistics.Create;
a[0] := 0.85m;
a[1] := 0.14m;
a[2] := 0.53m;
a[3] := 0.28m;
a[4] := 0.31m;
s:=st.QuartileDcml(a, 1);
Debug.WriteLine("First quartile: " + s.ToString);
End Sub UserProc;
After executing the example the console window displays the first quartile.
The requirements and result of the Fore.NET example execution match with those in the Fore example.
Imports Prognoz.Platform.Interop.Stat;
…
Public Shared Sub Main(Params: StartParams);
Var
st: Statistics;
a: Array[5] Of object;
s: decimal;
Begin
st := New Statistics.Create();
a[0] := 0.85m;
a[1] := 0.14m;
a[2] := 0.53m;
a[3] := 0.28m;
a[4] := 0.31m;
s:=st.QuartileDcml(a, 1);
System.Diagnostics.Debug.WriteLine("First quartile: " + s.ToString());
End Sub;
See also: