Class: CorrTestLib::CorreFactLib
- Inherits:
-
Object
- Object
- CorrTestLib::CorreFactLib
- Defined in:
- lib/corrtest.rb
Overview
母相関係数の検定
Instance Method Summary collapse
-
#initialize(hypothTest3) ⇒ CorreFactLib
constructor
A new instance of CorreFactLib.
-
#kendallscorr(x, y, rth0, a) ⇒ boolean
ケンドールの順位相関係数.
-
#pearsoCorrelation(x, y, rth0, a) ⇒ boolean
ピアソン相関係数.
-
#spearmanscorr(x, y, rth0, a) ⇒ boolean
スピアマンの順位相関係数.
Constructor Details
#initialize(hypothTest3) ⇒ CorreFactLib
Returns a new instance of CorreFactLib.
69 70 71 72 |
# File 'lib/corrtest.rb', line 69 def initialize(hypothTest3) @hypothTest3 = hypothTest3 @corr = CorrStatisticLib.new end |
Instance Method Details
#kendallscorr(x, y, rth0, a) ⇒ boolean
ケンドールの順位相関係数
128 129 130 131 132 |
# File 'lib/corrtest.rb', line 128 def kendallscorr(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @corr.kendallscorr(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |
#pearsoCorrelation(x, y, rth0, a) ⇒ boolean
ピアソン相関係数
88 89 90 91 92 |
# File 'lib/corrtest.rb', line 88 def pearsoCorrelation(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @corr.pearsoCorrelation(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |
#spearmanscorr(x, y, rth0, a) ⇒ boolean
スピアマンの順位相関係数
108 109 110 111 112 |
# File 'lib/corrtest.rb', line 108 def spearmanscorr(x, y, rth0, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) statistic = @corr.spearmanscorr(x, y) return @hypothTest3.populationCorre(statistic, x.size, rth0, a) end |