1. Go to this page and download the library: Download cjuol/statguard library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Cjuol\StatGuard\RobustStats;
$robust = new RobustStats();
$data = [10, 12, 11, 15, 10, 1000];
$huber = $robust->getHuberMean($data, 1.345, 50, 0.001);
use Cjuol\StatGuard\RobustStats;
$robust = new RobustStats();
$data = [10, 12, 11, 15, 10, 1000];
// Type 7 matches R's default quantile() behavior.
$winsorized = $robust->getWinsorizedMean($data, 0.1, 7);
use Cjuol\StatGuard\StatsComparator;
$comparator = new StatsComparator();
$data = [10, 12, 11, 15, 10, 1000];
$analysis = $comparator->analyze($data);
echo $analysis['verdict'];
// ALERT: Data is highly influenced by outliers. Use robust metrics.
use Cjuol\StatGuard\RobustStats;
$robust = new RobustStats();
file_put_contents('report.csv', $robust->toCsv($data));
echo $robust->toJson($data);