question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in scipy.stats.mannwhitneyu documentation

See original GitHub issue

Below is the docstring of the scipy.stats.mannwhitneyu function (scipy==1.8.0) If F(u) and G(u) are the cumulative distribution functions of the distributions underlying x and y, respectively then the hypothesis for ‘greater’ would be F(u) > G(u) for all u, right?. However, in the documentation, the inequality is written in the other direction. And the same for the ‘less’ hypothesis.

Parameters
----------
x, y : array-like
    N-d arrays of samples. The arrays must be broadcastable except along
    the dimension given by `axis`.
use_continuity : bool, optional
    Whether a continuity correction (1/2) should be applied.
    Default is True when `method` is ``'asymptotic'``; has no effect
    otherwise.
alternative : {'two-sided', 'less', 'greater'}, optional
    Defines the alternative hypothesis. Default is 'two-sided'.
    Let *F(u)* and *G(u)* be the cumulative distribution functions of the
    distributions underlying `x` and `y`, respectively. Then the following
    alternative hypotheses are available:
    
    * 'two-sided': the distributions are not equal, i.e. *F(u) ≠ G(u)* for
      at least one *u*.
    * 'less': the distribution underlying `x` is stochastically less
      than the distribution underlying `y`, i.e. *F(u) > G(u)* for all *u*.
    * 'greater': the distribution underlying `x` is stochastically greater
      than the distribution underlying `y`, i.e. *F(u) < G(u)* for all *u*.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tupuicommented, May 13, 2022

Documentation improvement are always welcomed.

0reactions
mdhabercommented, May 13, 2022

For reference, SciPy’s description of the alternatives is directly from the original paper: image

Read more comments on GitHub >

github_iconTop Results From Across the Web

scipy.stats.mannwhitneyu — SciPy v1.9.3 Manual
The Mann-Whitney U test is a nonparametric test of the null hypothesis that the distribution underlying sample x is the same as the...
Read more >
TypeError: mannwhitneyu() got an unexpected keyword ...
I am getting the same answer for scipy.stats wilcoxon package, although the documentation appeared to state method as a valid parameter.
Read more >
How to Perform Mann-Whitney U Test in Python with Scipy ...
In this data analysis tutorial, you will learn how to carry out a Mann-Whitney U test in Python with the packages SciPy and...
Read more >
Comparing two independent groups - Phil Mike Jones
the non–parametric Mann–Whitney U test. These tests work by comparing the means to see if they are statistically significantly different. Obviously the means...
Read more >
3.1. Statistics in Python - Scipy Lecture Notes
In this document, the Python inputs are represented with the sign “>>>”. ... in the non paired case is the Mann–Whitney U test,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found