top of page

The Wilcoxon signed-rank test

Updated: Jan 26, 2021

Case

The manager of a national park wants to see if pollution levels in lake are reduced by banning the boat rental. This is measured by the rate of pollution every 60 minutes (8am-22pm: total of 15 measurements) in a day when rental is allowed, and in a day when it is not. Here are the values of water pollution:

With rental: 214, 159, 169, 202, 103, 119, 200, 109, 132, 142, 194, 104, 219, 119, 234

Without rental: 159, 135, 141, 101, 102, 168, 62, 167, 174, 159, 66, 118, 181, 171, 112


It is clear that the two groups are paired, because there is a bond between the readings, consisting in the fact that we are considering the same lake albeit in two different days.


Solution

withrental <- c(159, 135, 141, 101, 102, 168, 62, 167, 174, 159, 66, 118, 181, 171, 112)
withoutrental <- c(214, 159, 169, 202, 103, 119, 200, 109, 132, 142, 194, 104, 219, 119, 234)

wilcox.test(withrental,withoutrental, paired = TRUE)
## 
## Wilcoxon signed rank test
## 
## data: withrental and withoutrental
## V = 40, p-value = 0.2769
## alternative hypothesis: true location shift is not equal to 0

V = 40,

p-value = 0.2769


Since the p-value is greater than 0.05, we conclude that the means have remained essentially unchanged (we accept the null hypothesis H0), then banning the boat rental for a single day did not lead to any improvements in terms of pollution of the lake.


The value V = 40 corresponds T = min(T+, T-). We can calculate the sum of ranks assigned to the differences with positive sign, and the sum of ranks assigned to the differences with negative sign, to compare this interval with the interval tabulated on the tables of Wilcoxon for paired samples, and confirm our statistic decision. Here is how to calculate the two sums.











Comments


bottom of page