Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.

Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]

(no description)

File Size: 205 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Percentiles:: (6 methods):
  PERCENTILE()
  PERCENTRANK()
  QUARTILE()
  RANK()
  percentileFilterValues()
  rankFilterValues()


Class: Percentiles  - X-Ref

PERCENTILE(...$args)   X-Ref
PERCENTILE.

Returns the nth percentile of values in a range..

Excel Function:
PERCENTILE(value1[,value2[, ...]],entry)

return: float|string The result, or a string containing an error
param: mixed $args Data values

PERCENTRANK($valueSet, $value, $significance = 3)   X-Ref
PERCENTRANK.

Returns the rank of a value in a data set as a percentage of the data set.
Note that the returned rank is simply rounded to the appropriate significant digits,
rather than floored (as MS Excel), so value 3 for a value set of  1, 2, 3, 4 will return
0.667 rather than 0.666

return: float|string (string if result is an error)
param: mixed $valueSet An array of (float) values, or a reference to, a list of numbers
param: mixed $value The number whose rank you want to find
param: mixed $significance The (integer) number of significant digits for the returned percentage value

QUARTILE(...$args)   X-Ref
QUARTILE.

Returns the quartile of a data set.

Excel Function:
QUARTILE(value1[,value2[, ...]],entry)

return: float|string The result, or a string containing an error
param: mixed $args Data values

RANK($value, $valueSet, $order = self::RANK_SORT_DESCENDING)   X-Ref
RANK.

Returns the rank of a number in a list of numbers.

return: float|string The result, or a string containing an error (0 = Descending, 1 = Ascending)
param: mixed $value The number whose rank you want to find
param: mixed $valueSet An array of float values, or a reference to, a list of numbers
param: mixed $order Order to sort the values in the value set

percentileFilterValues(array $dataSet)   X-Ref
No description

rankFilterValues(array $dataSet)   X-Ref
No description