Class: Rust::Correlation::Result
- Defined in:
- lib/rust/stats/correlation.rb
Instance Attribute Summary collapse
-
#correlation ⇒ Object
(also: #estimate)
Returns the value of attribute correlation.
-
#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.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
94 95 96 97 |
# File 'lib/rust/stats/correlation.rb', line 94 def initialize @statistics = {} @exact = true end |
Instance Attribute Details
#correlation ⇒ Object Also known as: estimate
Returns the value of attribute correlation.
89 90 91 |
# File 'lib/rust/stats/correlation.rb', line 89 def correlation @correlation end |
#exact ⇒ Object
Returns the value of attribute exact.
90 91 92 |
# File 'lib/rust/stats/correlation.rb', line 90 def exact @exact end |
#name ⇒ Object
Returns the value of attribute name.
86 87 88 |
# File 'lib/rust/stats/correlation.rb', line 86 def name @name end |
#pvalue ⇒ Object
Returns the value of attribute pvalue.
88 89 90 |
# File 'lib/rust/stats/correlation.rb', line 88 def pvalue @pvalue end |
#statistics ⇒ Object
Returns the value of attribute statistics.
87 88 89 |
# File 'lib/rust/stats/correlation.rb', line 87 def statistics @statistics end |
Instance Method Details
#[](name) ⇒ Object
99 100 101 |
# File 'lib/rust/stats/correlation.rb', line 99 def [](name) return @statistics[name.to_sym] end |
#[]=(name, value) ⇒ Object
103 104 105 |
# File 'lib/rust/stats/correlation.rb', line 103 def []=(name, value) @statistics[name.to_sym] = value end |
#to_s ⇒ Object
107 108 109 110 111 |
# File 'lib/rust/stats/correlation.rb', line 107 def to_s return "#{name}. Correlation = #{correlation}, P-value = #{pvalue} " + (!@exact ? "P-value is not exact. " : "") + "#{ statistics.map { |k, v| k.to_s + " -> " + v.to_s }.join(", ") }." end |