No menu items!

Mann Whitney U Test in Excel

-

This non-parametric test for two samples was described by Wilcoxon and studied by Mann and Whitney. It is the most widely used test as an alternative to the t-test when we do not make the t-test assumptions about the parent population.

This test is used to test whether two independent samples come from the same population in situations where you don’t have interval or ratio data (and thus can’t use the t-test).

This test can be directly applied if the data is ordinal. If the data is not ordinal we can rank the data. We then work with these ranks rather than the original data points. We now explain how to carry out the test in excel with the help of an example.

The value of the test statistic can be calculated using the formula, U= N_AN_B + \frac{ N_A( N_A+1)}{2} - R_A where, RA is the sum of the ranks in column A, NA is the number of scores in column A, and NB is the number of scores in column B.

How to Perform the Mann Whitney Test in Excel:

Suppose that a group of 40 people is divided into two equal groups. One group watches a stressful movie while the other watches a stressful cartoon. They then rate the degree of their stress after watching on a scale of 1 to 100.

Our null hypothesis, in this case, is that we expect that the people experience the same degree of stress on watching either the movie or the cartoon. The alternative hypothesis is that the stress would be higher after the stressful movie. We carry out the test as follows.

Step 1: We first enter the data values. We can see that the data values are entered in columns A and B in the below image.

Step 2: We assign ranks to the data values. The ranks can be obtained using the RANK.AVG command.

In cell D2, type the command =RANK.AVG(A2,$A$2:$B$21,1) and then autofill the columns D and E. The ranks are obtained in columns D and E as shown in the image below.

Mann Whitney U Test in Excel

Step 3: Input the values of NA and NB in the cells G2 and H2 as shown in the image. Then calculate the value of the test statistic using the following formula in cell H4,

=NA*NB +((NA*(NA+1))/2)-E22

Step 4: Calculate the mean and standard deviation for U. The mean is calculated in cell H5 using the formula,

=(NA*NB)/2

The standard deviation is calculated in cell H6 using the formula,

=SQRT((NA*NB*(NA+NB+1))/12)

Step 5: We calculate the p-values with help of the above values. We use the following command.

=NORM.DIST(H4,H5,H6,TRUE)

The result of 0.97 is obtained in cell H8. This means that the p-value is equal to 1- 0.97 =0.03. Since the p-value is less than 0.05 we reject the null hypothesis. This means that the movie and cartoon do not produce equal amounts of stress. We conclude that the movie produces much more stress compared to the cartoon.

Hey 👋

I'm currently pursuing a Ph.D. in Maths. Prior to this, I completed my master's in Maths & bachelors in Statistics.

I created this website for explaining maths and statistics concepts in the simplest possible manner.

If you've found value from reading my content, feel free to support me in even the smallest way you can.



Share this article

Recent posts

Popular categories

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Recent comments