class 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.

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

df_den[R]
df_num[R]
df_total[R]
name[RW]

Name of F analysis

tails[RW]

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

var_den[R]
var_num[R]
var_total[R]

Public Class Methods

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

Parameters:

# 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