Parent

Class/Module Index [+]

Quicksearch

Statsample::Test::F

From Wikipedia: An F-test is any statistical test in which the test statistic has an F-distribution under the null hypothesis. It is most often used when comparing statistical models that have been fit to a data set, in order to identify the model that best fits the population from which the data were sampled.

Attributes

var_num[R]
var_den[R]
df_num[R]
df_den[R]
var_total[R]
df_total[R]
tails[RW]

Tails for probability (:both, :left or :right)

name[RW]

Name of F analysis

Public Class Methods

new(var_num, var_den, df_num, df_den, opts=Hash.new) click to toggle source

Parameters:

  • var_num: variance numerator

  • var_den: variance denominator

  • df_num: degrees of freedom numerator

  • df_den: degrees of freedom denominator

# File lib/statsample/test/f.rb, line 19
def initialize(var_num, var_den, df_num, df_den, opts=Hash.new)
  @var_num=var_num
  @var_den=var_den
  @df_num=df_num
  @df_den=df_den
  @var_total=var_num+var_den
  @df_total=df_num+df_den
  opts_default={:tails=>:right, :name=>_("F Test")}
  @opts=opts_default.merge(opts)
  raise "Tails should be right or left, not both" if @opts[:tails]==:both
  opts_default.keys.each {|k|
    send("#{k}=", @opts[k])
  }
end

Public Instance Methods

f() click to toggle source
# File lib/statsample/test/f.rb, line 33
def f
  @var_num.quo(@var_den)
end
probability() click to toggle source

probability

# File lib/statsample/test/f.rb, line 40
def probability
  p_using_cdf(Distribution::F.cdf(f, @df_num, @df_den), tails)
end
to_f() click to toggle source
# File lib/statsample/test/f.rb, line 36
def to_f
  f
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.