Class: Rust::Correlation::Result
- Defined in:
- lib/rust/stats/correlation.rb
Overview
Result of a correlation test.
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
Returns the statistic with the specified
name
. -
#[]=(name, value) ⇒ Object
Sets the
value
for the the statistic with the specifiedname
. -
#initialize ⇒ Result
constructor
A new instance of Result.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Result
Returns a new instance of Result.
131 132 133 134 |
# File 'lib/rust/stats/correlation.rb', line 131 def initialize @statistics = {} @exact = true end |
Instance Attribute Details
#correlation ⇒ Object Also known as: estimate
Returns the value of attribute correlation.
126 127 128 |
# File 'lib/rust/stats/correlation.rb', line 126 def correlation @correlation end |
#exact ⇒ Object
Returns the value of attribute exact.
127 128 129 |
# File 'lib/rust/stats/correlation.rb', line 127 def exact @exact end |
#name ⇒ Object
Returns the value of attribute name.
123 124 125 |
# File 'lib/rust/stats/correlation.rb', line 123 def name @name end |
#pvalue ⇒ Object
Returns the value of attribute pvalue.
125 126 127 |
# File 'lib/rust/stats/correlation.rb', line 125 def pvalue @pvalue end |
#statistics ⇒ Object
Returns the value of attribute statistics.
124 125 126 |
# File 'lib/rust/stats/correlation.rb', line 124 def statistics @statistics end |
Instance Method Details
#[](name) ⇒ Object
Returns the statistic with the specified name
.
139 140 141 |
# File 'lib/rust/stats/correlation.rb', line 139 def [](name) return @statistics[name.to_sym] end |
#[]=(name, value) ⇒ Object
Sets the value
for the the statistic with the specified name
.
146 147 148 |
# File 'lib/rust/stats/correlation.rb', line 146 def []=(name, value) @statistics[name.to_sym] = value end |
#to_s ⇒ Object
150 151 152 153 154 |
# File 'lib/rust/stats/correlation.rb', line 150 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 |