gilbertchiao/statistics

Simple statistics library.

v1.1.0 2023-11-02 13:59 UTC

This package is auto-updated.

Last update: 2025-06-29 02:07:17 UTC


README

Simple statistics library.

Installation

composer require gilbertchiao/statistics

Usage

<?php

require 'vendor/autoload.php';

use GilbertChiao\Utility\Statistics as Stat;

$array = [1, 2, 3, 4, 5];

// Mean / Average
echo Stat::Mean($array);
echo Stat::Average($array);

// Lower quartile
echo Stat::Q1($array);

// Q2 / Median
echo Stat::Q2($array);
echo Stat::Median($array);

// Upper quartile
echo Stat::Q3($array);

// SD / Standard Deviation
echo Stat::SD($array);
echo Stat::StandardDeviation($array);

Source

This package inspired by Bastians Tech Blog.

License

The MIT License (MIT). Please see License File for more information.