https://github.com/karan/statistics.dart
:racehorse: Functions for calculating mathematical statistics of numeric data.
https://github.com/karan/statistics.dart
Last synced: 4 months ago
JSON representation
:racehorse: Functions for calculating mathematical statistics of numeric data.
- Host: GitHub
- URL: https://github.com/karan/statistics.dart
- Owner: karan
- License: mit
- Created: 2014-11-30T07:16:09.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-01T04:57:13.000Z (about 11 years ago)
- Last Synced: 2025-04-04T23:29:50.788Z (9 months ago)
- Language: Dart
- Homepage: https://pub.dartlang.org/packages/statistics
- Size: 176 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
statistics.dart
===============
[](https://drone.io/github.com/karan/statistics.dart/latest)
Functions for calculating mathematical statistics of numeric data.
**Note**: These functions support `int` and `double` `List`s.
## Usage
### 1. Depend on it
In your `pubspec.yaml`, add:
dependencies:
statistics: ">=0.01"
### 2. Install it
Run from your command line:
$ pub get
Alternatively, your editor might support pub. Check the docs for your editor to learn more.
### 3. Import it
In your Dart code:
import 'package:statistics/statistics.dart';
### 4. Use it
print(mean([1, 2, 3, 4]));
## Supported methods
| Method | Description |
| ------ | ----------- |
| **mean(List data)** | Return the sample arithmetic mean of data |
| **median(List data)** | Return the median (middle value) of numeric data |
| **median_low(List data)** | Return the low median of numeric data |
| **median_high(List data)** | Return the high median of numeric data |
| **median_grouped(List data, [int interval = 1])** | Return the median, or 50th percentile, of grouped data |
| **mode(List data)** | Return the most common data point from discrete or nominal data |
*All methods throw `StatisticsException` if `data` is empty.*