Пример #1
0
    def test_approx(self):
        ramsay = np.array((111, 107, 100, 99, 102, 106, 109, 108, 104, 99,
                           101, 96, 97, 102, 107, 113, 116, 113, 110, 98))
        parekh = np.array((107, 108, 106, 98, 105, 103, 110, 105, 104,
                           100, 96, 108, 103, 104, 114, 114, 113, 108, 106, 99))

        with warnings.catch_warnings():
            warnings.filterwarnings('ignore',
                        message="Ties preclude use of exact statistic.")
            W, pval = stats.ansari(ramsay, parekh)

        assert_almost_equal(W,185.5,11)
        assert_almost_equal(pval,0.18145819972867083,11)
    def test_approx(self):
        ramsay = np.array((111, 107, 100, 99, 102, 106, 109, 108, 104, 99, 101,
                           96, 97, 102, 107, 113, 116, 113, 110, 98))
        parekh = np.array((107, 108, 106, 98, 105, 103, 110, 105, 104, 100, 96,
                           108, 103, 104, 114, 114, 113, 108, 106, 99))

        with warnings.catch_warnings():
            warnings.filterwarnings(
                'ignore', message="Ties preclude use of exact statistic.")
            W, pval = stats.ansari(ramsay, parekh)

        assert_almost_equal(W, 185.5, 11)
        assert_almost_equal(pval, 0.18145819972867083, 11)
Пример #3
0
 def test_exact(self):
     W,pval = stats.ansari([1,2,3,4],[15,5,20,8,10,12])
     assert_almost_equal(W,10.0,11)
     assert_almost_equal(pval,0.533333333333333333,7)
Пример #4
0
 def test_small(self):
     x = [1,2,3,3,4]
     y = [3,2,6,1,6,1,4,1]
     W, pval = stats.ansari(x,y)
     assert_almost_equal(W,23.5,11)
     assert_almost_equal(pval,0.13499256881897437,11)
 def test_exact(self):
     W, pval = stats.ansari([1, 2, 3, 4], [15, 5, 20, 8, 10, 12])
     assert_almost_equal(W, 10.0, 11)
     assert_almost_equal(pval, 0.533333333333333333, 7)
 def test_small(self):
     x = [1, 2, 3, 3, 4]
     y = [3, 2, 6, 1, 6, 1, 4, 1]
     W, pval = stats.ansari(x, y)
     assert_almost_equal(W, 23.5, 11)
     assert_almost_equal(pval, 0.13499256881897437, 11)