Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A Ruby Gem that contains easy to use statistical functions

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 easystats.gemspec
README.md

Easystats Build Status Code Climate

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
Something went wrong with that request. Please try again.