Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #60 from sandbox/master

Set lower-tail? for p-value calculation
  • Loading branch information...
commit 6a243859791d89432790718e683ba340f91339f3 2 parents 84067c0 + fbe693e
@liebke liebke authored
View
2  modules/incanter-core/src/incanter/stats.clj
@@ -2188,7 +2188,7 @@
(if one-sample?
(if (neg? t-stat) true false)
(if (neg? t-stat) false true)))
- one-sided-p (cdf-t t-stat :df df :lower-tail lower-tail?)
+ one-sided-p (cdf-t t-stat :df df :lower-tail? lower-tail?)
qt (if (= alternative :two-sided)
(quantile-t (/ (- 1 conf-level) 2) :df df)
(quantile-t (- 1 conf-level) :df df))]
View
9 modules/incanter-core/test/incanter/stats_tests.clj
@@ -286,6 +286,15 @@
(testing "Basic p-value testing"
(is (= 1.0 (simple-p-value (range 1 11) 5.5)))
(is (< 0.999 (simple-p-value (range 1 11) 5.499)))))
+
+(deftest t-test-test
+ (testing "Return values for a t-test"
+ (let [t-test-result
+ (t-test
+ [1,1,1,1,2,2,2,4,4,4,4]
+ :y [1,1,2,2,2,4,4])]
+ (is (> 1 (:p-value t-test-result))))))
+
(deftest benford-law-test
(let [coll [1131111 623946 325911 1799255 199654 299357 3819495 359578 285984 2214801 341104 1303129 444480 295177 450269 1758026 498061 422457 315689 1160446 573568 253962 515211 998573 677829 1289257 572988 482990 765723 337178]]
(is
Please sign in to comment.
Something went wrong with that request. Please try again.