Skip to content

Commit

Permalink
Merge pull request #48 from Abhishekgupta204/abhi
Browse files Browse the repository at this point in the history
Enhanced the description of statistic functions
  • Loading branch information
roberto-butti authored Oct 28, 2023
2 parents 1d1eafb + 2abe208 commit 8641fc5
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,26 +54,32 @@ composer require hi-folks/statistics
## Usage

### Stat class

Stat class has methods to calculate an average or typical value from a population or sample.
This class provides methods for calculating mathematical statistics of numeric data.
Stat class has methods to calculate an average or typical value from a population or sample like:
- `mean()`: arithmetic mean or "average" of data;
- `median()`: median or "middle value" of data;
- `medianLow()`: low median of data;
- `medianHigh()`: high median of data;
- `mode()`: single mode (most common value) of discrete or nominal data;
- `multimode()`: list of modes (most common values) of discrete or nominal data;
- `quantiles()`: cut points dividing the range of a probability distribution into continuous intervals with equal probabilities;
- `thirdQuartile()`: 3rd quartile, is the value at which 75 percent of the data is below it;
- `firstQuartile()`: first quartile, is the value at which 25 percent of the data is below it;
- `pstdev()`: Population standard deviation;
- `stdev()`: Sample standard deviation;
- `pvariance()`: variance for a population;
- `variance()`: variance for a sample;
- `geometricMean()`: geometric mean;
- `harmonicMean()`: harmonic mean;
- `correlation()`: the Pearson’s correlation coefficient for two inputs;
- `covariance()`: the sample covariance of two inputs;
- `linearRegression()`: return the slope and intercept of simple linear regression parameters estimated using ordinary least squares.
The various mathematical statistics are listed below:


| Mathematical Statistic | Description |
| ---------------------- | ----------- |
| `mean()` | arithmetic mean or "average" of data |
| `median()` | median or "middle value" of data |
| `medianLow()` | low median of data |
| `medianHigh()` | high median of data |
| `mode()` | single mode (most common value) of discrete or nominal data |
| `multimode()` | list of modes (most common values) of discrete or nominal data |
| `quantiles()` | cut points dividing the range of a probability distribution into continuous intervals with equal probabilities |
| `thirdQuartile()` | 3rd quartile, is the value at which 75 percent of the data is below it |
| `firstQuartile()` | first quartile, is the value at which 25 percent of the data is below it |
| `pstdev()` | Population standard deviation |
| `stdev()` | Sample standard deviation |
| `pvariance()` | variance for a population |
| `variance()` | variance for a sample |
| `geometricMean()` | geometric mean |
| `harmonicMean()` | harmonic mean |
| `correlation()` | the Pearson’s correlation coefficient for two inputs |
| `covariance()` | the sample covariance of two inputs |
| `linearRegression()` | return the slope and intercept of simple linear regression parameters estimated using ordinary least squares |

#### Stat::mean( array $data )
Return the sample arithmetic mean of the array _$data_.
Expand Down

0 comments on commit 8641fc5

Please sign in to comment.