Statistical analysis often relies on assumptions about the data being analysed. For instance, parametric tests like t-tests and ANOVA assume that the data follows a specific distribution (usually normal distribution) and meets certain conditions (such as homogeneity of variances). However, real-world data doesn't always fit these assumptions. This is where non-parametric tests come in handy.


When the data do not meet the assumptions about the population sample, the population sample size is too small or the data is ordinal or nominal, a non-parametric test is the suitable option.


Non-parametric tests are statistical tests that do not assume a specific distribution for the data. It is a method of statistical analysis that does not require a distribution to meet the required assumptions to be analysed. They are instrumental when dealing with ordinal data or data that does not meet the assumptions required for parametric tests. This post will explore three common non-parametric tests: the Mann-Whitney U test, the Wilcoxon signed-rank test, and the Kruskal-Wallis test.

Mann-Whitney U Test

The Mann-Whitney U test is a non-parametric test used to determine whether there is a significant difference between the distributions of two independent groups. It is the non-parametric equivalent of the independent t-test and is also known as the Wilcoxon rank-sum test.

Hypothesis:

  • H0: The two populations are equal

  • H1: The two populations are not equal

When to Use the Mann-Whitney U Test:

  • When comparing two independent groups.

  • When the sample sizes are small.

  • When the data is ordinal or not normally distributed.


What if I tell you, you can make money while you sleep?


Steps to Perform the Mann-Whitney U Test:

1. Rank the Data: Combine the data from both groups and rank them in ascending order. Assign the smallest value a rank of 1, the next smallest a rank of 2, and so on. If there is a tie, all the data that tie receive the average rank of that set of data.

2. Calculate the U Statistic: For each group, sum the ranks of the observations. Then, use the formula to calculate the U statistic:

  

    where and are the sums of the ranks for each group, and and are the sample sizes of each group.

3. Determine the Smaller U Value: The test statistic U, is the smaller value of and .

4. Interpret the Results: Compare the U value to a critical value from the Mann-Whitney U distribution table. If U is less than or equal to the critical value, reject the null hypothesis, indicating a significant difference between the groups.


Wilcoxon Signed-Rank Test

The Wilcoxon signed-rank test is a non-parametric test used to compare two related samples or repeated measurements on a single sample. It is the non-parametric equivalent of the paired t-test. It assumes no specific distribution of the data being analysed, that is whether or not it takes a normal distribution.

Hypotheses:

  • H0: The median difference is zero

  • H1: The median difference is positive

When to Use the Wilcoxon Signed-Rank Test:

  • When comparing two related samples or matched pairs.

  • When the sample sizes are small.

  • When the data is ordinal or not normally distributed.

Steps to Perform the Wilcoxon Signed-Rank Test:

1. Calculate the Differences: For each pair of observations, calculate the difference between the two related measurements.

2. Rank the Differences: Ignore the signs of the differences and rank them in ascending order. Assign the smallest difference a rank of 1, the next smallest a rank of 2, and so on.

3. Assign Signs to Ranks: Reattach the signs (“+” or “-”) of the differences to the ranks.

4. Calculate the Test Statistic: Sum the positive ranks and the negative ranks separately. The test statistic is the smaller of these two sums. That is the smaller sum of the positive ranks or the smaller sum of the negative ranks.

5. Interpret the Results: Compare the test statistic to a critical value from the Wilcoxon signed-rank distribution table. If the test statistic is less than or equal to the critical value, reject the null hypothesis, indicating a significant difference between the paired observations.


Kruskal-Wallis Test

The Kruskal-Wallis test is a non-parametric test used to determine if there are statistically significant differences between three or more groups of an independent variable. It is sometimes referred to as the one-way ANOVA on ranks and the non-parametric equivalent of one-way ANOVA.

Hypothesis:

  • H0: The population medians are equal

  • H1: The population medians are not equal

When to Use the Kruskal-Wallis Test:

  • When comparing three or more independent groups.

  • When the sample sizes are small.

  • When the data is ordinal or not normally distributed.

Steps to Perform the Kruskal-Wallis Test:

1. Rank the Data: Combine the data from all groups and rank them in ascending order.

2. Calculate the Sum of Ranks: For each group, sum the ranks of the observations.

3. Calculate the Test Statistic: Use the following formula to calculate the Kruskal-Wallis H statistic:



    where is the sum of ranks for group i, is the sample size for group i, and N is the total sample size.

4. Interpret the Results: Compare the H value to a critical value from the chi-square distribution table with k-1 degrees of freedom, where k is the number of groups. If H is greater than the critical value, reject the null hypothesis, indicating a significant difference among the groups.


Conclusion

Non-parametric tests are powerful tools for statistical analysis when the assumptions required for parametric tests are not met. The Mann-Whitney U test, Wilcoxon signed-rank test, and Kruskal-Wallis test are just a few examples of non-parametric tests that can be used to analyse data that is ordinal, not normally distributed, or has small sample sizes. By understanding when and how to use these tests, you can ensure that your statistical analyses are robust and reliable, even when your data doesn't fit the mould of parametric assumptions.