tersmitten/cakephp-statistics

A Statistics Plugin for CakePHP

v1.1.0 2016-05-28 15:52 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:27:41 UTC


README

Build Status PHP 7 ready Coverage Status Packagist downloads Code Climate

Requirements

  • CakePHP 2.4.2 or greater.
  • PHP 5.4.16 or greater.

Installation

Clone/Copy the files in this directory into app/Plugin/Statistics

Configuration

Ensure the plugin is loaded in app/Config/bootstrap.php by calling:

CakePlugin::load('Statistics');

Usage

Sum

Statistics::sum(array(1, 2, 3));

Minimum

Statistics::min(array(1, 2, 3));

Maximum

Statistics::max(array(1, 2, 3));

Mean

Statistics::mean(array(1, 2, 3));

Frequency

Statistics::frequency(array(1, 2, 3, 3, 3));

Mode

Statistics::mode(array(1, 2, 2, 3));

Variance (sample and population)

Statistics::variance(array(1, 2, 3));
Statistics::variance(array(1, 2, 3), false);

Standard deviation (sample and population)

Statistics::standardDeviation(array(1, 2, 3));
Statistics::standardDeviation(array(1, 2, 3), false);

Range

Statistics::range(array(4, 6, 10, 15, 18));