Sha256: 7532f04869bc5b4dfd729f44813d92367b81b09209a33dd8fe30155a3ca6cd75

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

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 there is no mode returns 0.

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

1 entries across 1 versions & 1 rubygems

Version Path
easystats-0.0.7 README