Class: Num4DiffTestLib::NonParametrixTestLib

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

Overview

ノンパラメトリック検定

Instance Method Summary collapse

Constructor Details

#initialize(hypothTest3) ⇒ NonParametrixTestLib

Returns a new instance of NonParametrixTestLib.



31
32
33
34
35
36
# File 'lib/num4difftest.rb', line 31

def initialize(hypothTest3)
    @hypothTest3 = hypothTest3
    @nonParaTest = Num4TstStatistic2Lib::NonParametrixTestLib.new(@hypothTest3)
    @oneWay      = Num4AnovaLib::OneWayLayoutLib.new
    @twoWay      = Num4AnovaLib::TwoWayLayoutLib.new
end

Instance Method Details

#mult_diff_test(xi1, a) ⇒ Object

Raises:

  • (TypeError)


46
47
48
49
50
# File 'lib/num4difftest.rb', line 46

def mult_diff_test(xi1, a)
    raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF)

    return @oneWay.kruskalwallis_test(xi1, a)
end

#smple_diff_test(xi1, xi2, a) ⇒ Object

Raises:

  • (TypeError)


37
38
39
40
41
42
43
44
45
# File 'lib/num4difftest.rb', line 37

def smple_diff_test(xi1, xi2, a)
    raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF)

    if xi1.size == xi2.size then
        return @nonParaTest.wilcoxon(xi1, xi2, a)
    else
        return @nonParaTest.utest(xi1, xi2, a)
    end
end