Parent

Included Modules

Class/Module Index [+]

Quicksearch

Statsample::Anova::OneWay

Generic Anova one-way.

You could enter the sum of squares or the mean squares. You should enter the degrees of freedom for numerator and denominator.

Usage

anova=Statsample::Anova::OneWay(:ss_num=>10,:ss_den=>20, :df_num=>2, :df_den=>10, @name=>"ANOVA for....")

Attributes

df_num[R]
df_den[R]
ss_num[R]
ss_den[R]
ms_num[R]
ms_den[R]
ms_total[R]
df_total[R]
ss_total[R]
name[RW]

Name of ANOVA Analisys

name_denominator[RW]
name_numerator[RW]

Public Class Methods

new(opts=Hash.new) click to toggle source
# File lib/statsample/anova/oneway.rb, line 15
def initialize(opts=Hash.new)
  # First see if sum of squares or mean squares are entered
  raise ArgumentError, "You should set d.f." unless (opts.has_key? :df_num and opts.has_key? :df_den)
  @df_num=opts.delete :df_num
  @df_den=opts.delete :df_den
  @df_total=@df_num+@df_den
  if(opts.has_key? :ss_num and opts.has_key? :ss_den)
    @ss_num = opts.delete :ss_num
    @ss_den =opts.delete :ss_den
    @ms_num =@ss_num.quo(@df_num)
    @ms_den =@ss_den.quo(@df_den) 
  elsif (opts.has_key? :ms_num and opts.has_key? :ms_den)
    @ms_num =opts.delete :ms_num
    @ms_den =opts.delete :ms_den
    @ss_num =@ms_num * @df_num
    @ss_den =@ss_den * @df_den
  end
  @ss_total=@ss_num+@ss_den
  @ms_total=@ms_num+@ms_den
  opts_default={:name=>"ANOVA",
                :name_denominator=>_("Explained variance"),
                :name_numerator=>_("Unexplained variance")}
  @opts=opts_default.merge(opts)
  opts_default.keys.each {|k|
    send("#{k}=", @opts[k])
  }
  @f_object=Statsample::Test::F.new(@ms_num,@ms_den,@df_num,@df_den)
end

Public Instance Methods

f() click to toggle source

F value

# File lib/statsample/anova/oneway.rb, line 44
def f
  @f_object.f
end
probability() click to toggle source

P-value of F test

# File lib/statsample/anova/oneway.rb, line 48
def probability
  @f_object.probability
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.