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
Name of F analysis
Tails for probability (:both, :left or :right)
Public Class Methods
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
# File lib/statsample/test/f.rb, line 33 def f @var_num.quo(@var_den) end
probability
# File lib/statsample/test/f.rb, line 40 def probability p_using_cdf(Distribution::F.cdf(f, @df_num, @df_den), tails) end
# File lib/statsample/test/f.rb, line 36 def to_f f end