avatarzhang / python-statlib

Automatically exported from code.google.com/p/python-statlib
Other
0 stars 0 forks source link

kruskallwallish incorrectly requires exactly 3 groups #8

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
kruskallwallish needs 3 or more groups, but it's actually testing for
exactly 3 groups. 

just need to change line 3663 == to >=

Index: statlib/stats.py
===================================================================
--- statlib/stats.py    (revision 53)
+++ statlib/stats.py    (working copy)
@@ -3663,7 +3663,7 @@
     Usage:   akruskalwallish(*args)     args are separate arrays for 3+
conditions
     Returns: H-statistic (corrected for ties), associated p-value
     """
-    assert len(args) == 3, "Need at least 3 groups in stats.akruskalwallish()"
+    assert len(args) >= 3, "Need at least 3 groups in stats.akruskalwallish()"
     args = list(args)
     n = [0]*len(args)
     n = map(len,args)

Original issue reported on code.google.com by bpederse on 25 Feb 2009 at 11:12

GoogleCodeExporter commented 8 years ago
ok will fix it in svn

Original comment by istvan.a...@gmail.com on 26 Feb 2009 at 12:20

GoogleCodeExporter commented 8 years ago
Another solution to this problem, if you have statlib-1.1 installed, is to 
simply
pass lists into the function instead of arrays.  kruskallwallish in statlib-1.1
accepts more than three lists, but only three arrays.

Original comment by dfo...@gmail.com on 19 Oct 2009 at 11:05