Talk:Permutation test: Difference between revisions

→‎Difference in results?: Using rational arithmatic.
(→‎Difference in results?: Using rational arithmatic.)
Line 72:
 
--[[User:Sluggo|Sluggo]] 02:06, 4 February 2011 (UTC)
 
===Using rational arithmatic===
I wondered about the accuracy of results after it was queried above and ran the Python solution but with rational numbers as input to see what effect this may have.
 
I should explain that the first set of results are produced using the Python program from the page which works in double precision floating point, in the idle Python IDE. I then show the calculation of a result using rationals (the fractions module).
<lang python>>>> ================================ RESTART ================================
>>>
under=86.90%, over=13.10%
>>> from fractions import Fraction as F
>>> t = [F(tr) for tr in treatmentGroup]
>>> c = [F(cn) for cn in controlGroup]
>>> u = permutationTest(t, c)
>>> print("under=%.2f%%, over=%.2f%%" % (u, 100. - u))
under=86.89%, over=13.11%</lang>
 
--[[User:Paddy3118|Paddy3118]] 03:22, 4 February 2011 (UTC)
 
== Name of task ==
Anonymous user