function InterQuartile(const X: TVec; Method: TPercentileMethod): Double;
InterQuartile range.
| # | Name | Description |
|---|---|---|
| 1 | X | Data. An exception is raised if X is complex. |
| 2 | Method | Defines one of the available methods for calculating percentile. Software packages use different methods to calculate percentiles. For example, Excel uses pctMethodNMinus, while on the other hand, NCSS's default method is pctMethodNPlus. |
Returns: Double - the interquartile range of all X vector elements. The interquartile range is defined as a difference between 75th percentile and 25th percentile of given values.
Examples
Uses MtxExpr, Statistics, Math387;
function Example: double;
var a: Vector;
Res: double;
begin
a.Size(4);
a.SetIt([2,0.1,3,4]);
Result := InterQuartile(a, TPercentileMethod.pctMethodNMinus); // Res = 1.725 //Excel convention
end;
end;
See Also: Statistics.Percentile