37        foreach ($aArgs as $k => $arg) {
 
   45            if (self::isAcceptedCountable($arg, $k)) {
 
   46                $returnValue += abs($arg - $aMean);
 
   56        return $returnValue / $aCount;
 
   73        $returnValue = $aCount = 0;
 
   84            if (self::isAcceptedCountable($arg, $k)) {
 
   92            return $returnValue / $aCount;
 
  119                if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != 
'')))) {
 
  122                    } elseif (is_string($arg)) {
 
  125                    $returnValue += $arg;
 
  132            return $returnValue / $aCount;
 
  157        $valueCount = count($aArgs);
 
  158        if ($valueCount > 0) {
 
  159            sort($aArgs, SORT_NUMERIC);
 
  160            $valueCount = $valueCount / 2;
 
  161            if ($valueCount == floor($valueCount)) {
 
  162                $returnValue = ($aArgs[$valueCount--] + $aArgs[$valueCount]) / 2;
 
  164                $valueCount = floor($valueCount);
 
  165                $returnValue = $aArgs[$valueCount];
 
  184    public static function mode(...$args)
 
  192        if (!empty($aArgs)) {
 
  205                return  (is_numeric($value)) && (!is_string($value));
 
  216        $frequencyArray = [];
 
  221        foreach (
$data as $datum) {
 
  224            foreach ($frequencyArray as 
$key => $value) {
 
  225                if ((
string) $value[
'value'] == (
string) $datum) {
 
  226                    ++$frequencyArray[
$key][
'frequency'];
 
  227                    $freq = $frequencyArray[
$key][
'frequency'];
 
  228                    if ($freq > $maxfreq) {
 
  231                        $maxfreqdatum = $datum;
 
  232                    } elseif ($freq == $maxfreq) {
 
  233                        if ($frequencyArray[
$key][
'index'] < $frequencyArray[$maxfreqkey][
'index']) {
 
  235                            $maxfreqdatum = $datum;
 
  244            if ($found === 
false) {
 
  245                $frequencyArray[] = [
 
  257        return $maxfreqdatum;
 
An exception for terminatinating execution or to throw for unit testing.
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
static flattenArrayIndexed($array)
Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
static isMatrixValue($idx)
static testAcceptedBoolean($arg, $k)
MS Excel does not count Booleans if passed as cell values, but they are counted if passed as literals...
static median(... $args)
MEDIAN.
static averageA(... $args)
AVERAGEA.
static average(... $args)
AVERAGE.
static averageDeviations(... $args)
AVEDEV.
static mode(... $args)
MODE.
static filterArguments($args)