descriptive_statistics 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/descriptive_statistics/class_methods.rb +11 -0
- data/lib/descriptive_statistics/mean.rb +2 -2
- data/lib/descriptive_statistics/median.rb +2 -2
- data/lib/descriptive_statistics/mode.rb +2 -2
- data/lib/descriptive_statistics/number.rb +2 -2
- data/lib/descriptive_statistics/percentile.rb +2 -2
- data/lib/descriptive_statistics/percentile_rank.rb +2 -2
- data/lib/descriptive_statistics/range.rb +2 -2
- data/lib/descriptive_statistics/safe.rb +1 -0
- data/lib/descriptive_statistics/standard_deviation.rb +2 -2
- data/lib/descriptive_statistics/stats.rb +3 -12
- data/lib/descriptive_statistics/sum.rb +2 -2
- data/lib/descriptive_statistics/variance.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e309fdf859185630fa3f8766b51c32411b748190
|
4
|
+
data.tar.gz: 2852dd323dec053aea7afaa813456ee350f13ab1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4d7de2fbb8be9a1b7cfd08e18b643fd7186c1b3914b2b73dd753086e5c22cd47e14e3b03b2933d7aeff9d4a0f6d68034d3402da37f97cfa1892dfef79b39901
|
7
|
+
data.tar.gz: cbd99a2b32aa960ae41643dedee7f51dd3d60a1473ba239742b417ee2f3971df29fe9ec0193091d0b5c7b2ad8f9f7aa834a9eb4a83cb1fa487c05fca1306a775
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module DescriptiveStatistics
|
2
2
|
# percent of cases that are at or below a score
|
3
|
-
def percentile_rank(p)
|
4
|
-
values = Support::convert(
|
3
|
+
def percentile_rank(p, collection = self)
|
4
|
+
values = Support::convert(collection)
|
5
5
|
return unless values.size > 0
|
6
6
|
|
7
7
|
return (((values.sort.rindex{ |x| x <= p } || -1.0) + 1.0)) / values.number * 100.0
|
@@ -1,18 +1,9 @@
|
|
1
|
-
require '
|
1
|
+
require 'delegate'
|
2
2
|
|
3
3
|
module DescriptiveStatistics
|
4
4
|
|
5
|
-
class Stats
|
6
|
-
|
7
|
-
|
8
|
-
DescriptiveStatistics.instance_methods.each do |m|
|
9
|
-
def_delegator :@collection, m
|
10
|
-
end
|
11
|
-
|
12
|
-
def initialize(collection)
|
13
|
-
@collection = collection.clone.extend(DescriptiveStatistics)
|
14
|
-
end
|
15
|
-
|
5
|
+
class Stats < SimpleDelegator
|
6
|
+
include DescriptiveStatistics
|
16
7
|
end
|
17
8
|
|
18
9
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: descriptive_statistics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derrick Parkhurst
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-09-
|
15
|
+
date: 2014-09-03 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: Adds descriptive statistics methods to Enumerable module for use on collections
|
18
18
|
or Numeric data
|
@@ -22,6 +22,7 @@ extensions: []
|
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
24
|
- lib/descriptive_statistics.rb
|
25
|
+
- lib/descriptive_statistics/class_methods.rb
|
25
26
|
- lib/descriptive_statistics/descriptive_statistics.rb
|
26
27
|
- lib/descriptive_statistics/enumerable_extension.rb
|
27
28
|
- lib/descriptive_statistics/mean.rb
|