Sha256: c9c53897d9b23f989c6a1a49ad64df32bd034947355e8a0ef099ef3357bebfa0

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

Gem Name: Easystats
Gem Author: Matthew Grigajtis (http://www.matthewgrigajtis.com)
Description: Provides easy to use statistical functions to use on an array 

Functions Provided:
sum
Returns: The sum of the numbers in the array

mean
Returns: The mean (average) of the numbers in the array

standard_deviation
Returns: The standard deviation of the numbers in the array

median
Returns: The median of the numbers in the array

range
Returns: The range of the numbers

mode
Returns: The mode, if any.  Otherwise a string that says "There is no mode"

variance
Returns: The variance

Example usage:

require "rubygems"
require "easystats"

# Create a test array of numbers
myNumbers = Array.new
myNumbers = [4, 8, 15, 16, 23, 42]

puts "Range: " + myNumbers.range.to_s
puts "Sum: " + myNumbers.sum.to_s
puts "Average: " + myNumbers.mean.to_s
puts "Median: " + myNumbers.median.to_s
puts "Variance: " + myNumbers.variance.to_s
puts "Standard Deviation: " + myNumbers.standard_deviation.to_s
puts "Mode: " + myNumbers.mode.to_s

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
easystats-0.0.6 README
easystats-0.0.5 README
easystats-0.0.4 README