Mann-Whitney non parametric test
Atualizado: 4 de set. de 2020
In my training sessions of Statistics Applied to Process Improvement, normally I do not give emphasis to non-parametric tests, because as the vast majority of my training is focused on the industrial area in which parametric tests are more common, so I try to focus on what is most used. But non-parametric ones can also be used in the industrial area! I will prepare the teaching material and include this one in the next training programs. As we said in Brazil, when you promise you get a debt!
PS: You can check the article here by the blog or if you prefer you can download the article here.
Mann-Whitney non parametric test
Author: Edson Rui Montoro
Non-parametric techniques are statistical methods that can be used when the assumption of normality is not met. These techniques are free of distribution, that is, they do not make assumptions about the distribution from which samples are collected, unlike many other statistical tests (such as the t-Student test).
For example, you can test two materials from different suppliers in one process. Samples of materials from both suppliers are collected and the results of an important variable are compared using a t-Student test to compare the means of the two suppliers. This type of test assumes that this variable has a normal distribution.
Often, we do not worry or even forget the assumption of normality. There are times when this assumption should not be ignored, as there are many variables that do not follow a normal distribution model, for example, life time data, call center waiting times, bacterial growth or the number of incidents in a factory. You should not use t-Student tests with these types of data.
The main difference between non-parametric techniques and those that require a normal distribution (called parametric techniques) is the use of the median instead of the mean. The median provides a better estimate of the center of a non-normal distribution.
The Mann-Whitney test that will be presented today, compares two independent samples. There is also the Kruskal-Wallis test that can be used with more than two independent samples, which would be the non-parametric test equivalent to performing an ANOVA, there are still many other non-parametric tests that will gradually be addressed here on our website.
The Mann-Whitney test is used to determine whether one population's observations tend to be larger or smaller than another population. This is done by taking sampling observations (ordinal or numerical) of each population, assuming that the two populations have the same shape, only different measures of position (for example, different medians). In most cases, the following hypotheses will be tested:
Where θ1 and θ2 are the position parameters for the two distributions. You can also test whether one median is greater or less than the other.
The methodology involves comparing each observation in one distribution with each observation in the other distribution. This is easier to understand by looking at an example.
A company is interested in a capacitor's failure time. 8 capacitors are tested under normal conditions and 10 capacitors under thermal stress conditions. They want to find out if thermal stress conditions reduce the time to fail. The data and the hypothesis test script are detailed below.
Step 1: Understand the problem;
Step 2: Formulate the Hypotheses (Null and Alternative):
Step 3: Set the alpha value (usually 5%);
Step 4: Define the size of the samples (sometimes already defined previously) n1 = 8 and n2 = 9;
Step 5: Define the statistical test to be used. In this case, as the variable lifetime does not follow a Normal, it was decided to use a non-parametric test, the Mann-Whitney test;
Step 6: Define the critical region (defined by H1 and Alpha), in this case it is a one-sided test on the left;
Step 7: Define the H0 Rejection Criterion:
Step 8: Collect the experimental data:
Step 9: Calculate the Observed statistic. To perform the calculations, the following steps were followed:
9.1: Sort all data (regardless of which sample) in ascending order and assign posts to each value:
For repeated values, the average rank is assigned; as in the case of 18.9 who occupies the position 5.5; and the 24.5 that occupies the rank 10.5.
When there are more equal values, the position occupied by this value will always be the average position, as for example, if there were 3 extra values, 41, 41 and 41, the position would be 19.
Organizing the data again, each one with its experimental condition, and adding the values of the stations, would be:
9.2: Perform the following calculations:
Step 10: Compare to the critical value:
The critical value. 15. is given by Table 1 defined by n1 = 8 and n2 = 9 (There are tables with other alpha values. here we will only show the 5%. which is what we are interested in).
Step 11: Decision and Recommendations for improvement:
As the observed value u2 = 5.5 (as defined in the Hypothesis table) is less than the critical value (15). the null hypothesis is rejected and we conclude that the median of the capacitor's life under normal conditions (median 1) is greater than the median lifetime of the capacitor under thermal stress (median 2) with a significance level of 5%.
In cases where the sample size is large enough (usually greater than 30) it is possible to approximate to a Normal distribution. In this case z is calculated using the following equation:
And the decision is simply to compare the value obtained with a critical z value which depends on its defined level of significance and your alternative hypothesis.
When the alpha is 5% and you want to test whether it is different the critical z value in the standardized Normal table is 1.96 and if it is a one-sided test 1.645.
As an advantage non parametric tests do not depend on the probability distribution model especially when there are few samples. On the other hand they are less powerful than the corresponding parametric tests designed for use on data from a specific distribution.
It is worth emphasizing that many non-parametric tests referring to the center of the population distribution are tests on the median instead of the average. The test does not answer the same question as the corresponding parametric procedure. When there is a choice between using a parametric or a non parametric procedure and it is believed that the assumptions for the parametric procedure have been satisfied, it is advisable to use the parametric procedure.
As I am a fan of more visual techniques, I could not fail to use the Box Plot (click here to access the previous post on our website) to view the data in our example (capacitor failure time, Figure 1), remembering that the Box Plot technique is also non-parametric.
As can be seen the chamfers that represent the 95% confidence interval for the respective medians do not coincide, leading us to the same conclusion as the Mann-Whitney test, the median times are different; the under normal conditions value is significantly higher than the stressed conditions value.
Non parametric techniques are a good alternative when the data do not follow a Normal or also for cases where you are not sure. Another advantage is the simplicity of the calculations. There are certainly many opportunities to apply these tests, just open your eyes and mind and develop the habit of always using scientifically valid techniques to work with the data.
Tucker. H. A short graduate course in nonparametric statistical inference. (1984). University of California.
Wadsworth. M. W. Handbook of Statistical Methods for Engineers and Scientists. (1990). McGraw-Hill Publishing Company.
About the author:
Edson R. Montoro is Technical Director of ERMontoro Consulting and Training Ltda, a company focused on people development and process improvement consulting using Applied Statistics and Lean Manufacturing.
The author is a Chemist from UNESP (Paulista State University Júlio de Mesquita Filho) - Araraquara, MBA in Business Management from FGV (Getulio Vargas Foundation), Master Black Belt from Air Academy Associates, Quality Engineer from ASQ (America Society for Quality) and Postgraduate in Production Management from UFSC (Federal University of Santa Catarina).