Skip to content

BUG/ENH kruskal as MultiComparison #2663

Open

Description

@josef-pkt

The status of MultiComparison.krusal is unclear, the main function for users is in scipy.stats

The intention in MultiComparison was to reuse the standard tools for the rank versions.

Looking at a bug in scipy, I get similar results with nan.
scipy/scipy#4017 and the linked 3611 (which is specific to the scipy cython implementation)

I didn't check what's going on with MultiComparison.krusal

>>> x = [1.] * 163 + [2.] * 81 + [3.] * 40 + [4.] * 6 + [5.] * 2
>>> y = [1.] * 1007 + [2.] * 362 + [3.] * 99 + [4.] * 27 + [5.] * 13
>>> from scipy import stats
>>> stats.mannwhitneyu(x,y)
(193405.5, nan)
C:\programs\WinPython-64bit-3.4.3.1\python-3.4.3.amd64\lib\site-packages\scipy\stats\stats.py:4093: RuntimeWarning: invalid value encountered in sqrt
  sd = np.sqrt(T*n1*n2*(n1+n2+1)/12.0)
>>> import scipy
>>> scipy.__version__
'0.15.1'
>>> len(x)
292
>>> len(y)
1508
>>> groups = [0] * len(x) + [1] * len(y)
>>> xy = np.concatenate((x, y))
>>> len(xy)
1800

>>> co = sm.stats.multicomp.MultiComparison(xy, groups)
>>> co.kruskal()
MultiComparison.kruskal
0 1 109.399413175 nan nan False
nan
nan
m:\josef_new\eclipse_ws\statsmodels\statsmodels_py34\statsmodels\sandbox\stats\multicomp.py:868: RuntimeWarning: invalid value encountered in sqrt
  se = np.sqrt(f * np.sum(1. / groupnobs[[i,j]] )) #np.array([8,8]))) #Fixme groupnobs[[i,j]] ))

Activity

  1. added this to the 0.9 milestone on Oct 18, 2015
  2. josef-pkt commented on Oct 18, 2015

    @josef-pkt
    MemberAuthor

    I created milestone 0.9 for things that are not planned for 0.8 but shouldn't be open ended.
    Maybe we (or I) manage a stats sprint and cleanup for 0.9.

  3. modified the milestones: 0.10, 0.9 on Jun 2, 2017
  4. changed the title [-]BUG/ENH kruskal as MutliComparison[/-] [+]BUG/ENH kruskal as MultiComparison[/+] on Jun 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions