I want to perform a very large number of Mann-Whitney U-tests between many groups from data that I will get in from a database.
I would prefer to use a pre-implemented version of this test.
I think that I have three options:
- Perform the U-test on the database server.
- Pull all data from the server and perform locally.
- Pull a "histogram compressed" version of the data and perform the tests locally.
Thoughts on these options:
- I don't like the idea of writing my own Mann-Whitney U procedure in Postgres. I am not a statistician nor a DB expert and bugs seem likely.
- I don't like the option of pulling a very huge amount of data from the server. However, this would let me use a simply stats package in Python and keep the "statistics good"
- To clarify what I mean -
- I can have a full dataset:
- [x1,x2,x3,....xn]
- But I could also "compress" that data by taking a histogram of it. In this case, I could show the data as
- [bin_location_1*numer_of_points_in_bin_1, etc]
I like this approach because it greatly compresses the info that I take from the database, but I worry that I would "lose information" that might invalidate the U-test.
Thoughts?
wilcox.test
in R is not too fussy about ties. My brief supplementary demo in Answer format is below. (I hope you will accept his Answer.) $\endgroup$