Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mgrigajtis/easystats
A Ruby Gem that contains easy to use statistical functions
https://github.com/mgrigajtis/easystats
Last synced: 3 months ago
JSON representation
A Ruby Gem that contains easy to use statistical functions
- Host: GitHub
- URL: https://github.com/mgrigajtis/easystats
- Owner: mgrigajtis
- Created: 2011-01-13T01:52:37.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T04:39:08.000Z (about 1 year ago)
- Last Synced: 2024-07-19T18:24:04.429Z (4 months ago)
- Language: Ruby
- Homepage:
- Size: 45.9 KB
- Stars: 85
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Easystats [![Build Status](https://secure.travis-ci.org/mgrigajtis/easystats.png)](https://secure.travis-ci.org/mgrigajtis/easystats) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/mgrigajtis/easystats)
[![Join the chat at https://gitter.im/mgrigajtis/easystats](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mgrigajtis/easystats?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
> Created by [Matthew Grigajtis](http://www.matthewgrigajtis.com)
Provides easy to use statistical functions to use on an array
## Install
In your shell:
```sh
gem install easystats
```or in your Gemfile:
```rb
gem 'easystats'
```## Example
```rb
require 'easystats'array = [4, 8, 15, 16, 23, 42, 42]
%w[
average
median
mode
range
standard_deviation
sum
variance
weighted_moving_average
].each do |method|
puts "#{method}: #{array.send(method.to_sym)}"
end
```This will result in:
```sh
average: 21.428571428571427
median: 16
mode: 42
range: 38
standard_deviation: 15.295501984321435
sum: 150
variance: 200.53061224489798
weighted_moving_average: 30.476190476190474
```