What Is the Wilcoxon Test?
The Wilcoxon test, which can refer to either the rank sum test or the signed rank test version, is a nonparametric statistical test that compares two paired groups. The tests essentially calculate the difference between sets of pairs and analyze these differences to establish if they are statistically significantly different from one another.
- The Wilcoxon test compares two paired groups and comes in two versions, the rank sum test, and signed rank test.
- The goal of the test is to determine if two or more sets of pairs are different from one another in a statistically significant manner.
- Both versions of the model assume that the pairs in the data come from dependent populations, i.e., following the same person or share price through time or place.
Understanding the Wilcoxon Test
The rank sum and signed rank tests were both proposed by American statistician Frank Wilcoxon in a groundbreaking research paper published in 1945. The tests laid the foundation for hypothesis testing of nonparametric statistics, which are used for population data that can be ranked but do not have numerical values, such as customer satisfaction or music reviews. Nonparametric distributions do not have parameters and cannot be defined by an equation as parametric distributions can.
The types of questions that the Wilcoxon test can help answer include things like:
- Are test scores different from 5th grade to 6th grade for the same students?
- Does a particular drug have an effect on health when tested on the same individuals?
These models assume that the data comes from two matched, or dependent, populations, following the same person or stock through time or place. The data is also assumed to be continuous as opposed to discrete. Because it is a nonparametric test, it does not require a particular probability distribution of the dependent variable in the analysis.
Types of the Wilcoxon Test
- The Wilcoxon rank sum test can be used to test the null hypothesis that two populations have the same continuous distribution. A null hypothesis is a statistical test that says there's no significant difference between two populations or variables. The base assumptions necessary to employ the rank sum test is that the data are from the same population and are paired, the data can be measured on at least an interval scale, and the data were chosen randomly and independently.
- The Wilcoxon signed rank test assumes that there is information in the magnitudes and signs of the differences between paired observations. As the nonparametric equivalent of the paired student's t-test, the signed rank can be used as an alternative to the t-test when the population data does not follow a normal distribution.
Calculating a Wilcoxon Test Statistic
The steps for arriving at a Wilcoxon signed rank test statistic, W, are as follows:
- For each item in a sample of n items, obtain a difference score, Di, between two measurements (i.e., subtract one from the other).
- Neglect then positive or negative signs and obtain a set of n absolute differences |Di|.
- Omit difference scores of zero, giving you a set of n non-zero absolute difference scores, where n' ≤ n. Thus, n' becomes the actual sample size.
- Then, assign ranks Ri from 1 to n to each of the |Di| such that the smallest absolute difference score gets rank 1 and the largest gets rank n. If two or more |Di| are equal, they are each assigned the average rank of the ranks they would have been assigned individually had ties in the data not occurred.
- Now reassign the symbol "+" or "–" to each of the n ranks Ri, depending on whether Di was originally positive or negative.
- The Wilcoxon test statistic W is subsequently obtained as the sum of the positive ranks.
In practice, this test is performed using statistical analysis software or a spreadsheet.