Class: Rsquared::StatTest
- Inherits:
-
Object
- Object
- Rsquared::StatTest
- Defined in:
- lib/Rsquared/StatTest.rb
Instance Attribute Summary collapse
-
#pvalue ⇒ Object
Returns the value of attribute pvalue.
Instance Method Summary collapse
- #inspect ⇒ Object
-
#setSidedness!(sided) ⇒ Object
Modifies p-value to account for tails and/or two-sided tests.
- #significant?(alpha = 0.05) ⇒ Boolean
Instance Attribute Details
#pvalue ⇒ Object
Returns the value of attribute pvalue.
3 4 5 |
# File 'lib/Rsquared/StatTest.rb', line 3 def pvalue @pvalue end |
Instance Method Details
#inspect ⇒ Object
12 13 14 |
# File 'lib/Rsquared/StatTest.rb', line 12 def inspect @pvalue end |
#setSidedness!(sided) ⇒ Object
Modifies p-value to account for tails and/or two-sided tests
20 21 22 23 24 25 26 |
# File 'lib/Rsquared/StatTest.rb', line 20 def setSidedness!(sided) if sided == Upper.tail then @pvalue = 1.0-@pvalue elsif sided == Two.sided then @pvalue = [(1.0-@pvalue)*2.0, @pvalue*2.0].min end end |
#significant?(alpha = 0.05) ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/Rsquared/StatTest.rb', line 4 def significant?(alpha=0.05) if @pvalue < alpha then return true else return false end end |