Class: Num4TstStatistic2Lib::NonParametrixTestLib

Inherits:
Object
  • Object
show all
Defined in:
lib/num4tststatistic2.rb

Instance Method Summary collapse

Constructor Details

#initialize(hypothTest3) ⇒ NonParametrixTestLib

Returns a new instance of NonParametrixTestLib.



208
209
210
211
# File 'lib/num4tststatistic2.rb', line 208

def initialize(hypothTest3)
    @hypothTest3 = hypothTest3
    @nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new
end

Instance Method Details

#ks2test(xi1, xi2, a) ⇒ boolean

コルモゴルフ・スミルノフ検定(2標本)

Examples:

hypothTest = Num4HypothTestLib::TwoSideTestLib.new
xi1 = [165, 130, 182, 178, 194, 206, 160, 122, 212, 165, 247, 195]
xi2 = [180, 180, 235, 270, 240, 285, 164, 152]
nonParaTest = Num4TstStatisticLib::NonParametrixTestLib.new(hypothTest)
nonParaTest.ks2test(xi1, xi2, 0.05)
=> false

Returns 検定結果(true:棄却域内 false:棄却域外).

Parameters:

  • xi1 (Array)

    x1のデータ(double[])

  • xi2 (Array)

    x2のデータ(double[])

  • a (double)

    有意水準

Returns:

  • (boolean)

    検定結果(true:棄却域内 false:棄却域外)



262
263
264
# File 'lib/num4tststatistic2.rb', line 262

def ks2test(xi1, xi2, a)
    return @nonParaTest.ks2test(xi1, xi2, a)
end

#utest(x, y, a) ⇒ boolean

マン・ホイットニーのU検定

Examples:

hypothTest = Num4HypothTestLib::TwoSideTestLib.new
x = [165, 130, 182, 178, 194, 206, 160, 122, 212, 165, 247, 195]
y = [180, 180, 235, 270, 240, 285, 164, 152]
nonParaTest = Num4TstStatistic2Lib::NonParametrixTestLib.new(hypothTest)
nonParaTest.utest(x, y, 0.05)
=> true

Returns 検定結果(true:棄却域内 false:棄却域外).

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

  • a (double)

    有意水準

Returns:

  • (boolean)

    検定結果(true:棄却域内 false:棄却域外)



226
227
228
229
# File 'lib/num4tststatistic2.rb', line 226

def utest(x, y, a)
    statistic = @nonParaTest.utest(x, y)
    return @hypothTest3.normDistTest(statistic, a)
end

#wilcoxontest(x, y, a) ⇒ boolean

ウィルコクス符号付き順位検定

Examples:

hypothTest = Num4HypothTestLib::TwoSideTestLib.new
x = [37.1, 36.2, 36.6, 37.4, 36.8, 36.7, 36.9, 37.4, 36.6, 36.7]
y = [36.8, 36.6, 36.5, 37.0, 36.0, 36.5, 36.6, 37.1, 36.4, 36.7]
nonParaTest = Num4TstStatistic2Lib::NonParametrixTestLib.new(hypothTest)
nonParaTest.wilcoxon(x, y, 0.05)
=> true

Returns 検定結果(true:棄却域内 false:棄却域外).

Parameters:

  • x (Array)

    xのデータ(double[])

  • y (Array)

    yのデータ(double[])

  • a (double)

    有意水準

Returns:

  • (boolean)

    検定結果(true:棄却域内 false:棄却域外)



244
245
246
247
# File 'lib/num4tststatistic2.rb', line 244

def wilcoxon(x, y, a)
    statistic = @nonParaTest.wilcoxon(x, y)
    return @hypothTest3.normDistTest(statistic, a)
end