Class: Num4CorrTestLib::DecorrTestLib
- Inherits:
-
Object
- Object
- Num4CorrTestLib::DecorrTestLib
- Defined in:
- lib/num4corrtest.rb
Overview
無相関の検定
Instance Method Summary collapse
-
#initialize ⇒ DecorrTestLib
constructor
A new instance of DecorrTestLib.
-
#kendallscorr(x, y, a) ⇒ boolean
ケンドールの順位相関係数.
-
#pearsoCorrelation(x, y, a) ⇒ boolean
ピアソン相関係数.
-
#spearmanscorr(x, y, a) ⇒ boolean
スピアマンの順位相関係数.
Constructor Details
#initialize ⇒ DecorrTestLib
Returns a new instance of DecorrTestLib.
8 9 10 11 |
# File 'lib/num4corrtest.rb', line 8 def initialize @corr = CorrStatisticLib.new @hypothTest = Num4HypothTestLib::DecorrTestLib.new end |
Instance Method Details
#kendallscorr(x, y, a) ⇒ boolean
ケンドールの順位相関係数
61 62 63 64 65 |
# File 'lib/num4corrtest.rb', line 61 def kendallscorr(x, y, a) df = x.size - 2 statistic = @corr.kendallscorr(x, y) return @hypothTest.twoSideTest(statistic, df, a) end |
#pearsoCorrelation(x, y, a) ⇒ boolean
ピアソン相関係数
25 26 27 28 29 |
# File 'lib/num4corrtest.rb', line 25 def pearsoCorrelation(x, y, a) df = x.size - 2 statistic = @corr.pearsoCorrelation(x, y) return @hypothTest.twoSideTest(statistic, df, a) end |
#spearmanscorr(x, y, a) ⇒ boolean
スピアマンの順位相関係数
43 44 45 46 47 |
# File 'lib/num4corrtest.rb', line 43 def spearmanscorr(x, y, a) df = x.size - 2 statistic = @corr.spearmanscorr(x, y) return @hypothTest.twoSideTest(statistic, df, a) end |