UnivStudent
UnivStudent

Reputation: 412

Is it possible to specify the alternative hypothesis in Mann-Whitney U tests in Scipy?

I'd like to calculate the one-sided p-value of x > y using the scipy.stats.mannwhitneyu function:

u_value, p_value = scipy.stats.mannwhitneyu(x, y)

however there is nowhere to specify the alternative hypothesis. In R it is possible by using:

wilcox.test(x, y, alternative = 'greater').

Does anyone know if it is possible to do this in python using scipy or any other package?

Upvotes: 3

Views: 2272

Answers (1)

1''
1''

Reputation: 27125

As of Scipy 0.17.0, you can now do scipy.stats.mannwhitneyu(x, y, alternative='greater').

Upvotes: 5

Related Questions