Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wilcoxon() rejection direction is unclear for one-sided test #9046

Closed
jkokatjuhha opened this issue Jul 17, 2018 · 2 comments
Closed

wilcoxon() rejection direction is unclear for one-sided test #9046

jkokatjuhha opened this issue Jul 17, 2018 · 2 comments
Labels

Comments

@jkokatjuhha
Copy link

@jkokatjuhha jkokatjuhha commented Jul 17, 2018

<<Please describe the issue in detail here, and for bug reports fill in the fields below.>>
As mentioned here by @abhinavkgp :

... it is still not possible to determine one-sided result (whether x-y>0 or y-x>0) using this two-sided statistic, due to the following:

Code:
T = min(r_plus, r_minus)
r_plus = np.sum((d > 0) * r, axis=0) #Always positive
r_minus = np.sum((d < 0) * r, axis=0) #Always positive

Reasoning:
So, if you swap x and y, T will still be the same, z statistics will still be the same

Final Thoughts:
We should also aim to return in some way that whether r_plus was used or r_minus was used (through a flag maybe) in order to know the result of a one-sided tailed test

Reproducing code example:

A = [10,10,10,10,15,11]
B = [30,30,30,30,31,32]

wilcoxon(A, B) == wilcoxon(B,A)

Scipy/Numpy/Python version information:

1.0.1 1.14.3 sys.version_info(major=3, minor=6, micro=5, releaselevel='final', serial=0)
@chrisb83

This comment has been minimized.

Copy link
Member

@chrisb83 chrisb83 commented Jul 17, 2018

The test only returns the two-sided p-value, so the order of x and y does not matter. I don't think there is a bug.

Is this a feature request to have a one-sided test?

@jkokatjuhha

This comment has been minimized.

Copy link
Author

@jkokatjuhha jkokatjuhha commented Jul 17, 2018

Once could transform the p-value directly into a one-sided p-value by diving by 2. So, yes, it is either a feature request (like in R: alternative which can be 'two.sided', 'greater' or 'less') or a request for providing a flag for rejection direction in case of a one-sided test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.