https://github.com/michaeltintiuc/percentilerank-example
:100: An example application for calculating percentile ranks
https://github.com/michaeltintiuc/percentilerank-example
calculating-percentile-ranks calculation parse percentile php rank statistics
Last synced: 10 months ago
JSON representation
:100: An example application for calculating percentile ranks
- Host: GitHub
- URL: https://github.com/michaeltintiuc/percentilerank-example
- Owner: michaeltintiuc
- License: mit
- Created: 2017-01-22T18:16:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-18T23:29:21.000Z (over 8 years ago)
- Last Synced: 2025-03-31T05:14:05.453Z (about 1 year ago)
- Topics: calculating-percentile-ranks, calculation, parse, percentile, php, rank, statistics
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.md
Awesome Lists containing this project
README
# Percentile Rank
An example application for calculating percentile ranks
## Installation
Create a folder for your project and enter it
```bash
mkdir percentilerank-example && cd "$_"
```
Pull the project files
```bash
composer create-project michaeltintiuc/percentilerank-example .
```
## Usage
When running application via Web Server set the Document Root to `public/`
Run application via `CLI`
```bash
php public/index.php
```
Create the application with a parser (csv or json)
```php
/**
* @param string type of parser
*/
$app = new MichaelT\App('csv');
```
Load file to be read by the parser
```php
/**
* @param string path to file
*/
$app->parser()->loadFile(__DIR__.'/../input.csv');
```
Calculate percentile rank from file data
```php
/**
* @param string|int index/key of score of interest
* @param string|int index/key to hold percentile rank
*/
$data = $app->calculateRank(2, 'rank');
```
Save result to file via created parser
```php
/**
* @param string path to file
* @param array data to save
* @param string|int|array key/index of array to skip
*/
$app->parser()->exportFile(__DIR__.'/../output.csv', $data, 0);
```