Again, how many of you actually read those warning messages? It’s tempting to just ignore them. Especially since R does not display them directly when numerous messages are generated. When more than 50 warnings arise, you actually don’t see them. Instead, there’s a message telling you to use the command/function warnings() to display them.

But it’s important to look at the warnings to assess if you need to fix the code that triggered them or not. If you don’t, you won’t know for sure that the returned value is the good one.

Let me convince you with a case I’ve run into a few times this summer. When you want to compare two groups and you don’t know if they are normally distributed, a non-parametric test is indicated. The Wilcoxon Rank Sum test (also known as Mann-Withney U test or Mann-Withney-Wilcoxon test) tests whether two independent vectors of observations are drawn from the same distribution. This test is based on the ranking of all the values; if the two groups come from the same population, there won’t be any pattern emerging from the arrangement of the data. If they come from different populations, a pattern will be discernable.

Group A observations :

4

8

9

10

5

11

Group B observations :

1

3

5

8

6

9

The values are ordered and given a rank. When ties occur, the values are given the average of the ranks. The sum of the ranks is then computed.

Group :

B

B

A

B

A

B

A

B

B

A

A

A

Observations :

1

3

4

5

5

6

8

8

9

9

10

11

Rank :

1

2

3

4.5

4.5

6

7.5

7.5

9.5

9.5

11

12

wA = 3+4.5+7.5+9.5+11+12 = 47.5
wB = 1+2+4.5+6+7.5+9.5 = 30.5

These values are then used to assess whether the null hypothesis is true or false.

Share This Story, Choose Your Platform!

I’ve started in biochemistry but it is as a bioinformatician that I’ve been having fun for several years now : whether doing data analysis and visualization in R, building interactive web interfaces in javascript or exploring machine learning in python.