RubyFlow The Ruby and Rails community linklog

DescriptiveStatistics is a gem that adds...

DescriptiveStatistics is a gem that adds methods to the Enumerable module to allow easy calculation of basic descriptive statistics of Numeric sample data in collections that have included Enumerable such as Array, Hash, Set, and Range. The statistics that can be calculated include Number, Sum, Mean, Median, Mode, Variance, Standard Deviation, Percentile, Percentile Rank, Descriptive Statistics, and Quartiles.

When requiring DescriptiveStatistics, the Enumerable module is monkey patched so that the statistical methods are available on any instance of a class that has included Enumerable. For example with an Array:

require ‘descriptive_statistics’ => true data = [2,6,9,3,5,1,8,3,6,9,2] => [2, 6, 9, 3, 5, 1, 8, 3, 6, 9, 2] data.number => 11.0 data.sum => 54.0 data.mean => 4.909090909090909 data.median => 5.0 data.variance => 7.7190082644628095 data.standard_deviation => 2.778310325442932 data.percentile(30) => 3.0 data.percentile(70) => 6.0 data.percentile_rank(8) => 81.81818181818183 data.mode => 2 data.range => 8

Comments

I believe this really is excellent information. Most of men and women will concur with you and I ought to thank you about it !Share more: Rolex Replica Watches

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in