# Wilcoxon Test: Definition in Statistics, Types, and Calculation

![Wilcoxon Test: A nonparametric statistical test that compares two paired groups.](https://www.investopedia.com/thmb/dBQ2GS3k3tJAen0xcKdzwPwse4o=/1500x0/filters:no_upscale():max_bytes(150000):strip_icc()/Wilcoxon-test_sketch_final-bc97bd1b88034fbbba28ca7c14a6ea34.png)

*— Investopedia / Michela Buttignol*

> **Definition**
>
> A Wilcoxon test helps researchers understand whether the outcome of e.g., an effect or activity for a particular circumstance differs between the subjects studied.

## What Is the Wilcoxon Test?

The Wilcoxon test is a nonparametric statistical hypothesis test that analyzes two paired groups to determine any [significant statistical](https://www.investopedia.com/terms/s/statistical-significance.asp) difference between them.

Nonparametric means that the data doesn't display a normal distribution.

The Wilcoxon test can refer to either the rank sum test or the signed-rank test version.

### Key Takeaways

*   The Wilcoxon test comes in two versions, the rank sum test and the signed-rank test.
*   The goal of the test is to determine if two or more sets of pairs of data 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., they follow 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](https://www.investopedia.com/terms/h/hypothesistesting.asp) of [nonparametric statistics](https://www.investopedia.com/terms/n/nonparametric-statistics.asp) which is used for population data that can be ranked but does not have numerical values. Such data could include 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:

*   Are test scores different from 5th grade to 6th grade for the same students?
*   Does a particular drug affect health when tested on the same individuals?

These models assume that the data comes from two matched, or dependent, populations. They involve 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 Wilcoxon Tests

### Wilcoxon Rank Sum Test

The Wilcoxon rank sum test can be used to test the [null hypothesis](https://www.investopedia.com/terms/n/null_hypothesis.asp) 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 are that the data is from the same population and is paired, the data can be measured on at least an interval scale, and the data was chosen randomly and independently.

### Wilcoxon Signed-Rank Test

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](https://www.investopedia.com/terms/t/t-test.asp) when the population data does not follow a [normal distribution](https://www.investopedia.com/terms/n/normaldistribution.asp).

## Calculating a Wilcoxon Test Statistic

The steps for arriving at a Wilcoxon signed-rank test statistic, _W,_ are as follows:

1.  For each item in a sample of _n_ items, obtain a difference score, Di, between two measurements (i.e., subtract one from the other).
2.  Neglect then positive or negative signs and obtain a set of _n_ absolute differences |Di|.
3.  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.
4.  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.
5.  Now reassign the symbol "+" or "–" to each of the _n_ ranks Ri, depending on whether Di was originally positive or negative.
6.  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.

## What Is the Wilcoxon Signed-Rank Test Used for?

The Wilcoxon signed-rank test is used to compare two related samples or to check the difference in multiple measurements of the same sample to determine whether there exists a difference in their population mean ranks. The overall task is to see if there is a difference between two sets of related data and whether those differences are meaningful or just chance.

## What Is the T-Test?

Like the Wilcoxon test, the t-test is used to determine if there is a meaningful difference between two related samples. T-tests are used when there is a normal distribution and the data variances are unknown. Certain assumptions need to be made when using a t-test.

## Why Use the Wilcoxon Test Instead of the T-Test?

As a t-test calls for certain assumptions, or requirements, the Wilcoxon test is used when these assumptions cannot be met. For example, when your data is not normally distributed, (normal distribution is needed in a t-test), then you would use a Wilcoxon test.

## The Bottom Line

The Wilcoxon test is a statistical tool for analyzing paired data when the traditional parametric assumptions cannot be met.

It examines the differences and ranks between the pairs to determine whether they have a statistically significant difference. Either the rank sum or signed-rank tests can be used.  

> **Article Sources**
>
> 1.  Wilcoxon, Frank. "[Individual Comparisons by Ranking Methods](https://www.jstor.org/stable/3001968)." _International Biometric Society,_ vol. 1, no. 6, December 1945, pp. 80-83.