Class: Num4DiffTestLib::ParametrixTestLib
- Inherits:
-
Object
- Object
- Num4DiffTestLib::ParametrixTestLib
- Defined in:
- lib/num4difftest.rb
Overview
パラメトリック検定
Instance Method Summary collapse
-
#ancova_test(yi, xi, a) ⇒ boolean
共分散分析.
-
#initialize(hypothTest3) ⇒ ParametrixTestLib
constructor
A new instance of ParametrixTestLib.
-
#mult2_diff_test(xij, a) ⇒ Array
3群以上の母平均の差の検定(2元配置).
-
#mult_diff_test(xi1, a) ⇒ boolean
3群以上の母平均の差の検定(1元配置).
-
#smple_diff_test(xi1, xi2, a) ⇒ boolean
2群の母平均の差の検定.
Constructor Details
#initialize(hypothTest3) ⇒ ParametrixTestLib
Returns a new instance of ParametrixTestLib.
9 10 11 12 13 14 15 |
# File 'lib/num4difftest.rb', line 9 def initialize(hypothTest3) @hypothTest3 = hypothTest3 @paraTest = Num4TstStatistic2Lib::ParametrixTestLib.new(@hypothTest3) @oneWay = Num4AnovaLib::OneWayLayoutLib.new @twoWay = Num4AnovaLib::TwoWayLayoutLib.new @ancova = Num4AnovaLib::Num4AncovaLib.new end |
Instance Method Details
#ancova_test(yi, xi, a) ⇒ boolean
共分散分析
140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/num4difftest.rb', line 140 def ancova_test(yi, xi, a) # 回帰直線の平行性検定 # (false: 平行) if false != @ancova.parallel_test(yi, xi, a) then return mult_diff_test(xi, a) end # 回帰直線の有意性検定 # (false: β=0) if true != @ancova.significance_test(yi, xi, a) then return mult_diff_test(xi, a) end # 水準間の差の検定 return @ancova.difference_test(yi, xi, a) end |
#mult2_diff_test(xij, a) ⇒ Array
3群以上の母平均の差の検定(2元配置)
100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/num4difftest.rb', line 100 def mult2_diff_test(xi1, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) xij = xi1 n = getDimNum(xi1, 0) if n == 3 then # 繰り返しのあるデータ res = @twoWay.twoway_anova(xi1, a) if res[2] == true then xij = @twoWay.create_oneway(xi1).to_a end end res2 = @twoWay.twoway2_anova(xij, a) return res2 end |
#mult_diff_test(xi1, a) ⇒ boolean
3群以上の母平均の差の検定(1元配置)
57 58 59 60 61 62 63 64 65 |
# File 'lib/num4difftest.rb', line 57 def mult_diff_test(xi, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) if true == isReplicate(xi) then return @oneWay.replicate_test(xi, a) else return @oneWay.oneway_anova(xi, a) end end |
#smple_diff_test(xi1, xi2, a) ⇒ boolean
2群の母平均の差の検定
30 31 32 33 34 35 36 37 38 |
# File 'lib/num4difftest.rb', line 30 def smple_diff_test(xi1, xi2, a) raise TypeError unless @hypothTest3.kind_of?(HypothTest3IF) if xi1.size == xi2.size then return @paraTest.diffPopulationMean(xi1, xi2, a) else return @paraTest.diffPopulationVarMean(xi1, xi2, a) end end |