{"id":20207024,"url":"https://github.com/koolreport/statistics","last_synced_at":"2026-03-04T20:32:33.256Z","repository":{"id":57008500,"uuid":"185561600","full_name":"koolreport/statistics","owner":"koolreport","description":null,"archived":false,"fork":false,"pushed_at":"2021-07-07T08:34:52.000Z","size":5,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-27T21:09:46.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/koolreport.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-08T08:09:54.000Z","updated_at":"2020-12-04T18:06:55.000Z","dependencies_parsed_at":"2022-08-21T12:40:42.577Z","dependency_job_id":null,"html_url":"https://github.com/koolreport/statistics","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/koolreport/statistics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fstatistics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fstatistics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fstatistics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fstatistics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koolreport","download_url":"https://codeload.github.com/koolreport/statistics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koolreport%2Fstatistics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30091779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T19:41:02.502Z","status":"ssl_error","status_checked_at":"2026-03-04T19:40:05.550Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T05:27:12.017Z","updated_at":"2026-03-04T20:32:31.547Z","avatar_url":"https://github.com/koolreport.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nTalking about data, we also talk about statistics because we learn about data through statistics. The `Statistics` package allows you to compute basic and advanced statistical measures for columns of your data. The basic measures could be `min`, `max`, `mean`, `median`, etc. The advanced measures are, for example, `lowerQuartile`, `popStdDeviation` and others.\n\n# Installation\n\n### By downloading .zip file\n\n1. [Download](https://www.koolreport.com/packages/statistics)\n2. Unzip the zip file\n3. Copy the folder `statistics` into `koolreport` folder so that look like below\n\n```bash\nkoolreport\n├── core\n├── statistics\n```\n\n### By composer\n\n```\ncomposer require koolreport/statistics\n```\n\n# Documentation\n\n## Quick start\n\nIn your report's setup page, use the process `\\koolreport\\statistics\\Statistics` with an array parameter in the type of '{{statistical measure}}' =\u003e '{{array of column names}}'\n\n```\n\u003c?php\n//MyReport.php\nuse \\koolreport\\statistics\\Statistics;\n\nclass MyReport extends \\koolreport\\KoolReport\n{\n    ...\n    function setup()\n    {\n        $this-\u003esrc('sales')\n        -\u003epipe(new Statistics(array(\n            'min' =\u003e array('2003'),\n            'max' =\u003e array('2003'),\n            'mean' =\u003e array('2003', '2004'),\n            'median' =\u003e array('2003', '2004', '{{all}}'),\n            'lowerQuartile' =\u003e array('2005'),\n            'upperQuartile' =\u003e array('2005'),\n            'meanDeviation' =\u003e array('{{all}}'),\n            'stdDeviation' =\u003e array('{{all}}'),\n            'percentile_10' =\u003e array('{{all}}'),\n            'percentile_90' =\u003e array('{{all}}'),\n        )))\n        -\u003epipe($this-\u003edataStore('salesYearMonthStatistics'));\n    }\n}\n```\n\nThen in your view, you could use the utility StatisticsReader to extract the measures:\n\n\n```\n\u003c?php\n    //MyReport.view.php:\n    use \\koolreport\\statistics\\StatisticsReader;\n    \n    $stats = StatisticsReader::read($this-\u003edataStore('salesYearMonthStatistics'));\n\n    echo $stats['min']['2003'];\n    echo $stats['median']['2004'];\n    echo $stats['percentile_90']['{{all}}'];\n?\u003e\n```\n\n## Properties\n\nThe package supports the following statistical measures:\n\n|name|description|\n|---|---|\n|`min`|Returns the first minimum value of a data series.|\n|`max`|Returns the first maximum value of a data series.|\n|`mode`|Returns the first most common value of a data series.|\n|`mean`|Returns the average value of a data series.|\n|`median`|Returns the middle value that divides a data series into 2 equal halves when ordering.|\n|`lowerQuartile`|Returns the first quartile of the quartiles that divides a data series into 4 equal group when ordering. The second quartile is the median.|\n|`upperQuartile`|Returns the third quartile.|\n|`percentile_X`|Returns the value that X percentage of a data series fall below when ordering. X is an integer from 0 to 100.|\n|`meanDeviation`|Returns the mean absolute deviation value of a data series in the formula of Sum of absolute(elementValue - mean) / length of data series.|\n|`popStdDeviation`|Returns the population standard deviation value of a data series in the formula of Square root of (sum of square(elementValue - mean) / length of data series).|\n|`samStdDeviation`|Returns the sample standard deviation value of a data series in the formula of Square root of (sum of square(elementValue - mean) / (length of data series - 1)).|\n\n\n# Support\n\nPlease use our forum if you need support, by this way other people can benefit as well. If the support request need privacy, you may send email to us at __support@koolreport.com__.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fstatistics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoolreport%2Fstatistics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoolreport%2Fstatistics/lists"}