Project

easystats

0.03
No release in over 3 years
Low commit activity in last 3 years
This gem contains statistics functions that are very easy to use. Much easier and much more complete than many of the other statistical gems available out there. If you need a feature added, send me a message on Github!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Easystats Build Status Code Climate

Join the chat at https://gitter.im/mgrigajtis/easystats

Created by Matthew Grigajtis

Provides easy to use statistical functions to use on an array

Install

In your shell:

gem install easystats

or in your Gemfile:

gem 'easystats'

Example

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:

average: 21.428571428571427
median: 16
mode: 42
range: 38
standard_deviation: 15.295501984321435
sum: 150
variance: 200.53061224489798
weighted_moving_average: 30.476190476190474