Class: Num4AnovaLib::Num4AncovaLib

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

Overview

共分散分析

Instance Method Summary collapse

Constructor Details

#initializeNum4AncovaLib

Returns a new instance of Num4AncovaLib.



304
305
306
# File 'lib/num4anova.rb', line 304

def initialize
    @ancova = Ancova.getInstance()
end

Instance Method Details

#difference_test(xi, a) ⇒ boolean

水準間の差の検定

Examples:

xi = [
   [
       [3,35], [5,38], [3,39],
   ],
   [
       [3,36], [3,39], [8,54],
   ],
   [
       [2,40], [2,45], [2,39],
   ],
   [
       [3,47], [4,52], [2,48],
   ],
   [
       [1,64], [2,80], [0,70],
   ],
 ]
 ancova = Num4AnovaLib::Num4AncovaLib.new
 ancova.difference_test(xi, 0.05)
 => true

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

Parameters:

Returns:

  • (boolean)

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



394
395
396
# File 'lib/num4anova.rb', line 394

def difference_test(xi, a)
    @ancova.differenceTest(xi.to_java(Java::double[][]), a)
end

#interval_estim(xi, a) ⇒ Hash

区間推定

Examples:

xi = [
   [
       [3,35], [5,38], [3,39],
   ],
   [
       [3,36], [3,39], [8,54],
   ],
   [
       [2,40], [2,45], [2,39],
   ],
   [
       [3,47], [4,52], [2,48],
   ],
   [
       [1,64], [2,80], [0,70],
   ],
 ]
 ancova = Num4AnovaLib::Num4AncovaLib.new
 ancova.interval_estim(xi, 0.05)
 =>
    {:min=>4.466605469341916,  :max=>7.1909253948556096}
    {:min=>5.05699825110459,   :max=>6.386335082228742}
    {:min=>2.510804295684195,  :max=>4.250430272217034}
    {:min=>2.8089257316042135, :max=>2.9566298239513418}
    {:min=>-6.303283147572267, :max=>-0.6577045067487104}

Returns (min:下限信頼区間 max:上限信頼区間).

Parameters:

Returns:

  • (Hash)

    (min:下限信頼区間 max:上限信頼区間)



429
430
431
432
433
434
435
436
437
438
439
440
441
442
# File 'lib/num4anova.rb', line 429

def interval_estim(xi, a)
    retRb = []
    retJava = @ancova.intervalEstim(xi.to_java(Java::double[][]), a)
    sz = retJava.size
    sz.times do |i|
        retRb.push(
          {
            "min": retJava[i].getMin(),
            "max": retJava[i].getMax()
          }
        )
    end
    return retRb
end

#parallel_test(xi, a) ⇒ boolean

回帰直線の平行性検定

Examples:

xi = [
   [
       [3,35], [5,38], [3,39],
   ],
   [
       [3,36], [3,39], [8,54],
   ],
   [
       [2,40], [2,45], [2,39],
   ],
   [
       [3,47], [4,52], [2,48],
   ],
   [
       [1,64], [2,80], [0,70],
   ],
 ]
 ancova = Num4AnovaLib::Num4AncovaLib.new
 ancova.parallel_test(xi, 0.05)
 => false

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

Parameters:

Returns:

  • (boolean)

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



334
335
336
# File 'lib/num4anova.rb', line 334

def parallel_test(xi, a)
    @ancova.parallelTest(xi.to_java(Java::double[][]), a)
end

#significance_test(xi, a) ⇒ boolean

回帰直線の有意性検定

Examples:

xi = [
   [
       [3,35], [5,38], [3,39],
   ],
   [
       [3,36], [3,39], [8,54],
   ],
   [
       [2,40], [2,45], [2,39],
   ],
   [
       [3,47], [4,52], [2,48],
   ],
   [
       [1,64], [2,80], [0,70],
   ],
 ]
 ancova = Num4AnovaLib::Num4AncovaLib.new
 ancova.significance_test(xi, 0.05)
 => true

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

Parameters:

Returns:

  • (boolean)

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



364
365
366
# File 'lib/num4anova.rb', line 364

def significance_test(xi, a)
    @ancova.significanceTest(xi.to_java(Java::double[][]), a)
end