Reputation: 8291
I have the following code to run Wilcoxon rank-sum test
print stats.ranksums(pre_course_scores, during_course_scores)
RanksumsResult(statistic=8.1341352369246582, pvalue=4.1488919597127145e-16)
However, I am interested in extracting the pvalue from the result. I could not find a tutorial about this. Can someone help?
Upvotes: 8
Views: 8037
Reputation:
Use the pvalue
attribute of the returning object:
import scipy.stats as ss
result = ss.ranksums(np.random.randn(10), np.random.randn(10))
result.pvalue
Out: 0.44969179796889092
I assigned it to a variable but you can directly use stats.ranksums(pre_course_scores, during_course_scores).pvalue
.
Upvotes: 11