@@ -109,6 +109,25 @@ def test_w_test(self):
109109 print ('W Test: Running Unit Test' )
110110 self .assertEqual (_w_test_ndarray (x , median ), expected_output , 'Failed W Test' )
111111
112+ out_rev = _w_test_ndarray (x [::- 1 ], median )
113+ self .assertAlmostEqual (out_rev ['z_statistic' ], expected_output ['z_statistic' ], places = 15 )
114+ self .assertAlmostEqual (out_rev ['probability' ], expected_output ['probability' ], places = 15 )
115+
116+ x_with_zeros = numpy .concatenate ([x , numpy .array ([median , median , median ])])
117+ out_with_zeros = _w_test_ndarray (x_with_zeros , median )
118+ self .assertAlmostEqual (out_with_zeros ['z_statistic' ], expected_output ['z_statistic' ], places = 15 )
119+ self .assertAlmostEqual (out_with_zeros ['probability' ], expected_output ['probability' ], places = 15 )
120+
121+ x_ties = numpy .array ([median + 1 , median - 1 ,
122+ median + 2 , median - 2 ,
123+ median + 2 , median - 2 ,
124+ median + 5 , median - 5 ,
125+ median + 10 , median - 10 ], dtype = float )
126+ out_ties = _w_test_ndarray (x_ties , median )
127+ self .assertTrue (numpy .isfinite (out_ties ['z_statistic' ]))
128+ self .assertTrue (0.0 <= out_ties ['probability' ] <= 1.0 )
129+
130+
112131 def test_t_test (self ):
113132 pass
114133 """
0 commit comments