Class: SkiftetStatistical::Significance::Result

Inherits:
Struct
  • Object
show all
Defined in:
lib/skiftet_statistical/significance.rb

Overview

The outcome of a significance test: the test statistic and its two-tailed p-value, with convenience predicates for the usual confidence levels.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#p_valueObject

Returns the value of attribute p_value

Returns:

  • (Object)

    the current value of p_value



54
55
56
# File 'lib/skiftet_statistical/significance.rb', line 54

def p_value
  @p_value
end

#statisticObject

Returns the value of attribute statistic

Returns:

  • (Object)

    the current value of statistic



54
55
56
# File 'lib/skiftet_statistical/significance.rb', line 54

def statistic
  @statistic
end

Instance Method Details

#confidenceObject

Certainty = 1 - p, the complement of the p-value.



64
65
66
# File 'lib/skiftet_statistical/significance.rb', line 64

def confidence
  1.0 - p_value
end

#significant?(alpha = 0.05) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/skiftet_statistical/significance.rb', line 55

def significant?(alpha = 0.05)
  p_value < alpha
end

#significant_90?Boolean

Returns:

  • (Boolean)


59
# File 'lib/skiftet_statistical/significance.rb', line 59

def significant_90? = significant?(0.10)

#significant_95?Boolean

Returns:

  • (Boolean)


60
# File 'lib/skiftet_statistical/significance.rb', line 60

def significant_95? = significant?(0.05)

#significant_99?Boolean

Returns:

  • (Boolean)


61
# File 'lib/skiftet_statistical/significance.rb', line 61

def significant_99? = significant?(0.01)