Class: Num4AnovaLib::TwoWayLayoutLib

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

Overview

二元配置の分散分析

Instance Method Summary collapse

Constructor Details

#initializeTwoWayLayoutLib



176
177
178
# File 'lib/num4anova.rb', line 176

def initialize
    @twoWay = TwoWayLayout.getInstance()
end

Instance Method Details

#create_oneway(xij) ⇒ array

1元配置用データ作成

Examples:

xij = [
        [
          [13.2, 15.7, 11.9],
          [16.1, 15.7, 15.1],
          [9.1,  10.3,  8.2],
        ],
        [
          [22.8, 25.7, 18.5],
          [24.5, 21.2, 24.2],
          [11.9, 14.3, 13.7],
        ],
        [
          [21.8, 26.3, 32.1],
          [26.9, 31.3, 28.3],
          [15.1, 13.6, 16.2],
        ],
        [
          [25.7, 28.8, 29.5],
          [30.1, 33.8, 29.6],
          [15.2, 17.3, 14.8],
        ],
]
twoWay = Num4AnovaLib::TwoWayLayoutLib.new 
twoWay.create_oneway(xij)
=>
  xij = [
    [13.6, 15.6, 9.2],
    [22.3, 23.3, 13.3],
    [26.7, 28.8, 15.0],
    [28.0, 31.2, 15.8],
  ]


297
298
299
# File 'lib/num4anova.rb', line 297

def create_oneway(xij)
    return @twoWay.createOneWay(xij.to_java(Java::double[][]))
end

#friedman_test(xij, a) ⇒ boolean

フリードマン検定

Examples:

xij = [
    [13.6, 15.6, 9.2],
    [22.3, 23.3, 13.3],
    [26.7, 28.8, 15.0],
    [28.0, 31.2, 15.8],
]
twoWay = Num4AnovaLib::TwoWayLayoutLib.new 
twoWay.friedman_test(xij, 0.05)
=>
  true


256
257
258
259
# File 'lib/num4anova.rb', line 256

def friedman_test(xij, a)
    ret = @twoWay.friedmanTest(xij.to_java(Java::double[]), a)
    return ret
end

#twoway2_anova(xij, a) ⇒ Array

二元配置の分散分析

(繰り返しのない時)

Examples:

xij = [
    [13.6, 15.6, 9.2],
    [22.3, 23.3, 13.3],
    [26.7, 28.8, 15.0],
    [28.0, 31.2, 15.8],
]
twoWay = Num4AnovaLib::TwoWayLayoutLib.new 
twoWay.twoway2_anova(xij, 0.05)
=>
  [true, true]


235
236
237
238
# File 'lib/num4anova.rb', line 235

def twoway2_anova(xij, a)
    ret = @twoWay.twoway2Anova(xij.to_java(Java::double[]), a)
    return ret.to_a
end

#twoway_anova(xij, a) ⇒ Array

二元配置の分散分析

(繰り返し数が等しい時)

Examples:

xij = [
        [
          [13.2, 15.7, 11.9],
          [16.1, 15.7, 15.1],
          [9.1,  10.3,  8.2],
        ],
        [
          [22.8, 25.7, 18.5],
          [24.5, 21.2, 24.2],
          [11.9, 14.3, 13.7],
        ],
        [
          [21.8, 26.3, 32.1],
          [26.9, 31.3, 28.3],
          [15.1, 13.6, 16.2],
        ],
        [
          [25.7, 28.8, 29.5],
          [30.1, 33.8, 29.6],
          [15.2, 17.3, 14.8],
        ],
]
twoWay = Num4AnovaLib::TwoWayLayoutLib.new 
twoWay.twoway_anova(xij, 0.05)
=>
  [true, true, true]


213
214
215
216
# File 'lib/num4anova.rb', line 213

def twoway_anova(xij, a)
    ret = @twoWay.twowayAnova(xij.to_java(Java::double[][]), a)
    return ret.to_a
end