Method: Rust::RBindings#cor_test

Defined in:
lib/rust/stats/correlation.rb

#cor_test(d1, d2, **options) ⇒ Object



163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/rust/stats/correlation.rb', line 163

def cor_test(d1, d2, **options)
    method = options[:method].to_s.downcase
    if "pearson".start_with?(method)
        return Rust::Correlation::Pearson.test(d1, d2)
    elsif "spearman".start_with?(method)
        return Rust::Correlation::Spearman.test(d1, d2)
    elsif "kendall".start_with?(method)
        return Rust::Correlation::Kendall.test(d1, d2)
    else
        raise "Unsupported method #{method}"
    end
end