Class: Rust::Correlation::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/rust/stats/correlation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResult

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

#correlationObject 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

#exactObject

Returns the value of attribute exact.



90
91
92
# File 'lib/rust/stats/correlation.rb', line 90

def exact
  @exact
end

#nameObject

Returns the value of attribute name.



86
87
88
# File 'lib/rust/stats/correlation.rb', line 86

def name
  @name
end

#pvalueObject

Returns the value of attribute pvalue.



88
89
90
# File 'lib/rust/stats/correlation.rb', line 88

def pvalue
  @pvalue
end

#statisticsObject

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_sObject



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