{"id":68,"date":"2018-06-11T13:53:00","date_gmt":"2018-06-11T13:53:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/06\/11\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing\/"},"modified":"2020-07-25T22:29:09","modified_gmt":"2020-07-25T20:29:09","slug":"how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing\/","title":{"rendered":"How to Perform Mann-Witney U Test(Step by Step) &#8211; Hypothesis Testing"},"content":{"rendered":"<p>The\u00a0Mann-Witney U Test is is an interesting procedure and really very straightforward if you would follow through. I happy to know that you are making effort to learn hypothesis testing.<\/p>\n<p>Feel free to leave me a comment below if you have any challenges. I would be happy to give you needed support.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Content<\/b><\/p>\n<ol>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#t1\">What is Mann-Whitney u-Test?<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#t2\">Exercise 1<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#t3\">Solution Steps<\/a>\n<ul>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#s1\">Step 1: State the null and alt hypothesis and rejection criteria<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#s2\">Step 2: Rank all Observations<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-mann-witney-u-teststep-by-step-hypothesis-testing#s3\">Step 3: Calculate Rank Sums<\/a><\/li>\n<li><a href=\"#s4\">Step 4: Calculate U<\/a><\/li>\n<li><a href=\"#s5\">Step 5: Determine Critical Value and Draw Conclusion<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3><b id=\"t1\">1. What is Mann-Whitney u-Test?<\/b><\/h3>\n<p>Mann-Whitney u-Test is a non-parametric test used to test whether two independent samples were selected from population having the same distribution. Another name for the Mann-Whitney U Test is Wilcoxon Rank Sum Test.<\/p>\n<p><b>Note<\/b>: This is<span style=\"color: red;\"> not<\/span> the same as <a href=\"http:\/\/kindsonthegenius.blogspot.com\/2018\/03\/hypothesis-testing-problems-question-9.html\" target=\"_blank\" rel=\"noopener\">Wilcoxon Signed Rank Test<\/a> which is used for dependent samples.<\/p>\n<p>Just as you know, the easiest way to understand as statistical test is to just perform the test yourself. So now we are going to go through an example and be sure to follow along with a pen,\u00a0 notebook and a calculator. It is really easy and fun!<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"t2\">2. Exercise<\/h3>\n<p>A\u00a0 researcher gave an aptitude test to 24 respondents, 12 were men and 12 of them were women. He recorded the scores for each of the responded and tabulated it in the table below:<\/p>\n<table border=\"1\">\n<tbody>\n<tr>\n<td>Men<\/td>\n<td>80<\/td>\n<td>79<\/td>\n<td>92<\/td>\n<td>65<\/td>\n<td>83<\/td>\n<td>84<\/td>\n<td>95<\/td>\n<td>78<\/td>\n<td>81<\/td>\n<td>85<\/td>\n<td>73<\/td>\n<td>52<\/td>\n<\/tr>\n<tr>\n<td>Women<\/td>\n<td>82<\/td>\n<td>87<\/td>\n<td>89<\/td>\n<td>91<\/td>\n<td>93<\/td>\n<td>76<\/td>\n<td>74<\/td>\n<td>70<\/td>\n<td>88<\/td>\n<td>99<\/td>\n<td>61<\/td>\n<td>94<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Use thid data provided to test the null hypothesis that the distribution of scores is the same for men as for women. Use a significance level of 0.05. (Use the Wilcoxon Rank Sum Test)<\/p>\n<p>&nbsp;<\/p>\n<h3 id=\"t3\">3. Solution Steps<\/h3>\n<p>We would follow the step by step procedure. We would also use excel to tabulate our data to make it easier to perform calculation.<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s1\">Step 1: State the null and alternate hypothesis and rejection criteria<\/h4>\n<p>The null hypothesis states that median difference between the pairs ranks of the observations is zero (that is there is no difference in the ranks of the two pairs of observations) and the alternate hypothesis states that the median difference between the ranks of data is not zero.<\/p>\n<p>These are stated below.<\/p>\n<p>H0: \u03bc<sub>m<\/sub> = \u03bc<sub>w<\/sub><br \/>\nH1: \u03bc<sub>m<\/sub> \u2260 \u03bc<sub>w<\/sub><\/p>\n<p>Alpha = 0.05<\/p>\n<p>Rejection Criteria: Reject the null hypothesis if U<sub>stat<\/sub> &lt; U<sub>crit<\/sub><\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s2\">Step 2: Perform a ranking of all the observation<\/h4>\n<p>In this case, we simply subtract corresponding pairs of the data.<br \/>\nWe would used MS Excel to help us do it faster. So, I have transferred the table excel and the added a column for the difference in the two pairs of observations.<\/p>\n<p>&nbsp;<\/p>\n<div style=\"clear: both; text-align: center;\">\u00a0<a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-Q_O65-OnoLY\/Wx6PgepiyYI\/AAAAAAAAB8U\/Ic_1keq0eQYV84V8d7djJBKbzlYtvjORACLcBGAs\/s1600\/Table.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/3.bp.blogspot.com\/-Q_O65-OnoLY\/Wx6PgepiyYI\/AAAAAAAAB8U\/Ic_1keq0eQYV84V8d7djJBKbzlYtvjORACLcBGAs\/s320\/Table.jpg\" width=\"320\" height=\"218\" border=\"0\" data-original-height=\"727\" data-original-width=\"1067\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<p>Total number of observation is 24, so we need to rank the observations from 1 to 24. In the figure, I have colored the observation for Men as blue and for Women as red. This is so that, when I sort the data, I would know which one belongs to which group.<\/p>\n<p>I sorted the data to make it easy to assign the ranks to each of the observation.<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s3\">Step 3: Calculate the Rank Sums<\/h4>\n<p>We calculate the sum of the ranks for the two groups<\/p>\n<p>Sum for Men (n1) = 10+9+20+3+13+14+23+8+11+15+5+1 = 132<\/p>\n<p>Sum for Women (n2) = 12=16+18+19+21+7+6+4+17+24+2+22 = 168<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s4\">Step 4: Calculate the U Statistic for the Two Groups<\/h4>\n<p>The formula the the U statistic is given as:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-u_LglGsbBv8\/Wx6ThqQEB-I\/AAAAAAAAB8g\/S4WG-e2OeAI7yLb1voC078Ma29qcXDocwCLcBGAs\/s1600\/Rank-Sum.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/3.bp.blogspot.com\/-u_LglGsbBv8\/Wx6ThqQEB-I\/AAAAAAAAB8g\/S4WG-e2OeAI7yLb1voC078Ma29qcXDocwCLcBGAs\/s320\/Rank-Sum.jpg\" width=\"281\" height=\"51\" border=\"0\" data-original-height=\"101\" data-original-width=\"564\" \/><\/a><\/div>\n<p>For the Men observation, we have<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-eJocG5f3E-k\/Wx6UlOunipI\/AAAAAAAAB8s\/riVGlTwTM8AufjRbFkIG6mMAiDo5Z0MmwCLcBGAs\/s1600\/Ustat%2Bfor%2Bmen.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/2.bp.blogspot.com\/-eJocG5f3E-k\/Wx6UlOunipI\/AAAAAAAAB8s\/riVGlTwTM8AufjRbFkIG6mMAiDo5Z0MmwCLcBGAs\/s320\/Ustat%2Bfor%2Bmen.jpg\" width=\"277\" height=\"179\" border=\"0\" data-original-height=\"323\" data-original-width=\"499\" \/><\/a><\/div>\n<p>We also calculate the U for the Women observation, we have<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-O8mSliHPtLc\/Wx6U_MG6TeI\/AAAAAAAAB80\/QStJT9g83xk-KAalfTVoCBd0Svdbhgo1ACLcBGAs\/s1600\/Ustat%2Bfor%2Bwomen.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/3.bp.blogspot.com\/-O8mSliHPtLc\/Wx6U_MG6TeI\/AAAAAAAAB80\/QStJT9g83xk-KAalfTVoCBd0Svdbhgo1ACLcBGAs\/s320\/Ustat%2Bfor%2Bwomen.jpg\" width=\"268\" height=\"161\" border=\"0\" data-original-height=\"323\" data-original-width=\"538\" \/><\/a><\/div>\n<p>The U-stat is the smaller value of the two and that would be<\/p>\n<p>U<sub>stat<\/sub> = 66<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s5\">Step 5:Determine the Critical value from Table<\/h4>\n<p>From Mann-Withney u-test table, we check the value under column 12 and row 12<br \/>\nWe have a critical value of U to be<\/p>\n<p>U<sub>crit<\/sub> = 37<\/p>\n<p>Since the calculated value of U is greater than the critical value, we accept the null hypothesis and agree that the two groups are the same.<\/p>\n<p>Thanks for learning. Leave a comment if you have any challenges following this lesson.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The\u00a0Mann-Witney U Test is is an interesting procedure and really very straightforward if you would follow through. I happy to know that you are making &hellip; <\/p>\n","protected":false},"author":2,"featured_media":586,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[223],"tags":[],"_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/68"}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":9,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":1188,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/68\/revisions\/1188"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media\/586"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}