{"id":69,"date":"2018-06-11T09:56:00","date_gmt":"2018-06-11T07:56:00","guid":{"rendered":"https:\/\/kindsonthegenius.com\/blog\/2018\/06\/11\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test\/"},"modified":"2020-08-22T20:20:57","modified_gmt":"2020-08-22T18:20:57","slug":"how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test\/","title":{"rendered":"How to Perform Wald-Wolfowitz Test &#8211; Testing for Homogeneity with Run Test"},"content":{"rendered":"<p>Today, we are going to go through the steps of performing the Wald-Wolfowitz test (run test). Remember, the easiest way to understand hypothesis testing is to solve an example. So instead of boring you with explanations, we would solve an example together. I would be explaining as we solve.<\/p>\n<p><b>Content<\/b><\/p>\n<ol>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#t1\">What is Wald-Wolfowitz Test?<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#t2\">Formula for the Wald-Wolfowitz Test?<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#t3\">Exercise 1<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#t4\">Solution Steps<\/a><\/li>\n<\/ol>\n<ul style=\"margin-left: 40px;\">\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#s1\">Step 1:\u00a0 State the null and alternate hypothesis<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#s2\">Step 2:\u00a0 Merge and sort the values in order<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#s3\">Step 3: Calculate the Mean<\/a><\/li>\n<li><a href=\"https:\/\/kindsonthegenius.com\/blog\/how-to-perform-wald-wolfowitz-test-testing-for-homogeneity-with-run-test#s4\">Step 4: Calculate the Variance<\/a><\/li>\n<li><a href=\"#s5\">Step 5: Calculate Z statistic<\/a><\/li>\n<li><a href=\"#s6\">Step 6: Draw your conclusion<\/a><\/li>\n<\/ul>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<p>&nbsp;<\/p>\n<h4 id=\"t1\">1. What is Wald-Wolfowitz Test?<\/h4>\n<p>Wald-Wolfowitz Test (also called Wald-Wolfowitz run test) is a non-parametric hypothesis test used to test the randomness of a two-valued data sequence. It tests to see if the sequence are mutually independent.<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"t2\">2. Formula for Wald-Wolfowitz Test<\/h4>\n<p>The three formulas for the Wald-Wolfowitz run test\u00a0 are given below:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-qAoN4VZh0qg\/Wx4nhctZlzI\/AAAAAAAAB60\/bYfLBpE-cJYlQiUf88s9PyC5ynFWNLd4wCLcBGAs\/s1600\/Wald-Wolfowitz.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/4.bp.blogspot.com\/-qAoN4VZh0qg\/Wx4nhctZlzI\/AAAAAAAAB60\/bYfLBpE-cJYlQiUf88s9PyC5ynFWNLd4wCLcBGAs\/s200\/Wald-Wolfowitz.jpg\" width=\"172\" height=\"73\" border=\"0\" data-original-height=\"107\" data-original-width=\"251\" \/><\/a><\/div>\n<p>where the mean is given by the formula<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-SKCKTaGF0RU\/Wx4oZsdDb3I\/AAAAAAAAB7A\/xLxAOAKAlnEPqljHHk6S7kqUZ_1OIV-ZgCLcBGAs\/s1600\/Mean.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/2.bp.blogspot.com\/-SKCKTaGF0RU\/Wx4oZsdDb3I\/AAAAAAAAB7A\/xLxAOAKAlnEPqljHHk6S7kqUZ_1OIV-ZgCLcBGAs\/s320\/Mean.jpg\" width=\"226\" height=\"70\" border=\"0\" data-original-height=\"108\" data-original-width=\"350\" \/><\/a><\/div>\n<p>and the variance is given by the formula<\/p>\n<div style=\"clear: both; text-align: center;\"><\/div>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-C32KEWw7Jhk\/Wx4qdIesEpI\/AAAAAAAAB7M\/-kHm967PjiUU4cHXlP6r3wZUAZyWupNrwCLcBGAs\/s1600\/Variance.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/3.bp.blogspot.com\/-C32KEWw7Jhk\/Wx4qdIesEpI\/AAAAAAAAB7M\/-kHm967PjiUU4cHXlP6r3wZUAZyWupNrwCLcBGAs\/s400\/Variance.jpg\" width=\"324\" height=\"59\" border=\"0\" data-original-height=\"110\" data-original-width=\"601\" \/><\/a><\/div>\n<div><\/div>\n<div><\/div>\n<p><b>Note<\/b>: Variance is the square of the standard deviation. So we calculated variance. To get the standard deviation, we must take the square root of the variance.<\/p>\n<p>Let&#8217;s now solve an example!<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"t3\">3. Example 1<\/h4>\n<p><em>There are two IVM(Innoson Vehicle Manufacturers) buses, one with 48 passengers,\u00a0 and another with 38 passengers.<\/em><br \/>\n<em>Let X and Y denote the number of miles travelled per day for the 48-passenger and 38-passenger buses respectively. Innoson would like to test the equality of the two distributions.<\/em><br \/>\n<em>That is, if:<\/em><\/p>\n<p><em>H<sub>0<\/sub>: F(z) = G(z)<\/em><\/p>\n<p><em>The company observed the following data on a random sample of n1 = 10 buses carrying 48 passengers and n2 = 11 buses carying 38 passengers.<\/em><\/p>\n<p><em>X: 104 253 300 308 315 323 331 396 414 452 <\/em><br \/>\n<em>Y:\u00a0 184 196 197 248 260 279 355 386 393 432 450<\/em><\/p>\n<p><em>Using normal approximation to R, conduct a Wald-Wolfowitz test at 0.05 level of significance<\/em><\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"t4\">4. Solution<\/h4>\n<p>We would solve this problem step by step.<\/p>\n<p>&nbsp;<\/p>\n<h5 id=\"s1\">Step 1: State the null and the alternate hypothesis and rejection criteria<\/h5>\n<p>H<sub>0<\/sub>: F(z) = G(z)<br \/>\nH<sub>1<\/sub>: F(z) = G(z)<\/p>\n<p>Rejection criteria: Reject the null hypothesis if<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/4.bp.blogspot.com\/-wCzqfD7xXHQ\/Wx42-o35KdI\/AAAAAAAAB7Y\/1Y2PgnnAsFEQfaoh5IPxotG_3iNsrbDaACLcBGAs\/s1600\/Rejection%2Bcriteria.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/4.bp.blogspot.com\/-wCzqfD7xXHQ\/Wx42-o35KdI\/AAAAAAAAB7Y\/1Y2PgnnAsFEQfaoh5IPxotG_3iNsrbDaACLcBGAs\/s200\/Rejection%2Bcriteria.jpg\" width=\"145\" height=\"58\" border=\"0\" data-original-height=\"81\" data-original-width=\"203\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<h5 id=\"s2\">Step 2: Merge the two lists and sort in ascending order<\/h5>\n<p>104\u00a0 <span style=\"color: #cc0000;\"><span style=\"color: red;\">184\u00a0 196\u00a0 197\u00a0 248<\/span>\u00a0<\/span> 253\u00a0 <span style=\"color: red;\">260\u00a0 279<\/span>\u00a0 300\u00a0 308\u00a0 315\u00a0 331\u00a0 <span style=\"color: red;\">355\u00a0 386\u00a0 393\u00a0<\/span> 394\u00a0 414\u00a0<span style=\"color: red;\"> 432\u00a0 450\u00a0<\/span> 452<\/p>\n<p>&nbsp;<\/p>\n<h5 id=\"s3\">Step 3: Count the number of runs: R, n<sub>1<\/sub> and n<sub>2<\/sub><\/h5>\n<p>Number of runs R = 9<br \/>\nn1 = 10<br \/>\nn2 =\u00a0 11<\/p>\n<p>&nbsp;<\/p>\n<h5 id=\"s4\">Step 4: Calculate the mean<\/h5>\n<p>We calculate the mean using the formula and we have the results below<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/3.bp.blogspot.com\/-boz92sdE2YE\/Wx458V8nwOI\/AAAAAAAAB7k\/B5s_4NL3T1cJAH4gOIaFCE5Thez0K1RIgCLcBGAs\/s1600\/Mean%2BCalculation.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/3.bp.blogspot.com\/-boz92sdE2YE\/Wx458V8nwOI\/AAAAAAAAB7k\/B5s_4NL3T1cJAH4gOIaFCE5Thez0K1RIgCLcBGAs\/s320\/Mean%2BCalculation.jpg\" width=\"217\" height=\"320\" border=\"0\" data-original-height=\"511\" data-original-width=\"347\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<h5 id=\"s5\">Step 5: Calculate the variance<\/h5>\n<p>We calculation the variance using the calculation steps below<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/2.bp.blogspot.com\/-W2m54VPUWH0\/Wx47IypzmEI\/AAAAAAAAB7w\/yJvoBBu5Ci89NN4_bsPT3RdCpyDPALt_QCLcBGAs\/s1600\/Variance%2BCalculation.jpg\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/2.bp.blogspot.com\/-W2m54VPUWH0\/Wx47IypzmEI\/AAAAAAAAB7w\/yJvoBBu5Ci89NN4_bsPT3RdCpyDPALt_QCLcBGAs\/s320\/Variance%2BCalculation.jpg\" width=\"320\" height=\"294\" border=\"0\" data-original-height=\"610\" data-original-width=\"663\" \/><\/a><\/div>\n<p>&nbsp;<\/p>\n<h5 id=\"s6\">Step 6: Calculate Z<\/h5>\n<p>We calculate the value of Z following the formula below:<\/p>\n<div style=\"clear: both; text-align: center;\"><a style=\"margin-left: 1em; margin-right: 1em;\" href=\"https:\/\/1.bp.blogspot.com\/-Sthv8i8c2bY\/Wx49VjwJUYI\/AAAAAAAAB78\/gp0s5LN7AmQA8yKdvAnj0Vf7KW_wVYy0ACLcBGAs\/s1600\/Z%2Bstatistic%2Bcalculation.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/1.bp.blogspot.com\/-Sthv8i8c2bY\/Wx49VjwJUYI\/AAAAAAAAB78\/gp0s5LN7AmQA8yKdvAnj0Vf7KW_wVYy0ACLcBGAs\/s200\/Z%2Bstatistic%2Bcalculation.jpg\" width=\"138\" height=\"167\" border=\"0\" data-original-height=\"374\" data-original-width=\"309\" \/><\/a><\/div>\n<p><b>Note<\/b>: Used 9.5 instead of 9\u00a0 because we applied half-unit correction for continuity<\/p>\n<p>&nbsp;<\/p>\n<h4 id=\"s7\">Step 7: Draw your conclusion<\/h4>\n<p>We fail to reject the null hypothesis at the 0.05 level because the P value is greater than 0.05. This means that there is not sufficient evidence at 0.05 level to conclude that the two distribution functions are not equal.<\/p>\n<p>&nbsp;<\/p>\n<p>Thanks for your effort in learning statistics. If you have any challenge, let me know in the comment box below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today, we are going to go through the steps of performing the Wald-Wolfowitz test (run test). Remember, the easiest way to understand hypothesis testing is &hellip; <\/p>\n","protected":false},"author":2,"featured_media":591,"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\/69"}],"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=69"}],"version-history":[{"count":11,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions"}],"predecessor-version":[{"id":1196,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/posts\/69\/revisions\/1196"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media\/591"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/media?parent=69"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/categories?post=69"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/blog\/wp-json\/wp\/v2\/tags?post=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}