PHPackages                             wesleyk079/statistic\_functionalities - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wesleyk079/statistic\_functionalities

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wesleyk079/statistic\_functionalities
=====================================

Library that contains two classes: Correlation &amp; Deviation. These classes can be used to calculate standard deviation and spearman's rank correlation.

0206PHP

Since Jan 24Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wesley079/statistic_functionalities)[ Packagist](https://packagist.org/packages/wesleyk079/statistic_functionalities)[ RSS](/packages/wesleyk079-statistic-functionalities/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Statistic functionalities
=========================

[](#statistic-functionalities)

**This repository is made for solutions involving software from NewCompliance B.V Group**

The functions included in this library will calculate deviation and correlation in from a JSON file.

The demo included will give you an example on how to make use of this library

Install the library
-------------------

[](#install-the-library)

Require the library in your composer.json

`composer require wesleyk079/statistic_functionalities "dev-master"`

Make sure your framework or php-script loads the 'autoload.php' from composer's vendor directory.

\#1 Deviation
-------------

[](#1-deviation)

**Include the library:**

Use 'statisticFunctionalities\\functions\\Deviation';

**Adjust the options as wanted**

```
//example for setting the options
$options = [
    "FileToCheck"               => json_decode(file_get_contents("../generatedFiles/generatedInformation.json")),
    "KeyToSelect"               => "Verrichting 1",
    "KeyToSearchFor"            => "Operatieduur",
    "RemoveOutliers"            => true,
    "SecondComparison"          => true,
    "SecondKeyToFindDeviation"  => "Geplande duur",
    "FirstCategoryMax"          => 20,
    "MiddleCategoryMax"         => 60,
    "FirstPercentageMeasure"    => 20,
    "MiddlePercentageMeasure"   => 12.5,
    "LastPercentageMeasure"     => 10,
    "PositiveFeedback"          => "Wel goed in te schatten",
    "NegativeFeedback"          => "Niet goed in te schatten"

];

```

**Initialize the deviation class**

```
$deviation = new statisticFunctions\Deviation($options);

```

**Get the results**

```
$deviationResults = $deviation->GetDeviationStatistics();

```

What does my result contain?
----------------------------

[](#what-does-my-result-contain)

The following keys will be available from all results in the returned array

**amount** - the amount of measured cases

**mean** - the mean of all meaasured numbers

**standardDev** - standard deviation (1 time)

**statisticMin** - mean - (standarddeviation \* 3)

**statisticMax** - mean + (standarddeviation \* 3)

**lowerThanComparison** - Amount of cases where the number lower than the comparison number

**higherThanComparison** - Amount of cases where the number was higher than the comparison number

**Advice** - Advice as stated at the settings (positive or negative feedback). If (standarddeviation \* 3) is smaller than (mean \* percentage), it will be positive. The percentage will be taken from the percentageMeasure based on categories.

### Example on how to treat the results

[](#example-on-how-to-treat-the-results)

```
foreach($deviationResults as $result){

    There were  cases that included '' as .

    The data was divided by a standard deviation of ' ~ '

    This means in 68.26% of the cases,  will be
    between
}

```

\#2 Correlation
---------------

[](#2-correlation)

Change options to your personal wishes and settings

**Include the library:**

Use 'statisticFunctionalities\\functions\\Correlation';

**Adjust the options as wanted**

```
//example for setting the options
$options = [
    "FileToCheck"           => json_decode(file_get_contents("../generatedFiles/generatedInformation.json")),
    "KeyToSearchFor"        => "Operatieduur",
    "KeyToSelect"           => "Verrichting 1",
    "ValueForKeyToSelect"   => "Verwijderen buisjes uit oren",
    "ExcludeKeywords"       => ["Patiëntnummer", "Casusnummer"]
];

```

**Initialize the deviation class**

```
$correlation = new statisticFunctions\Correlation($options);

```

**Get the results**

```
$results = $correlation->calculateCorrelations();

```

What does my result contain?
----------------------------

[](#what-does-my-result-contain-1)

**xTitle** - Title of the x-axis that was being measured

**yTitle** - Title of the y-axis that was being measured

**coefficient** - the correlation coefficient between the values of xTitle and yTitle ### These results can be used to get a advise if wanted

[](#these-results-can-be-used-to-get-a-advise-if-wanted)

```

    //Result: The variable 'Operatieduur' looks like growing when 'Wond open (min)' is higher. The correlation is stated as moderate correlation: 0.51029910576627

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9f663c7edc9114aae52142dc4005bd6339f88fb2dc362ec3baec4b486757a1dc?d=identicon)[wesley079](/maintainers/wesley079)

---

Top Contributors

[![wesley079](https://avatars.githubusercontent.com/u/12712616?v=4)](https://github.com/wesley079 "wesley079 (38 commits)")

### Embed Badge

![Health badge](/badges/wesleyk079-statistic-functionalities/health.svg)

```
[![Health](https://phpackages.com/badges/wesleyk079-statistic-functionalities/health.svg)](https://phpackages.com/packages/wesleyk079-statistic-functionalities)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
