Class: Rust::StatisticalTests::Result
Instance Attribute Summary collapse
-
#alpha ⇒ Object
Returns the value of attribute alpha.
-
#exact ⇒ Object
Returns the value of attribute exact.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pvalue ⇒ Object
Returns the value of attribute pvalue.
-
#statistics ⇒ Object
Returns the value of attribute statistics.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #[]=(name, value) ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #significant ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
11 12 13 |
# File 'lib/rust-tests.rb', line 11 def initialize @statistics = {} end |
Instance Attribute Details
#alpha ⇒ Object
Returns the value of attribute alpha.
9 10 11 |
# File 'lib/rust-tests.rb', line 9 def alpha @alpha end |
#exact ⇒ Object
Returns the value of attribute exact.
8 9 10 |
# File 'lib/rust-tests.rb', line 8 def exact @exact end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/rust-tests.rb', line 5 def name @name end |
#pvalue ⇒ Object
Returns the value of attribute pvalue.
7 8 9 |
# File 'lib/rust-tests.rb', line 7 def pvalue @pvalue end |
#statistics ⇒ Object
Returns the value of attribute statistics.
6 7 8 |
# File 'lib/rust-tests.rb', line 6 def statistics @statistics end |
Instance Method Details
#[](name) ⇒ Object
15 16 17 |
# File 'lib/rust-tests.rb', line 15 def [](name) return @statistics[name.to_sym] end |
#[]=(name, value) ⇒ Object
19 20 21 |
# File 'lib/rust-tests.rb', line 19 def []=(name, value) @statistics[name.to_sym] = value end |
#significant ⇒ Object
23 24 25 |
# File 'lib/rust-tests.rb', line 23 def significant pvalue < alpha end |
#to_s ⇒ Object
27 28 29 30 31 32 |
# File 'lib/rust-tests.rb', line 27 def to_s return "#{name}. P-value = #{pvalue} " + "(#{significant ? "significant" : "not significant"} w/ alpha = #{alpha}); " + "#{ statistics.map { |k, v| k.to_s + " -> " + v.to_s }.join(", ") }." + (!exact ? " P-value is not exact." : "") end |