Documentation

Percentiles
in package

Table of Contents

Constants

RANK_SORT_ASCENDING  = 1
RANK_SORT_DESCENDING  = 0

Methods

PERCENTILE()  : float|string
PERCENTILE.
PERCENTRANK()  : float|string
PERCENTRANK.
QUARTILE()  : float|string
QUARTILE.
RANK()  : float|string
RANK.
percentileFilterValues()  : array<string|int, mixed>
rankFilterValues()  : array<string|int, mixed>

Constants

RANK_SORT_ASCENDING

public mixed RANK_SORT_ASCENDING = 1

RANK_SORT_DESCENDING

public mixed RANK_SORT_DESCENDING = 0

Methods

PERCENTILE()

PERCENTILE.

public static PERCENTILE(mixed ...$args) : float|string

Returns the nth percentile of values in a range..

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

Parameters
$args : mixed

Data values

Return values
float|string

The result, or a string containing an error

PERCENTRANK()

PERCENTRANK.

public static PERCENTRANK(mixed $valueSet, mixed $value[, mixed $significance = 3 ]) : float|string

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

Parameters
$valueSet : mixed

An array of (float) values, or a reference to, a list of numbers

$value : mixed

The number whose rank you want to find

$significance : mixed = 3

The (integer) number of significant digits for the returned percentage value

Return values
float|string

(string if result is an error)

QUARTILE()

QUARTILE.

public static QUARTILE(mixed ...$args) : float|string

Returns the quartile of a data set.

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

Parameters
$args : mixed

Data values

Return values
float|string

The result, or a string containing an error

RANK()

RANK.

public static RANK(mixed $value, mixed $valueSet[, mixed $order = self::RANK_SORT_DESCENDING ]) : float|string

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

Parameters
$value : mixed

The number whose rank you want to find

$valueSet : mixed

An array of float values, or a reference to, a list of numbers

$order : mixed = self::RANK_SORT_DESCENDING

Order to sort the values in the value set

Return values
float|string

The result, or a string containing an error (0 = Descending, 1 = Ascending)

percentileFilterValues()

protected static percentileFilterValues(array<string|int, mixed> $dataSet) : array<string|int, mixed>
Parameters
$dataSet : array<string|int, mixed>
Return values
array<string|int, mixed>

rankFilterValues()

protected static rankFilterValues(array<string|int, mixed> $dataSet) : array<string|int, mixed>
Parameters
$dataSet : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results