lib/more_math/sequence.rb
# Compute a sample size, that will more likely yield a mean difference
# between this instance's elements and those of +other+. Use +alpha+
# and +beta+ as levels for the first- and second-order errors.
Compute a sample size, that will more likely yield a mean difference
between this instance's elements and those of +other+. Use +alpha+
and +beta+ as levels for the first- and second-order errors.
Compute a sample size that will more likely yield a mean difference between this instance ' s elements and those of + other + . Use + alpha + and + beta + as levels for the first - and second - order errors .
def suggested_sample_size(other, alpha = 0.05, beta = 0.05)
      alpha, beta = alpha.abs, beta.abs
      signal = arithmetic_mean - other.arithmetic_mean
      df = size + other.size - 2
      pooled_variance_estimate = (sum_of_squares + other.sum_of_squares) / df
      td = TDistribution.new df
      (((td.inverse_probability(alpha) + td.inverse_probability(beta)) *
        Math.sqrt(pooled_variance_estimate)) / signal) ** 2
    end
def suggested_sample_size ( other , alpha = 0.05 , beta = 0.05 ) alpha , beta = alpha . abs , beta . abs signal = arithmetic_mean - other . arithmetic_mean df = size + other . size - 2 pooled_variance_estimate = ( sum_of_squares + other . sum_of_squares ) / df td = TDistribution . new df ( ( ( td . inverse_probability ( alpha ) + td . inverse_probability ( beta ) ) * Math . sqrt ( pooled_variance_estimate ) ) / signal ) ** 2 end
Compute a sample size, that will more likely yield a mean difference
between this instance's elements and those of +other+.
Compute a sample size that will more likely yield a mean difference between this instance ' s elements and those of + other + .
other
<not_specific>
alpha
<not_specific>
beta
<not_specific>