13-7 Runs Test for Randomness 689 Testing for Randomness Above and Below the Mean or Median Some sequential data are naturally categorized according to two characteristics, such as a sequence of male and female genders from consecutive births. (See Example 1.) Additionally, we can also test for randomness in the way numerical data fluctuate above or below a mean or median. To test for randomness above and below the median, for example, use the sample data to find the value of the median, then replace each individual value with the letter A if it is above the median and replace it with B if it is below the median. Delete any values that are equal to the median. (It is helpful to write the A’s and B’s directly above or below the numbers they represent because this makes checking easier and also reduces the chance of having the wrong number of letters.) After finding the sequence of A and B letters, we can proceed to apply the runs test as described earlier. (See Example 2.) Economists use the runs test for randomness above and below the median to identify trends or cycles. An upward economic trend would contain a predominance of B’s at the beginning and A’s at the end, so the number of runs would be very small. A downward trend would have A’s dominating at the beginning and B’s at the end, with a small number of runs. A cyclical pattern would yield a sequence that systematically changes, so the number of runs would tend to be large. Small Sample: Political Parties of Presidents EXAMPLE 1 Listed below are the political parties of the past 15 presidents of the United States (as of this writing). The letter R represents a Republican president and the letter D represents a Democratic president. Use a 0.05 significance level to test for randomness in the sequence. RDDRDDRRDRRDRDR YOUR TURN. Do Exercise 5 “Law Enforcement Fatalities.” SOLUTION REQUIREMENT CHECK (1) The data are arranged in order. (2) Each data value is categorized into one of two separate categories (Republican>Democrat). The requirements are satisfied. We will follow the procedure summarized in Figure 13-5. The sequence of two characteristics (Republican>Democrat) has been identified. We must now find the values of n1, n2, and the number of runs G. The sequence is shown below with spacing adjusted to better identify the different runs. R ()* DD ()* R ()* DD ()* RR ()* D ()* RR ()* D ()* R ()* D ()* R ()* 1st run 2nd run 3rd run 4th run 5th run 6th run 7th run 8th run 9th run 10th run 11th run The above display shows that there are 8 Republican presidents and 7 Democratic presidents, and the number of runs is 11. We represent those results with the following notation. n1 = number of Republican presidents = 8 n2 = number of Democratic presidents = 7 G = number of runs = 11 Because n1 … 20 and n2 … 20 and the significance level is a = 0.05, the test statistic is G = 11 (the number of runs), and we refer to Table A-10 to find the critical values of 4 and 13. Because G = 11 is neither less than or equal to the lower critical value of 4, nor is it greater than or equal to the upper critical value of 13, we do not reject randomness. There is not sufficient evidence to reject randomness in the sequence of political parties of recent presidents. Based on the given data, it appears that Republicans and Democrats become presidents in random order.
RkJQdWJsaXNoZXIy NjM5ODQ=