<<

Nonparametric 14 Overview

14.1 Introduction to Nonparametric Statistics 14.2 14.3 Wilcoxon Signed Rank Test for Matched-Pair 14.4 Wilcoxon Rank Sum Test for Two Independent Samples 14.5 Kruskal-Wallis Test 14.6 Test 14.7 Runs Test for

Chapter 14 Formulas and Vocabulary Chapter 14 Review Exercises Chapter 14 Quiz

Wavebreakmedia/Shutterstock

Larose_3e_ch14.indd 1 10/30/15 11:03 AM Has Gas Mileage Increased? case study More than ever, the increasing price of gasoline has made consumers aware of the gas mileage of their cars, trucks, and SUVs. Has the population median gas mileage improved from 2007 to 2014? We attack this problem using the sign test in Section 14.2. Then, in Section 14.6, we test whether a rank correlation exists between the miles per gallon of the vehicles in 2007 and 2014.

The Big Picture Where we are coming from and where we are headed . . .

●● In earlier chapters, we learned how to perform hypothesis tests for population , such as the population m or the population proportion p. ●● Here, in Chapter 14, we learn about a family of hypothesis tests known as nonparametric hypothesis tests, whose conditions are similar to those in earlier chapters but less stringent. Congratulations on getting this far in your discovery of the field of statistics! Your data analytic skills will enhance your marketability in the twenty-first century workplace. Best of luck in the future!

14-2

Larose_3e_ch14.indd 2 10/30/15 11:03 AM 14-3 Chapter 14 Nonparametric Statistics

14.1 Introduction to Nonparametric Statistics

Objectives By the end of this section, I will be able to . . . 1 Explain what a nonparametric hypothesis test is, and why we use it. 2 Describe what is meant by the of a nonparametric test.

1 What Is a Nonparametric Hypothesis Test? In Chapters 9, 10, 12, and 13, we learned how to perform hypothesis tests for popula- tion parameters, such as the population mean m or the population proportion p. To perform each of these parametric hypothesis tests, certain conditions need to be sat- isfied. For example, Section 9.4 showed that the required condition of a t test for the population mean m, when we have a small sample size, is that the population be nor- mally distributed. However, what if we need to perform a t test with a small sample and the population is not normal? We turn to one of the nonparametric hypothesis tests, the subject of this chapter.

Parametric hypothesis tests are used to test claims about a population , such as the population mean m or the population proportion p. Often, parametric tests require that the population follow a particular distribution, such as the normal distribution. Nonparametric hypothesis tests, also called distribution-free hypothesis tests, generally have fewer required conditions. In particular, nonparametric tests do not require the population to follow a particular distribution, such as the normal distribution.

Recall that we should not perform a parametric hypothesis test (such as the t test for the population mean m) if the conditions are not met. Why, then, would a data ana- lyst take a chance and use a parametric test when the conditions may not be satisfied? The answer is that there are advantages and disadvantages to each method. Advantages of Nonparametric Hypothesis Tests 1. Nonparametric methods may be used on a greater variety of data because they require fewer conditions than their parametric counterparts. For this reason, it is less likely that nonparametric hypothesis tests will be performed inappropriately. 2. Nonparametric methods can be applied to categorical (qualitative) data, such as class standing (freshman, sophomore, junior, or senior). 3. For certain nonparametric procedures, the manual computations tend to be easier than their parametric counterparts. (However, see Disadvantage 3 below.)

Disadvantages of Nonparametric Hypothesis Tests 1. Nonparametric hypothesis tests are less efficient than parametric tests. This that, for a given level of significance a, nonparametric tests require a larger sample size to reject a null hypothesis (more on efficiency below). 2. Nonparametric tests replace the actual data values with either signs (positive or negative) or ranks. Thus, the exact data values are wasted. For example, in the nonparametric sign test performed in Section 14.2, the actual data values are discarded and replaced with positive or negative signs. 3. Because the use of nonparametric hypothesis tests is less widespread, graphing calculators and statistical software often do not have dedicated procedures for these tests.

Larose_3e_ch14.indd 3 10/30/15 11:03 AM 14.1 Introduction to Nonparametric Statistics 14-4

2 The Efficiency of a Nonparametric Hypothesis Test In general, parametric tests are more efficient than corresponding nonparametric tests. The efficiency of a nonparametric test is used to compare it with its corresponding parametric test.

The efficiency of a nonparametric hypothesis test is defined as the ratio of the sample size required for the corresponding parametric test to the sample size required for the nonparametric test, in order to achieve the same result (such as correctly rejecting the null hypothesis). The efficiency ratings are reported on the assumption that required conditions for both the parametric and the nonparametric tests have been met.

For example, in Section 14.3 we will learn about the Wilcoxon signed rank test for matched-pair data. The corresponding parametric test is the t test for the difference in means for dependent samples that we learned about in Section 10.1. If a certain result is achieved by using the Wilcoxon signed rank test with a sample size of 100, an equivalent result may be obtained using the dependent-samples t test with a sample size of 95. Thus, the eff iciency of the Wilcoxon signed rank test (assuming that the conditions have been met for both tests) is 95 efficiency 5 5 0.95 100 Thus, the Wilcoxon signed rank test is fairly eff icient compared with the dependent- samples t test. On the other hand, the sign test that we will learn about in Section 14.2 has an efficiency of only 0.63, meaning that the corresponding dependent-samples t test requires a sample size of only 63 to achieve the same result that the sign test achieves with a sample size of 100. Thus, the sign test is less efficient than the Wilcoxon signed rank test. However, as we shall see, the conditions for performing the Wilcoxon signed rank test are stricter than for performing the sign test. As is often the case, there is a trade- off between the efficiency of a test and the conditions required for performing the test. Table 1 contains the efficiency ratings of the nonparametric (distribution-free) hypothesis tests that we will learn about in this chapter. The efficiency ratings are cal- culated under the assumption that the conditions for both the parametric and the non- parametric tests have been met.

Table 1 Efficiency of nonparametric tests compared with parametric tests Nonparametric Section Situation Parametric test test Efficiency 14.2 Matched pairs t test or Z test Sign test 0.63 (dependent samples) 14.3 Matched pairs t test or Z test Wilcoxon signed 0.95 (dependent samples) rank test 14.4 Two independent t test or Z test Wilcoxon rank 0.95 samples sum test 14.5 Several independent Analysis of Kruskal-Wallis 0.95 samples (F test) test 14.6 Correlation Linear correlation Rank correlation 0.91 Note: A data analyst could perform test both the parametric test and the 14.7 Randomness No parametric test Runs test — nonparametric test and leave it up to the client or the end user of the data to determine whether the In each case, the parametric test is more efficient than its nonparametric counterpart, greater efficiency of the parametric though, of course, this greater efficiency comes at the cost of more stringent required test is worth the cost of the more conditions for the parametric tests. Thus, when the conditions for the parametric test are stringent required conditions. met, it is preferable to perform the parametric test as opposed to the nonparametric test.

Larose_3e_ch14.indd 4 10/30/15 11:03 AM 14-5 Chapter 14 Nonparametric Statistics

Section 14.1 Summary 1. Nonparametric tests do not require the population to 2. The efficiency of a nonparametric hypothesis test is follow a particular distribution, such as the normal defined as the ratio of the sample size required for the distribution. Because of this, nonparametric hypothesis tests corresponding parametric test to the sample size are often called distribution-free hypothesis tests. There are required for the nonparametric test, in order to achieve advantages and disadvantages to using nonparametric tests the same result (such as correctly rejecting the null instead of parametric tests. hypothesis).

Section 14.1 Exercises Clarifying the Concepts 5. What are the advantages to using nonparametric 1. What is a parameter? Explain why the hypothesis tests hypothesis tests as opposed to using parametric hypothesis from Chapters 9, 10, 12, and 13 are called parametric tests? (p. 14-3) hypothesis tests. (p. 14-3) 6. What are the disadvantages to using nonparametric 2. What is another term for nonparametric hypothesis tests? hypothesis tests? (p. 14-3) (p. 14-3) 7. Explain what is meant by “efficiency.” (p. 14-4) 3. Explain the difference between nonparametric tests and 8. True or false: There is a trade-off between the parametric tests. (p. 14-3) efficiency of a test and the conditions required for 4. Which types of tests have more stringent conditions, performing the test. (p. 14-4) parametric or nonparametric tests? (p. 14-3)

14.2 Sign Test

Objectives By the end of this section, I will be able to . . . 1. Perform the sign test for a single population median. 2. Perform the sign test for matched-pair data from two dependent samples. 3. Perform the sign test for binomial data.

1 Sign Test for a Single Population Median In Section 9.4, we learned how to perform the one-sample t test for the population mean m, which is a parametric test requiring either a normal population or a large sample (n $ 30). However, what do we do when we have neither a normal popula- tion nor a large sample? We could use either the sign test for the population median, which we learn in this section, or the signed rank test, which we learn in Section 14.3.

The sign test is a nonparametric hypothesis test in which the original data are transformed into plus or minus signs. The sign test may be conducted for (a) a single population median, (b) matched-pair data from two dependent samples, or (c) binomial data.

The following example illustrates a situation where we want to perform a ­hypothesis test, but the conditions are not met for performing the usual parametric hypothesis test.

Larose_3e_ch14.indd 5 10/30/15 11:03 AM 14.2 Sign Test 14-6

Example 1 Conditions for parametric test are not met Since 1940, the National Weather Service has reported the annual number of ­hurricane-related deaths in the United States. Here is a random sample size n 5 8 from the population of yearly hurricane deaths:

Year 1959 1963 1974 1988 1999 2001 2005 2010 Deaths 24 11 1 9 19 24 1016 13 Chad Purser/E+/Getty We are interested in testing whether the population mean number of hurricane-related deaths is less than 25. Figure 1 is the normal probability plot for the data. Determine 99 whether the conditions required for the one-sample t test are met. 95 90 80 70 60 50 Solution 40

Percent 30 20 The t test may be used if the population is normal or if the sample size is at least 30. 10 5 The normal probability plot shows two data values outside the bounds, indicating that 1 −1000 −500 0 500 1000 1500 the data are not normally distributed. Also, the sample of size n 5 8 is not at least 30. Hurricane-related deaths Therefore, the conditions for performing the t test for the population mean are not met. (The unusual data value of 1016 hurricane-related deaths for 2005 is the result of Figure 1 Normal probability plot for the hurricane-related deaths data. Hurricanes Katrina and Rita.)

Fortunately, however, the required conditions for performing the sign test for the population median are less stringent than those for the t test for the population mean. The sign test requires only that the sample data have been randomly selected. It is not required that the population be normally distributed. It should be noted, however, that the sign test is a hypothesis test for the population median, not the population mean. The key concept for performing the sign test for the median is the following: each of the data values is converted to either a plus sign (1) or a minus sign (2). If there is a preponderance of plus signs to minus signs, or vice versa (depending on the form of the hypothesis test), then this is evidence against the null hypothesis.

Example 2 Changing the data values to plus or minus signs Suppose that we are interested in testing whether the population median M number of hurricane-related deaths per year is less than 50. a. Write the null and alternative hypotheses for this test. b. Change each data value that is less than 50 to a minus sign (2), and change each data value that is greater than 50 to a plus sign (1). Ignore any data values that are equal to 50. The sample size n is the total number of plus signs and minus signs. Solution a. We may write the hypotheses as

H0 : M 5 50 versus Ha : M , 50 where M represents the population median number of hurricane-related deaths per year.

Larose_3e_ch14.indd 6 10/30/15 11:03 AM 14-7 Chapter 14 Nonparametric Statistics

b. As shown here, we have 7 minus signs and 1 plus sign, so that our sample size is 7 1 1 5 8.

Year 1959 1963 1974 1988 1999 2001 2005 2010 Deaths 24 11 1 9 19 24 1016 13 Sign 2 2 2 2 2 2 1 2

Recall that the median of a data set is the 50th and splits the data set into equal halves. Thus, if the null hypothesis were true, we would expect about half of the sample data values to lie above the median and half below, so that about half of the signs would be plus signs and about half would be minus signs. Now, only 1 of the 8 signs in this data set is a plus sign, which may indicate evidence against the null hypothesis. However, to make sure, we need to perform the sign test for the population median. The procedure for the sign test for the population median is summarized as follows.

Sign Test for the Population Median M The only requirement for performing the sign test for the population median M is for the sample data to have been randomly selected. It is not necessary to have a population that is normally distributed. Step 1 state the hypotheses. Choose one of the forms in Table 2.

Table 2 Hypotheses for the sign test for the population median M Null hypothesis Type of test H : M 5 M Right-tailed test 0 0 Ha : M . M0 H : M 5 M Left-tailed test 0 0 Ha : M , M0 H : M 5 M Two-tailed test 0 0 Ha : M Þ M0

Note: M0 is the value of the population median M for which a claim is being made.

Step 2 Find the critical value and state the rejection rule. ● Small-Sample Case (sample size n # 25): Use Appendix Table I. Choose the column with the appropriate level of significance (a) and the applicable one-tailed or two-tailed test. Then select the row with the appropriate sample size n 5 number of pluses and

minuses. The number in that row and column is your critical value Scrit. The rejection rule # is to reject H0 if Sdata Scrit. ● Large-Sample Case (sample size n . 25): Use Appendix Table C, the standard normal table. The Z critical value for this sign test is always found in the left tail of the

standard normal distribution, so that Zcrit is always less than 0. For a left-tailed test or a a right-tailed test, the critical value Zcrit is the value of Z with area to the left of it. For a a two-tailed test, the critical value Zcrit is the value of Z with area /2 to the left of it.

Table 4 in Chapter 9 on page 500 contains values of Zcrit for some common values a # of . The rejection rule is to reject H0 if Zdata Zcrit. Step 3 Find the value of the test .

● Small-Sample Case (n # 25): Use Table 3 to find the test statistic Sdata.

Table 3 Finding Sdata

Type of test Test statistic Sdata

Right-tailed test Sdata 5 number of minus signs

Left-tailed test Sdata 5 number of plus signs

Two-tailed test Sdata 5 number of minus signs or plus signs, whichever is smaller

Larose_3e_ch14.indd 7 10/30/15 11:03 AM 14.2 Sign Test 14-8

● Large-Sample Case (n . 25): First use Table 3 to find Sdata, and then calculate the test

statistic Zdata: n _S 1 0.5+ 2 data 2 Z 5 data Ïn 2 Step 4 state the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule. A generic

interpretation is as follows. If H0 is rejected, then state, “Evidence exists that [whatever Ha

says].” If H0 is not rejected, then state, “There is insufficient evidence that [whatever Ha says].”

Example 3 Small-sample sign test for the population median For the data from Example 2, use the sign test to determine whether the population median M number of hurricane-related deaths per year is less than 50, using level of significance a 5 0.05. Solution From Example 1, we know that the data come from a random sample, which is the only condition for conducting the sign test. Thus, we may proceed. Step 1 State the hypotheses. The hypotheses are

H0 : M 5 50 versus Ha : M < 50 where M represents the population median number of hurricane-related deaths per year. Step 2 Find the critical value and state the rejection rule. The total number of plus signs and minus signs is n 5 7 1 1 5 8, which is not greater than 25, so we use the small-sample case. We have a one-tailed test, with a 5 0.05 and n 5 8, which gives

us Scrit 5 1 (Figure 2). The rejection rule is to reject H0 if Sdata # 1.

a 0.005 0.01 0.025 0.05 (one tail) (one tail) (one tail) (one tail) 0.01 0.02 0.05 0.10 n (two tails) (two tails) (two tails) (two tails) 1 * * * * 2 * * * * 3 * * * * 4 * * * * 5 * * * 0 6 * * 0 0 7 * 0 0 0 8 0 0 0 1

Figure 2 Using Appendix Table I to find the critical value Scrit. Step 3 Find the value of the test statistic. We have a left-tailed test, and so, from Table 3, our test statistic is

Sdata 5 number of plus signs 5 1

Larose_3e_ch14.indd 8 10/30/15 11:03 AM 14-9 Chapter 14 Nonparametric Statistics

Step 4 State the conclusion and the interpretation. The value of our test statistic NOW YOU CAN DO is Sdata 5 1, which is # 1, so we reject H0. Evidence exists that the population median Exercises 9–16. number of hurricane-related deaths is less than 50 per year.

Example 4 Large-sample sign test for the population median using technology The data set Nutrition (on the text website) contains information about 961 food nutrition items. The variable calories states the number of calories per serving for each food item. Consider these 961 food items to be a random sample of the population of all food items. Test whether the population median number of calories differs from 120, using level of significance a 5 0.10. Solution The 961 food items are a random sample from the population of all food items, so the conditions for performing the sign test for the population median are met.

Step 1 State the hypotheses. The key words “differs from” indicate that we have a two-tailed test. The answer to the question “Differs from what?” gives us the value of

M0 5 120.

H0 : M 5 120 versus Ha : M Þ 120 where M represents the population median calories per food item.

Step 2 Find the critical value and state the rejection rule. We have a large sample here. Among the 961 values, there are 18 that are equal to the proposed population

median M0 5 120. We ignore values that do not have a sign associated with them, so

n 5 961 2 18 5 943. We are given the level of significance a 5 0.10, so our Zcrit 5

21.645. We will reject H0 if Zdata # 21.645. Step 3 Find the value of the test statistic. We use the instructions provided in the Step-by-Step Technology Guide at the end of this section. Figure 3 shows the Minitab results from the sign test for the population median. The value for “Below” is the number of minus signs, and the value for “Above” is the number of plus signs. So, we have 448 minus signs and 495 plus signs. Thus, the sample

size is n 5 448 1 495 5 943. From Table 3, Sdata 5 the number of minus signs

or plus signs, whichever is smaller. Thus, Sdata 5 448. We then calculate the test

statistic Zdata:

n 943 _S 1 0.5+ 2 s448 1 0.5d 2 data 2 2 Z 5 5 < 21.498 data Ïn Ï943 2 2

Sign Test for Median: Calories Caution The value of N reported ! by Minitab does not equal Sign test of median = 120.0 versus not = 120.0 the actual sample size N Below Equal Above P Median used for the sign test. To find n, we Calories 961 448 18 495 0.1341 125.0 need to subtract the number of data values equal to . M0 FIGURE 3 Minitab output for the sign test for the population median.

Larose_3e_ch14.indd 9 10/30/15 11:03 AM 14.2 Sign Test 14-10

Step 4 State the conclusion and the interpretation. Because Zdata ≈ 21.498 is not

# Zcrit 5 21.645, we do not reject H0. The evidence is insufficient that the population median number of calories differs from 120 calories per serving. The Minitab output NOW YOU CAN DO shows that the sample median equals 125 calories, which is a little bit different from

Exercises 17–20. M0 5 120, but the difference is not statistically significant.

2 Sign Test for Matched-Pair Data from Two Dependent Samples In Section 10.1, we performed a hypothesis test for the population mean of the differ- ence between two dependent samples. Recall that two samples are dependent when the subjects in the first sample determine the subjects in the second sample. For example, suppose we are interested in comparing the heights of girl-boy fraternal twins. Select- ing a girl twin for the first sample automatically results in the selection of her twin brother for the second sample. The boy-girl pairs are called matched-pair samples, or paired samples. The paired-sample t test we learned in Section 10.1 required either that the popula- tion of differences be normal or that the sample size of the differences be at least 30.

Here, we learn the sign test for the population median of the differences, Md, which requires only that the sample data be randomly selected. The hypotheses for the population median of the differences are given in Table 4.

Table 4 Hypotheses for the sign test for the population median of the differences Md Alternative

Null hypothesis hypothesis Type of test Test statistic Sdata H : M 5 0 Right-tailed test S 5 number of minus signs 0 d Ha : Md . 0 data H : M 5 0 Left-tailed test S 5 number of plus signs 0 d Ha : Md , 0 data H : M 5 0 Two-tailed test S 5 number of minus signs or 0 d Ha : Md Þ 0 data plus signs, whichever is smaller

We may use the same methods for the matched-pair sign test that we used for the sign test for a single population median, with the following modifications: 1. For each matched pair, subtract the value of the second variable from the value of the first variable. 2. We are interested only in the sign of the difference found in Step 1, not the difference itself. 3. Exclude ties. That is, omit any matched pairs in which the values for both variables are equal. We illustrate the sign test for the population median of the differences using the follow- ing example.

Example 5 Sign test for matched-pair data from two dependent samples The National Center for Educational Statistics publishes the results from the Trends in International Math and Science Study (TIMSS). The following table contains the 2007 and 2011 average eighth-grade mathematics scores for a random sample of 12 coun- tries. Test whether the population median math score M has decreased from 2007 to 2011, using a 5 0.05.

Larose_3e_ch14.indd 10 10/30/15 11:03 AM 14-11 Chapter 14 Nonparametric Statistics

Difference Country 2007 2011 (2011 2 2007) Sign Korea 597 613 116 1 Singapore 593 611 118 1 United States 508 509 11 1 Lithuania 506 502 24 2 Hungary 517 505 212 2 Romania 461 458 23 2 Russia 512 539 127 1 Australia 496 505 19 1 Indonesia 397 386 211 2 Norway 469 475 16 1 Sweden 491 484 27 2 Malaysia 474 440 234 2

Solution The countries represent a random sample of matched-pair data, so the condition for performing the sign test for the population median of the differences is met. Step 1 State the hypotheses. We have a left-tailed test:

H0 : Md 5 0 versus Ha : Md < 0

where Md represents the population median of the differences in eighth-grade math scores from 2007 to 2011. Step 2 Find the critical value and state the rejection rule. The sample size is the sum of the number of plus signs and minus signs: n 5 6 1 6 5 12. Because n # 25, we use the small-sample case. To find the critical value, we use Appendix Table I. We

have a one-tailed test, with a 5 0.05 and n 5 12, which gives us Scrit 5 2. The rejection

rule is to reject H0 if Sdata # 2.

Step 3 Find the value of the test statistic. From Table 3, we have Sdata 5 the number of plus signs 5 6. Step 4 State the conclusion and the interpretation. Because S 5 6 is not # 2, NOW YOU CAN DO data we do not reject H0. There is insufficient evidence that the population median eighth- Exercises 21–24. grade math score has decreased from 2007 to 2011.

The sign test may also be applied using the p-value method and technology.

p-Value Method for Conducting the Sign Test Step 1 state the hypotheses. Step 2 Find the p-value using technology. Step 3 state the conclusion and the interpretation. # a If the p-value is the level of significance , reject H0; otherwise, do not reject H0.

Example 6 The sign test using the p-value method The following data set represents the education receipts (such as taxes) and the educa- education tion expenditures for a random sample of 10 states. Test, using level of significance a 5 0.05, whether the population median of the differences (receipts 2 expenditures) per state differs from zero.

Larose_3e_ch14.indd 11 10/30/15 11:03 AM 14.2 Sign Test 14-12

Receipts Expenditures State ($ millions) ($ millions) Difference Florida 28,208 26,832 1,376 California 73,272 68,045 5,227 New Jersey 20,032 19,938 94 Alabama 7,000 6,540 460 Minnesota 10,280 10,191 89 Indiana 11,996 11,315 681 Maine 2,458 2,458 0 New York 41,800 42,895 21,095 Mississippi 4,341 3,945 396 Ohio 24,259 21,237 3,022

Source: National Education Association. Solution The states represent a random sample of matched-pair data. We may thus proceed with the sign test for the population median of the differences. Step 1 State the hypotheses.

H0 : Md 5 0 versus Ha : Md Þ 0

where Md represents the population median of the differences in education receipts minus expenditures per state. Step 2 Find the p-value using technology. We use the instructions provided in the Step-by-Step Technology Guide at the end of this section. The Minitab output shown in Figure 4 and the JMP output shown in Figure 5 provide the p-value for this hypothesis test: p-value 5 0.0391. Note that one state (Maine) has education receipts equal to expenditures, so that the difference for Maine equals zero. Maine is thus omitted, and the p-value is based on the other nine states left in the sample.

FIGURE 4 Minitab output for the sign test for the FIGURE 5 JMP output for the sign population median. test for the population median.

Step 3 State the conclusion and the interpretation. The p-value 0.0391 is less than

the level of significance a 5 0.05, so we reject H0. Evidence exists that the population median difference between education receipts and expenditures differs from zero.

3 Sign Test for Binomial Data In Section 9.5, we performed the Z test for the population proportion of successes p. Here, we learn about the sign test for binomial data, which is a special case of the Z test for the population proportion for p 5 0.5. Recall that a variable is binomial if it takes only two possible values, such as on/off, up/down, in/out. For example, the following example

Larose_3e_ch14.indd 12 10/30/15 11:03 AM 14-13 Chapter 14 Nonparametric Statistics

looks at the numbers of spam emails and nonspam emails processed by a university spam filter. When using the sign test, spam emails are represented by plus (1) signs, and nonspam emails are represented by minus (2) signs. Table 5 contains the hypoth- eses for the sign test for binomial data. Note that the hypothesized population propor-

tion is always p0 5 0.5.

Table 5 Hypotheses for the sign test for binomial data Alternative

Null hypothesis hypothesis Type of test Test statistic Sdata 5 5 H0 : p 0.5 Ha : p . 0.5 Right-tailed test Sdata number of minus signs 5 5 H0 : p 0.5 Ha : p , 0.5 Left-tailed test Sdata number of plus signs 5 5 H0 : p 0.5 Ha : p Þ 0.5 Two-tailed test Sdata number of minus signs or plus signs, whichever is smaller

We use the same methods for the sign test for binomial data that we used for the sign test for a single population median. However, only the large-sample case is used (n . 25), because only when the sample size is large does the apply.

Example 7 Sign test for binomial data The National Center for Health Statistics reports that 50% of Americans take at least one prescription drug per month. Suppose that a random sample of 100 Americans shows 67 who took at least one prescription drug per month. Test whether the propor- tion of Americans who take at least one prescription drug per month has increased, using a 5 0.01. Solution Because the sample of Americans has been selected randomly and n . 25, we may proceed. We represent people taking at least one prescription drug per month by plus (1) signs and people taking no prescription drugs by minus (2) signs. Step 1 State the hypotheses.

H0 : p 5 0.5 versus Ha : p . 0.5 where p represents the population proportion of Americans taking at least one pre- scription drug per month. Step 2 Find the critical value and state the rejection rule. The sample size n 5 100 is greater than 25, so we may use the large-sample case. Using Table 4 in

Chapter 9 (page 500) for level of significance a 5 0.01, we have Zcrit 5 22.33. We will

reject H0 if Zdata # 22.33.

Step 3 Find the value of the test statistic. From Table 5, Sdata 5 the number of

minus signs 5 the number of people not taking prescription drugs. Thus, Sdata 5 100 2

67 5 33. We then calculate the test statistic Zdata: n 100 _S 1 0.5+ 2 s33 1 0.5d 2 data 2 2 Z 5 5 5 23.3 data Ïn Ï100 2 2 Step 4 State the conclusion and the interpretation. Because Z 5 23.3 is # Z 5 NOW YOU CAN DO data crit 22.33, we reject H0. Evidence exists that the population proportion of Americans Exercises 25–26. taking at least one prescription drug per month has increased.

Larose_3e_ch14.indd 13 10/30/15 11:03 AM 14.2 Sign Test 14-14

Has Median Gas Mileage Increased? vehicles The data set in Table 6 represents a random sample of vehicles that were manu- case study factured in model years 2007 and 2014 and matched so that the various engine characteristics (displacement, number of cylinders, and so on) are the same for each model in the two years.1 Thus, we are dealing with matched-pair data, comparing the combined miles per gallon (that is, city and highway mpg) for the same vehicles from two different years. Use the sign test to test whether the population median of the difference in gas mileage (2014 2 2007) is greater than zero, using level of significance a 5 0.01.

Table 6 Miles per gallon of a random sample of 14 vehicles for 2007 and 2014 Combined Combined Difference Make Model mpg for 2007 mpg for 2014 (2014 2 2007) Sign Chevrolet Tahoe 17 17 0 None Chevrolet Suburban 17 17 0 None Dodge Caravan 21 20 21 2 Ford Explorer 17 19 2 1 Ford F150 Pickup 16 18 2 1 Ford Mustang 17 19 2 1 Ford Taurus 23 21 22 2 GMC Savana Cargo 17 16 21 2 GMC Yukon XL 17 17 0 None Subaru Forester 25 27 2 1

Wavebreakmedia/Shutterstock Subaru Impreza 25 27 2 1 Subaru Legacy 25 27 2 1 Toyota Corolla 36 35 21 2 Toyota Tacoma 21 23 2 1

Solution The vehicles represent a random sample, so the condition for performing the sign test for the population median of the differences is met. Step 1 State the hypotheses. Here, we have a right-tailed test:

H0 : Md 5 0 versus Ha : Md . 0

where Md represents the population median of the differences in miles per gallon (2014 2 2007). Step 2 Find the critical value and state the rejection rule. The sample size is the sum of the number of plus signs and minus signs. There are 7 plus signs and 4 minus signs, so that n 5 7 1 4 5 11. Because n # 25, we use the small-sample case. To find the critical value, we use Appendix Table I. We have a one-tailed test, with a 5 0.01

and n 5 11, which gives us Scrit 5 1. The rejection rule is to reject H0 if Sdata # 1.

Step 3 Find the value of the test statistic. From Table 5, we have Sdata 5 the number of minus signs 5 4.

Step 4 State the conclusion and the interpretation. Because Sdata 5 4 is not # 1,

we do not reject H0. The evidence is insufficient to conclude that the population median of the differences (2014 2 2007) is greater than zero. In other words, the evidence is insufficient to conclude that the population median vehicle gas mileage has increased from 2007 to 2014.

We return to this Case Study in Section 14.3, when we apply the Wilcoxon signed rank test to the same question.

Larose_3e_ch14.indd 14 10/30/15 11:03 AM 14-15 Chapter 14 Nonparametric Statistics

STEP-BY-STEP TECHNOLOGY GUIDE: Sign Test TI-83/84 The TI-83/84 calculator does not have a built-in sign test function. p 5 0.5 5 However, you can use the binomcdf( function to calculate the x the value of Sdata (from Table 3) p-value for a sign test. Step 3 Press ENTER. The result is the p-value for a one-tailed Step 1 Press 2nd,VARS, scroll down and select binomcdf(, and test. Double this value for a two-tailed test. Reject H0 if the p-value press ENTER. is less than a. Step 2 The entry should be binomcdf (n, p, x), with n 5 the sum of the number of pluses and minuses EXCEL Excel does not have a built-in sign test function. However, you Step 2 In the dialog box, enter the following values: For

can use the BINOMDIST function to calculate the p-value for a Number_s, enter the value of Sdata (from Table 3) For Trials, enter sign test. n 5 the sum of the number of pluses and minuses. For Step 1 On the main menu bar, click fx. Where it says Search Probability_s, enter 0.5. For Cumulative, type True. for a function, type BINOMDIST and click Go. Where it says Step 3 Click OK. The result is the p-value for a one-tailed test.

Select a function, select BINOMDIST and click OK. Double this value for a two-tailed test. Reject H0 if the p-value is less than a. MINITAB Step 1 If you are performing the sign test for a single Step 2 Select Stat > Nonparametrics > 1-Sample Sign.... population median, enter the original data into column C1. If you Step 3 For the Variables cell, select C1. Select Test

are performing the sign test for the population median of the Median, and enter the hypothesized value of the median, M0. differences, enter the difference data into column C1. Select the direction of the alternative hypothesis, and click OK.

SPSS Step 1 Enter the data into the first column. Under Variable Step 5 Under Output, select Filter out unselected cases. This View, rename the first variable, and name the second (currently will ignore values that do not have a sign associated with them. empty) variable Sign. Click OK. Step 2 Click Transform > Compute Variable…. Step 6 Click Analyze > Nonparametric Tests > Legacy Step 3 Under Target Variable type Sign, and under Numeric Dialogs > Binomial.... Expression enter the first variable, a less-than sign (<), and then Step 7 Move Sign to Test Variable List, and under Test

M0. Click OK twice. Proportion put 0.50, and click OK. Step 4 Select Data > Select Cases. Click If condition is satisfied, click If…, and enter the first variable, the “not equals”

button, and then M0. Click Continue. JMP JMP does the sign test for matched pairs only. Step 2 Click Analyze > Matched Pairs. Move both columns to Step 1 Click File > New > Data Table. Enter the two samples Y, Paired Response. Click OK. in the first two columns. Step 3 Click the arrow beside Matched Pairs, and select Sign Test. The output using Example 6 is shown in Figure 5.

Section 14.2 Summary 1. In the sign test for the population median, each of second variable from the value of the first variable. We are the data values is converted to either a plus sign (1) or a minus interested only in the sign of the differences, not in the exact sign (2). If there is a preponderance of plus signs to minus value of the difference itself. signs, or vice versa (depending on the form of the hypothesis 3. The sign test for binomial data is a special case of the Z test), then this is evidence against the null hypothesis. test for the population proportion for p 5 0.5. 2. In the sign test for the population median of the differences, for each matched pair, subtract the value of the Section 14.2 Exercises

Clarifying the Concepts 2. The key concept for performing the sign test for the median 1. The sign test for the median represents an alternative to involves converting each of the data values to what? (p. 14-6) which parametric hypothesis test? (p. 14-5)

Larose_3e_ch14.indd 15 10/30/15 11:03 AM 14.2 Sign Test 14-16

3. True or false: In the sign test for the median, if there is a 16. Test whether the population median M differs from preponderance of plus signs to minus signs, or vice versa 1000, using level of significance a 5 0.10. (depending on the form of the hyp­othesis test), then this is 950 1000 975 925 900 1000 1025 900 evidence against the null hypothesis. (p. 14-6) 4. In the sign test for the population median, explain why 875 950 1000 975 925 750 775 900 the sample size for the hypothesis test may not be the same For Exercises 17–20, perform the large-sample sign test for as the number of data values in the sample. (p. 14-6) the population median. Use the following steps: 5. True or false: When computing the test statistic for the a. State the hypotheses. large-sample case for the sign test for the population median, b. Find the Z critical value and state the rejection rule. we need not calculate S . (p. 14-8) data c. Calculate the value of the test statistic Z . 6. True or false: The matched-pair sign test is interested in data d. State the conclusion and the interpretation. the exact value of the difference between the first and second 17. H : M 5 3.14 vs. H : M . 3.14, a 5 0.05. There are variables. (p. 14-10) 0 a 100 pluses and 10 minuses. 7. The matched-pair sign test represents an alternative to 18. H : M 5 3.0 vs. H : M , 3.0, a 5 0.01. There are which parametric hypothesis test? (p. 14-10) 0 a 20 pluses and 180 minuses. 8. The sign test for binomial data represents a special case 19. H : M 5 20.25 vs. H : M Þ 20.25, a 5 0.10. of which parametric hypothesis test? (p. 14-12) 0 a There are 225 pluses and 5 minuses, and ten data values PRACTICING THE TECHNIQUES equal 20.25. 20. H0 : M 5 75 vs. Ha : M Þ 75, a 5 0.05. There are 10,350 • CHECK IT OUT! pluses and 5,492 minuses, and 300 data values equal 75. For Exercises 21–24, you are given matched-pair data and To do Check out Topic are asked to perform a hypothesis test. Assume that each Exercises 9–16 Example 3 Small-sample sign test for sample of differences is obtained through dependent random the population median . Do the following: Exercises 17–20 Example 4 Large-sample sign test for a. State the hypotheses. the population median b. Find the critical value and state the rejection rule. Exercises 21–24 Example 5 Sign test for matched-pair c. Find the value of the test statistic. data from two dependent d. State the conclusion and the interpretation. samples 21. Test whether the population mean of the differences

Exercises 25–26 Example 7 Sign test for binomial data Md . 0, using level of significance a 5 0.05.

For Exercises 9–16, perform the small-sample sign test for Subject 1 2 3 4 5 the population median. Use the following steps: Sample 1 3.0 2.5 3.5 3.0 4.0

a. Use Appendix Table I to find the value of Scrit. Sample 2 2.5 2.5 2.0 2.0 1.5 b. State the rejection rule.

c. Calculate Sdata. 22. Test whether the population mean of the differences d. Provide the conclusion and the interpretation of the Md . 0, using level of significance a 5 0.01. hypothesis test.

9. H0 : M 5 10 vs. Ha : M . 10, a 5 0.05. There are Subject 1 2 3 4 5 6 10 pluses and 10 minuses. Sample 1 10 12 9 14 15 8 10. H : M 5 100 vs. H : M , 100, a 5 0.01. There are 0 a Sample 2 8 11 10 12 14 9 2 pluses and 16 minuses.

11. H0 : M 5 0 vs. Ha : M Þ 0, a 5 0.10. There are 0 pluses 23. Test whether the population mean of the differences and 8 minuses. Two data values equal 0. Md . 0, using level of significance a 5 0.05. 12. H0 : M 5 98.6 vs. Ha : M Þ 98.6, a 5 0.05. There is 1 plus and 1 minus. Three data values equal 98.6. Subject 1 2 3 4 5 6 7 13. Test whether the population median M is less than 10, Sample 1 20 25 15 10 20 30 15 using level of significance a 5 0.05. Sample 2 30 30 20 20 25 35 25 10 8 9 5 11 10 6 9 3 12 1 7 2 14. Test whether the population median M is greater than 24. Test whether the population mean of the differences

100, using level of significance a 5 0.01. Md . 0, using level of significance a 5 0.05. 105 219 100 136 345 996 100 400 102 100 229 331 15. Test whether the population median M is less than 400, Subject 1 2 3 4 5 6 7 Sample 1 1.5 1.8 2.0 2.5 3.0 3.2 4.0 using level of significance a 5 0.05. 105 219 100 136 345 996 100 400 102 100 229 331 Sample 2 1.0 1.7 2.1 2.0 2.7 2.9 3.3

Larose_3e_ch14.indd 16 10/30/15 11:03 AM 14-17 Chapter 14 Nonparametric Statistics

For Exercises 25 and 26, perform the sign test for binomial 30. New Car Prices. Kelley’s Blue Book (www.kbb.com) data. publishes data on new and used cars. The following table 25. A sample of size n 5 200 has x 5 75 successes. Test contains the fair market value for five new 2013 and 2014 whether the population proportion is less than 0.5, using vehicles (data recorded July 2014). Test whether prices have level of significance a 5 0.01. risen. That is, test whether the population median of the 26. A sample of size n 5 1000 has x 5 525 successes. Test difference in price is greater than zero, using level of whether the population proportion is greater than 0.5, using significance a 5 0.05. carprice level of significance a 5 0.10. Toyota Honda Ford Chevy Tesla Applying the Concepts Camry Civic 150 Corvette Model S 27. Electric Cars. The accompanying table shows the 2014 $20,672 $17,069 $24,362 $45,684 $68,738 miles-per-gallon equivalent (MPGe) for five electric (Sample 1) cars, as reported by www.hybridcars.com in 2014. Test 2013 $20,284 $16,499 $22,674 $44,021 $68,674 whether the population median mileage is greater than (Sample 2) 90 MPGe, using level of significance a 5 0.05. electricmiles 31. High and Low Temperatures. The University of Waterloo Weather Station tracks the daily low and high Electric vehicle Mileage (mpg) temperatures in degrees Celsius in Waterloo, Ontario, Tesla Model S 89 Canada. The table contains a random sample of the daily Nissan Leaf 99 high and low temperatures for 10 days in calendar year Ford Focus 105 2010. Test whether the population median of the difference in price differs from zero, using level of significance Mitsubishi i-MiEV 112 a 5 0.05. Chevrolet Spark 119 waterlootemp

28. A Rainy Month in Georgia? The following table Day 1 2 3 4 5 6 7 8 9 10 represents the total rainfall (in inches) for the month of High 9.4 6.1 5.9 29.1 11.9 30.6 23.1 33.1 14.8 0.1 February 2011 for a random sample of 10 locations in Low 0.8 −8.9 −1.3 19.3 6.7 21.5 10.5 18.7 7.4 −9.9 Georgia. Test whether the population median amount of rainfall differs from 4 inches, using level of significance 32. NASDAQ Stock Prices. The table provides the start-of- a 5 0.10. georgiarain trading and end-of-trading prices for the eight most active stocks on July 28, 2014. Test whether the population median Rainfall Rainfall of the difference in price differs from zero, using level of Location (inches) Location (inches) significance a 5 0.10. nasdaq72814 Athens 4.72 Atlanta 4.25 Augusta 4.31 Cartersville 3.03 End-of- Start-of- Dekalb 2.96 Fulton 4.36 Stock trading price trading price Gainesville 4.06 Lafayette 3.75 Sirius XM $3.38 $3.44 Marietta 3.20 Rome 3.26 Apple $99.02 $97.67 29. Deepwater Horizon Cleanup Costs. The following Facebook $74.92 $75.19 table represents the amount of money disbursed by BP to a Micron Technology $31.98 $33.42 random sample of six Florida counties, for cleanup of the Dollar Tree $54.87 $54.22 Deepwater Horizon oil spill, in millions of dollars. Test Intel $34.23 $34.25 whether the population median cleanup cost exceeds Microsoft $43.97 $44.50 $500,000, using level of significance a 5 0.01. Cisco Systems $25.92 $25.97 deepwaterclean Source: NASDAQ.com

Cleanup costs Cleanup costs 33. Firefox Market Share. A random sample of 1000 County ($ millions) County ($ millions) Internet users in Finland showed that 472 used the 2 Broward 0.85 Pinellas 1.15 Firefox browser. Use the sign test to test whether the population proportion of Internet users in Finland using Escambia 0.70 Santa Rosa 0.50 Firefox differs from 0.50, using level of significance Franklin 0.50 Walton 1.35 a 5 0.10.

Larose_3e_ch14.indd 17 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-18

34. Too Much Info on Facebook? A random sample of 287 on Facebook.3 Use the sign test to test whether the corporate employees found 189 who worried that work population proportion of corporate employees who worry colleagues and employees are sharing too much information about this exceeds 0.50, using level of significance a 5 0.01.

14.3 Wilcoxon Signed Rank Test for Matched-Pair Data

Objectives By the end of this section, I will be able to ... 1 Assess whether or not a data set is symmetric. 2 Perform the Wilcoxon signed rank test for matched-pair data from two dependent samples. 3 Perform the Wilcoxon signed rank test for a single population median.

The sign test that we learned about in Section 14.2 required only that the sample be ran- domly selected. However, because the requirements for performing the sign test are so mini- mal, the efficiency of the sign test may not be as high as the analyst would want it to be. If the sample data are randomly selected and symmetric, however, the data analyst may apply the more efficient Wilcoxon signed rank test to two of the situations in which the sign test can be applied, namely, to test for a single population median and to test for the population median of the differences for matched-pair data. 1 Assessing the Symmetry of a Data Set In Section 2.2, we learned that a distribution is symmetric if an axis of symmetry splits the image in half so that one side is the mirror image of the other. The distribution of women’s heights in Figure 6 is approximately symmetric (exact symmetry is rarely achieved with real-world data). If the data were randomly selected, it would be appro- priate to perform the Wilcoxon signed rank test on the data in Figure 6. On the other hand, the distributions shown in Figures 7 and 8 are not symmetric. In Section 3.5, we learned that a boxplot is a convenient method for assessing the symmetry of a data set. Figure 7 shows the clearly right-skewed of the

120

100

80

60

0.20 Axis of symmetry 40

0.15 20

0 0.10 0.00 1.25 2.50 3.75 5.00 6.25 7.50 8.75 Calories per gram 0.05 Relative frequency Relative IQR = 66 − 8 = 58 0 57.5 60.0 62.5 65.0 67.5 70.0 72.5 Height (inches) Min = 0 Q1 = 0.6 Median = 1.8 Q3 = 3.4 Max = 9.0

Figure 6 Approximately symmetric distribution. Figure 7 Calories per gram are right-skewed.

Larose_3e_ch14.indd 18 10/30/15 11:03 AM 14-19 Chapter 14 Nonparametric Statistics

150 150

100 100

Frequency 50

Frequency 50

0 0 0 100 200 300 70 80 90 100 Fitness scores Exam scores IQR = 200 − 99 = 101 IQR = 98 − 86 = 12

Min = 70 Q1 = 86 Median = 94 Q3 = 98 Max = 100 Min = 1 Q1 = 99 Median = 153 Q3 = 200 Max = 297

Figure 8 Exam scores are left-skewed. Figure 9 Fitness scores are symmetric.

number of calories per gram for the food items in the Nutrition data set. Note that the corresponding boxplot has a longer whisker on the right side, and that the median line is somewhat to the left of the center of the box. For the left-skewed exam score data in Figure 8, the boxplot has a longer whisker on the left side, and the median line is somewhat to the right of center. Finally, for the symmetric fitness score data in Figure 9, the corresponding boxplot has whiskers of approximately equal length, and the median line is situated approximately in the center of the box.

Boxplot Criterion for Assessing Symmetry A data set is symmetric when its corresponding boxplot has whiskers of approximately equal length, and the median line is situated approximately in the center of the box.

Example 8 Assessing symmetry using the TI-83/84 In Example 18 in Chapter 9, we examined a random sample of n 5 20 young women who were admitted with the diagnosis of anorexia nervosa to the Toronto Hospital for Sick Children. Use the TI-83/84 to assess the symmetry of the ages of these women (data on page 526).

Solution Figure 10 The age data are symmetric. Figure 10 shows the TI-83/84 boxplot of the ages of the young women. The whiskers are of approximately equal length, and the median line is situated NOW YOU CAN DO approximately in the center of the box. We therefore conclude that the age data are Exercises 11–14. symmetric.

2 Wilcoxon Signed Rank Test for Matched-Pair Data from Two Dependent Samples In Section 14.2, we performed the sign test to test for both a single population median and for the population median of the difference between two dependent samples. Similarly, in Section 14.3 we apply the Wilcoxon signed rank test for these two situations. We begin with the Wilcoxon signed rank test for matched-pair data from two dependent samples.

Larose_3e_ch14.indd 19 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-20

In the sign test, the data are converted into plus signs or minus The Wilcoxon signed rank test is a nonparametric hypothesis test in which the original signs. The magnitude of the data data are transformed into their ranks. The Wilcoxon signed rank test may be conducted values is lost, which contributes to for (a) a single population median or (b) matched-pair data from two dependent the low efficiency of the sign test. In samples. 1945, Frank Wilcoxon developed the Wilcoxon signed rank test for a single population median, which The following example illustrates how to calculate the signed ranks for the takes the magnitude of the data into Wilcoxon signed rank test. account by the data values.

Example 9 Calculating the Wilcoxon signed ranks The California Community Colleges Chancellor’s Office publishes enrollment data for each of its community colleges. Table 7 contains the number of students enrolled in the Spring 2013 and the Spring 2014 semesters at a random sample of six com- munity colleges in California. We are interested in testing whether the median num- ber of enrolled students has declined from 2013 to 2014. That is, we are interested in testing whether the population median of the differences (2014 2 2013) is less than zero. a. Calculate the signed rank for each community college. b. Find the sums of the positive signed ranks and the negative signed ranks.

Solution Calculate the signed ranks as follows: a. 1. For each data value, find the difference d between the data values for each matched pair. That is, for each community college, we find d 5 the number of enrolled students in 2014 minus the number of enrolled students in 2013. Omit observations where d 5 0. These differences are shown in Column 4 of Table 7. 2. Find the absolute values of the differences. The absolute values of the differences ∙d∙ are shown in Column 5 of Table 7. 3. Rank the absolute values of the differences from smallest to largest. If two or more data values are tied with the same rank, assign to each the mean value of their ranks had they not been tied. (There are no ties in this data set. See Example 11 to see how ties are handled.) The ranks of the absolute differences ∙d∙ are shown in Column 6 of Table 7. 4. Attach to each rank the sign of its corresponding value of d. This is its signed rank. For example, the rank of ∙d∙ for Los Angeles Community College is 3, but the sign of d (2392) for Los Angeles is negative (2). We attach this negative sign to the rank to give us Los Angeles’s signed rank of 23. Replace each original data value with its corresponding signed rank. The signed ranks are shown in the last column of Table 7. b. The sum of the positive sign ranks is 1 1 5 5 6 The sum of the negative signed ranks is 2 3 2 2 2 4 2 6 5 215

Larose_3e_ch14.indd 20 10/30/15 11:03 AM 14-21 Chapter 14 Nonparametric Statistics

Table 7 Students enrolled at California community colleges Community Enrollment Enrollment Difference d Rank Signed college Spring 2013 Spring 2014 (2014 2 2013) ∙d∙ of ∙d∙ rank Los Angeles CC 148,754 148,362 2392 392 3 23 Santa Monica CC 31,719 31,437 2282 282 2 22 El Camino CC 22,657 22,791 134 134 1 1 North Orange CC 51,780 53,993 2,213 2,213 5 5 Foothill CC 34,415 33,574 2841 841 4 24 Los Rios CC 75,230 71,911 23,319 3,319 6 26

The procedure for the Wilcoxon signed rank test for matched-pair data is summarized as follows.

Wilcoxon Signed Rank Test for Matched-Pair Data The requirements are that the sample data be randomly selected and that the distribution of the differences be symmetric. It is not required that the population be normally distributed. Step 1 state the hypotheses. Choose one of the forms in Table 8.

Table 8 Hypotheses for the Wilcoxon signed rank test for matched-pair data Null hypothesis Alternative hypothesis Type of test

H0 : Md 5 0 Ha : Md . 0 Right-tailed test

H0 : Md 5 0 Ha : Md , 0 Left-tailed test

H0 : Md 5 0 Ha : Md Þ 0 Two-tailed test

Step 2 Find the critical value and state the rejection rule. ● Small-Sample Case (n # 30): Use Appendix Table J. Choose the column with the appropriate level of significance (a) and the applicable one-tailed or two-tailed test. Then select the row with the appropriate sample size n, where n is the number of data values for which d does not equal zero. The number in that row and column is your # critical value Tcrit. The rejection rule is to reject H0 if Tdata Tcrit. ● Large-Sample Case (n . 30): Use Appendix Table C, the standard normal table. The Z critical value for this sign test is always found in the left tail of the standard normal

distribution, so that Zcrit is always less than 0. For a left-tailed test or a right-tailed test, a the critical value Zcrit is the value of Z with area to the left of it. For a two-tailed test, a the critical value Zcrit is the value of Z with area /2 to the left of it. Table 4 in Chapter 9 a (page 500) contains values of Zcrit for some common values of . The rejection rule is # to reject H0 if Zdata Zcrit. Step 3 Find the value of the test statistic. First find the signed ranks using the following steps: a. For each data value, find the difference d between each data value and the 5 hypothesized median M0. Omit data values for which d 0. b. Find the absolute values of the differences. c. Rank the absolute values of the differences from smallest to largest. If two or more data values have the same rank, assign to each the mean value of their ranks had they not been tied. d. Attach to each rank the sign of its corresponding value of d. This is its signed rank. Replace each original data value with its corresponding signed rank.

Larose_3e_ch14.indd 21 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-22

● Small-Sample Case (n # 30): Use Table 9 to find Tdata, where T1 is the sum of the

positive signed ranks, and ∙T2∙ is the absolute value of the sum of the negative signed ranks.

Table 9 Finding Tdata

Type of test Test statistic Tdata

Right-tailed test Tdata 5 ∙T2∙

Left-tailed test Tdata = T1

Two-tailed test Tdata = T1 or ∙T2∙, whichever is smaller

● Large-Sample Case (n . 30): Use Table 9 to find Tdata, and then calculate the test

statistic Zdata: nsn 1 1d T 2 data 4 5 Zdata nsn 1 1ds2n 1 1d Î 24 Step 4 State the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule.

We illustrate the Wilcoxon signed rank test for the population median of the differ- ences using the following example.

Example 10 Wilcoxon signed rank test for matched-pair data Use the data from Example 9 to test whether the population median number of enrolled students M has decreased from 2013 to 2014, using level of significance a 5 0.05.

Solution Figure 11 is a TI-83/84 boxplot of the differences (2014 2 2013). The whiskers are approximately the same length, indicating symmetry. Thus, we have a random sample Figure 11 TI-83/84 boxplot of of data exhibiting acceptable symmetry, and so our conditions are met. the differences. Step 1 State the hypotheses. We have a left-tailed test:

H0 : Md 5 0 versus Ha : Md , 0 where M represents the population median of the differences in number of enrolled students at California community colleges from 2013 to 2014.

Step 2 Find the critical value and state the rejection rule. The sample size is the number of data values for which the difference does not equal zero. Because none of the differences equals zero, our sample size is n 5 6. Because n # 30, we use the small-sample case. To find the critical value, we use Appendix Table J. We have a one-

tailed test, with level of significance a 5 0.05 and n 5 6, which gives us Tcrit 5 2, as

shown in Figure 12. The rejection rule is to reject H0 if Tdata # 2. Step 3 Find the value of the test statistic. The signed ranks are given in Table 7. We have a left-tailed test, so from Table 9, we have

Tdata 5 T1 5 the sum of the positive signed ranks 5 1 1 5 5 6

Larose_3e_ch14.indd 22 10/30/15 11:03 AM 14-23 Chapter 14 Nonparametric Statistics

 0.005 0.01 0.025 0.05 (one tail) (one tail) (one tail) (one tail) 0.01 0.02 0.05 0.10 n (two tails) (two tails) (two tails) (two tails) 5 * * * 1 6 * * 1 2 7 * 0 2 4

Figure 12 Finding the critical value Tcrit.

Step 4 State the conclusion and the interpretation. Because Tdata 5 6 is not # 2,

we do not reject H0. The evidence is insufficient to conclude that the population median NOW YOU CAN DO number of students enrolled at California community colleges has decreased from Exercises 15–18. 2013 to 2014.

3 Wilcoxon Signed Rank Test for a Single Population Median We can use the same methods for the Wilcoxon signed rank test for a single population median that we used for the Wilcoxon signed rank test for matched-pair data. However, only one sample is involved, so no subtraction is necessary to find the differences. The hypotheses for the Wilcoxon signed rank test for a single population median are the same as those for the sign test for matched-pair data, given in Table 10.

Table 10 Hypotheses for the Wilcoxon signed rank test for a single population median Null hypothesis Alternative hypothesis Type of test

H0 : M 5 M0 Ha : M . M0 Right-tailed test

H0 : M 5 M0 Ha : M , M0 Left-tailed test

H0 : M 5 M0 Ha : M Þ M0 Two-tailed test

We illustrate the small-sample case of the Wilcoxon signed rank test for a single population median using the following example.

Example 11 Wilcoxon signed rank test for a single population median: Small-sample case The Web site www.missingkids.com provides a searchable database of missing chil- dren. The ages of the following six children were obtained from this database.

Child Adam Juan Benjamin Samantha Kayleen Aiko Age 4 9 5 7 6 3

Test, using level of significance a 5 0.10, whether the population median age of the missing children equals 6 years old.

Larose_3e_ch14.indd 23 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-24

Solution Step 1 State the hypotheses. We have a two-tailed test:

H0 : M 5 6 versus Ha : M Þ 6 where M represents the population median age of the missing children. Thus, the

hypothesized value for the median is M0 5 6. Step 2 Find the critical value and state the rejection rule. To find the critical value, we use Appendix Table J, excerpted here in Figure 13. We have a two-tailed test,

with level of significance a 5 0.10 and n 5 5, which gives us Tcrit 5 1. The rejection

rule is to reject H0 if Tdata # 1.

 0.005 0.01 0.025 0.05 (one tail) (one tail) (one tail) (one tail) 0.01 0.02 0.05 0.10 n (two tails) (two tails) (two tails) (two tails) 5 * * * 1 6 * * 1 2

Figure 13 Using Appendix Table J to find the critical value Tcrit.

Step 3 Find the value of the test statistic. The calculations to find the signed ranks are shown in Table 11.

Table 11 Finding the signed ranks for the child age data

Child Age Age 2 M0 5 d | d | Rank of | d | Signed rank Adam 4 4 2 6 5 22 2 3 23 Juan 9 9 2 6 5 3 3 4.5 4.5 Benjamin 5 5 2 6 5 21 1 1.5 21.5 Samantha 7 7 2 6 5 1 1 1.5 1.5 Kayleen 6 6 2 6 5 0 — — — Aiko 3 3 2 6 5 23 3 4.5 24.5

a. Find d 5 age 2 M0 5 age 2 6 for each child. Note that the value of d for Kayleen is zero, so we omit Kayleen’s age from further calculations. b. The absolute values of the differences ∙d∙ are shown in the fourth column of Table 11. c. We rank the absolute differences. Notice that the absolute values for Benjamin and Samantha are ∙d∙ 5 1. Had they not been tied, their ranks would have been 1 and 2. The mean of 1 and 2 is (1 1 2)∙2 5 1.5. Thus, each child’s age is assigned the rank of 1.5. There is also a tie between Juan and Aiko, with ∙d∙ 5 3. Had they not been tied, their ranks would have been 4 and 5, so each child’s age is assigned the mean rank of 4.5. The ranks of the absolute differences ∙d∙ are shown in the fifth column of Table 11. d. Attach to each rank the sign of its corresponding value of d. This is its signed rank. For example, the rank of ∙d∙ for Adam is 3, but the sign of d 5 22 for Adam is negative (2). We attach this negative sign to the rank for Adam to

Larose_3e_ch14.indd 24 10/30/15 11:03 AM 14-25 Chapter 14 Nonparametric Statistics

give us Adam’s signed rank of 23. Replace each original data value with its corresponding signed rank, shown in the last column of Table 11. Next, we need to sum the positive ranks and the negative ranks. There are two

positive signed ranks: Juan’s 4.5 and Samantha’s 1.5. Thus, T1 5 4.5 1 1.5 5 6.

There are three negative signed ranks, which we add to get T2 : 23 1 (21.5) 1

(24.5) 5 29. Taking the absolute value gives us ∙T2∙ 5 ∙29∙ 5 9. Table 9 tells

us that Tdata 5 the smaller of T1 and ∙T2∙. Thus, Tdata 5 6. Step 4 State the conclusion and the interpretation. The rejection rule is to reject NOW YOU CAN DO H0 if Tdata # 1. Because Tdata 5 6 is not # 1, we do not reject H0. There is insufficient Exercises 19–22. evidence that the population median age of missing children differs from 6 years old.

Example 12 Large-sample Wilcoxon signed rank test for a population median using technology Test using level of significance a 5 0.10 whether the population median age of miss- ing children differs from 6 years old, using the random sample of 50 missing children shown here:

Child Age Child Age Child Age Child Age Amir 5 Carlos 7 Octavio 8 Christian 8 Yamile 5 Ulisses 6 Keoni 6 Mario 8 Kevin 5 Alexander 7 Lance 5 Reya 5 Hilary 8 Adam 4 Mason 5 Elias 1 Zitlalit 7 Sultan 6 Joaquin 6 Maurice 4 Aleida 8 Abril 6 Adriana 6 Samantha 7 Alexia 2 Ramon 6 Christopher 3 Michael 9 Juan 9 Amari 4 Johan 6 Carlos 2 Kevin 2 Joliet 1 Kassandra 4 Lukas 4 Hazel 5 Christopher 4 Hiroki 6 Kayla 4 Melissa 1 Jonathan 8 Kimberly 5 Aiko 3 Kayleen 6 Emil 7 Diondre 4 Lorenzo 9 Mirynda 7 Benjamin 5

Missing children and their ages. Solution The boxplot of the age data is shown here. The conditions are met because we have a random sample and the distribution of ages is symmetric. Step 1 State the hypotheses.

H0 : M 5 6 versus Ha : M Þ 6 where M represents the population median age of the missing children. Step 2 Find the critical value and state the rejection rule. There are 50 children. Boxplot of childern’s ages. Ten of these children are 6 years old, so that d 5 6 2 6 5 0. These 10 children are therefore omitted from this hypothesis test. This leaves us with 40 children, which is greater than 30, so we use the large-sample case. From Table 4 in Chapter 9 (page 500),

the two-tailed test with level of significance a 5 0.10 gives us Zcrit 5 21.645. We will

reject H0 if Zdata # 21.645. Step 3 Find the value of the test statistic. We use the instructions provided in the Step-by-Step Technology Guide at the end of this section. Figure 14 shows the Minitab

Larose_3e_ch14.indd 25 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-26

results, and Figure 15 shows the SPSS results, from the Wilcoxon signed rank test for the population median. Note that the original sample size (“N”) is 50, but that “N for Test” is n 5 40, because 10 data values have been omitted. The “Wilcoxon Statistic” is the

value of Tdata 5 279, which represents the smaller of T1 5 279 and ∙T2 ∙ 5 ∙2541∙ 5 541. We use this value to find the test statistic: nsn 1 1d 40s41d T 2 279 2 data 4 4 Zdata 5 5 < 21.7608 nsn 1 1ds2n 1 1d 40s41ds81d Î 24 Î 24

Figure 14 Minitab output for the Wilcoxon signed rank test for a population median.

Figure 15 SPSS output for the Wilcoxon signed rank test for a population median.

Step 4 State the conclusion and the interpretation. Because Zdata < 21.7608 #

21.645, we reject H0. There is evidence that the population median age of the missing children differs from 6 years old. Acquiring more data has changed our conclusion.

STEP-BY-STEP TECHNOLOGY GUIDE: Wilcoxon Signed Rank Test Neither TI-83/84 calculators nor Excel has a built-in function for the Wilcoxon signed rank test.

MINITAB Step 1 If you have two samples, enter the values in C1 and Step 3 Click Stat > Nonparametrics > 1-Sample Wilcoxon…. C2. If you have one sample, enter the values in C1. Step 4 For Variables, type C3. Select Test Median, and enter

Step 2 For two samples, click Calc > Calculator…. For Store the hypothesized value of the median M0. Select the form of the result in variable, type C3. For Expression, type C1–C2. Click OK. Alternative hypothesis, and click OK.

SPSS We use the data in Example 12 to illustrate the procedure. Step 2 Click Data > Select Cases…, click If condition is Step 1 Enter the data into the first column. Under the Variable satisfied, and click If…. View tab, rename the variable Age and change Measure Step 3 In the empty formula box, type Age  6. Click to Scale. Continue then OK.

Larose_3e_ch14.indd 26 10/30/15 11:03 AM 14-27 Chapter 14 Nonparametric Statistics

Step 4 Click Analyze > Nonparametric Tests > One signed-rank test). Enter the Hypothesized median, 6, and Sample…. click Run. Step 5 Select the Fields tab, and move Age to Test Fields. Step 7 Double-click the table of results in the Output window to Step 6 Select the Settings tab, select Customize tests, open the Model Viewer, and observe the right-hand side. The and check Compare median to hypothesized (Wilcoxon results are shown in Figure 15 of Example 12.

CRUNCHIT! We use the data in Table 7 to illustrate the procedure. Step 3 Select Statistics > Non-parametrics > Wilcoxon Signed Step 1 Enter the 2013 data into Var1 and the 2014 data into Var2. Rank. For Sample, select Var5. Enter the Median under null Step 2 Select Insert > Evaluate Formula. Enter  Var22Var1 hypothesis, 0, and for the Alternative hypothesis choose Less and click Evaluate. The differences appear in Var5. than. Click Calculate.

Section 14.3 Summary 1. A distribution is symmetric if a line (axis of symmetry) dependent samples. The hypotheses for the Wilcoxon signed splits the image in half so that one side is the mirror image of rank test for the population median of the differences are the the other. A data set is symmetric when its corresponding same as those for the corresponding sign test. boxplot has whiskers of approximately equal length, and the 3. The Wilcoxon signed rank test for a single population median line is situated approximately in the center of the box. median is comparable to the sign test for the population 2. The Wilcoxon signed rank test takes the magnitude of the median. The hypotheses are the same, there are small-sample data into account by ranking the data values. The Wilcoxon and large-samples cases, and the test statistic depends on the signed rank test can be applied to matched-pair data from two form of the hypotheses.

Section 14.3 Exercises CLARIFYING THE CONCEPTS • CHECK IT OUT! 1. What are the conditions required for performing the Wilcoxon signed rank test? (p. 14-21) To do Check out Topic 2. Describe what is meant by a symmetric distribution. Exercises 11–14 Example 8 Assessing symmetry (p. 14-18) Exercises 15–18 Example 10 Wilcoxon signed rank 3. Explain the boxplot criterion for assessing symmetry. test for matched-pair data (p. 14-19) Exercises 19–22 Example 11 Wilcoxon signed rank 4. Describe how the Wilcoxon signed rank test takes the test for a single magnitude of the data into account. (p. 14-20) population median: 5. What are the four steps involved (a2d) in calculating small-sample case the signed ranks of the data? (p. 14-21) 6. State the three ways in which the Wilcoxon signed rank test for the population median is comparable to the sign test 11. for the population median. (p. 14-24) 7. For each of the right-tailed test, the left-tailed test, and the 12.

two-tailed test, state what the test statistic Tdata equals. (p. 14-22) 8. Explain how ties are resolved when calculating ranks. (p. 14-21) 13. 9. State the rejection rule for the Wilcoxon signed rank test for the small-sample case. Do the same for the large-sample case. (p. 14-21) 14. 10. We may use the same methods for the Wilcoxon signed rank test for matched-pair data that we use for the Wilcoxon For Exercises 15–18, perform the indicated Wilcoxon signed signed rank test for a single population median, except that rank test for the population median of two dependent we must do one extra step. What is that step? (p. 14-23) samples using level of significance a 5 0.05. Assume the data are symmetric. PRACTICING THE TECHNIQUES 15. H0 : Md 5 0 versus Ha : Md . 0, with n 5 12 and

For Exercises 11–14, assume that the data represented by the ∙T2∙ 5 20

boxplots have been randomly sampled. Assess whether it is 16. H0 : Md 5 0 versus Ha : Md . 0, with n 5 12 and

appropriate to perform the Wilcoxon signed rank test. ∙T2∙ 5 15

Larose_3e_ch14.indd 27 10/30/15 11:03 AM 14.3 Wilcoxon Signed Rank Test for Matched-Pair Data 14-28

17. H0 : Md 5 0 versus Ha : Md , 0, with n 5 18 and T1 5 45 2272 294 2291 243 78 2454 223 320

18. H0 : Md 5 0 versus Ha : Md Þ 0, with n 5 20, T1 5 160, 2204 2136 224 526 38 255 293 and ∙T ∙ 5 50 2 The accompanying figure is a boxplot of the data. Note that For Exercises 19–22, perform the indicated Wilcoxon signed the Wilcoxon signed rank test is a robust method (see Section rank test for a single population median using level of 3.6 for similar robust methods) and is insensitive to the significance a 5 0.05. presence of the outlier indicated in the boxplot. In other

19. H0 : M 5 10 versus Ha : M > 10, with n 5 20 and words, the presence of a reasonable number of outliers does

∙T2∙ 5 50 not impair the performance of the Wilcoxon signed rank test.

20. H0 : M 5 45 versus Ha : M , 45, with n 5 15 and T1 5 40 Perform the Wilcoxon signed rank test at level of significance

21. H0 : M 5 45 versus Ha : M , 45, with n 5 15 and T1 5 20 a 5 0.05 to determine whether the population median of the

22. H0 : M 5 100 versus Ha : M Þ 100, with n 5 10, T1 5 5, differences (vitamin C 2 placebo) differs from zero.

and ∙T2∙ 5 50 APPLYING THE CONCEPTS 23. Women’s Body Temperatures. Use the following 27. Reiki Touch Therapy. A study was performed to random sample of seven women’s body temperatures to test, determine whether Reiki touch therapy was useful in the using the Wilcoxon signed rank test, whether the population reduction of chronic pain, including that suffered by median of women’s body temperatures differs from 98.6 cancer patients.7 The pain levels reported by a random degrees Fahrenheit.4 sample of 13 patients before and after Reiki touch therapy 97.2 97.8 98.1 98.3 98.7 98.8 99.3 are shown here in Table 12. The accompanying figure is a boxplot of the data. Use level Table 12 Pain levels before and after Reiki touch of significance a 5 0.05. therapy Patient 1 2 3 4 5 6 7 8 9 10 11 12 13 After 31002121041 4 8 24. Earthquake Magnitudes. The following data from Before 62233425166 4 8 the U.S. Geological Survey represent the magnitude on the Difference 23 21 22 23 21 23 0 24 21 22 25 0 0 Richter scale of a random sample of 10 earthquakes worldwide that occurred during the week of August 3, 2014. Test, using the Wilcoxon signed rank test, whether there was 5.6 5.0 6.3 5.4 5.7 5.3 5.1 4.5 5.3 4.9 a reduction in mean pain level after the Reiki therapy, using The accompanying figure is a boxplot of the data. Use the level of significance a 5 0.05. The accompanying figure is a Wilcoxon signed rank test to test whether the population boxplot of the data. median magnitude of earthquakes is less than 6.0. Use level of significance a 5 0.01. 28. Video Game Ratings. GameRankings.com publishes for reviews of video games. The 25. Small Businesses. The following data set represents the following data set represents a random sample of video number of businesses in a random sample of eight cities games, with their average reviewer score for the PlayStation 3 nationwide.5 platform and the Xbox 360 platform, as of January 23, 2009. Test whether the population median of the differences 7923 3642 6909 6331 4311 5578 2828 2781 (PlayStation 3 2 Xbox 360) is less than zero, using level of The accompanying figure is a boxplot of the data. Test, using significance a 5 0.05. gameranking the Wilcoxon signed rank test, whether the population median number of businesses per city is greater than 2500, PlayStation 3 Xbox 360 using level of significance a 5 0.01. mean mean Game reviewer score reviewer score Grand Theft Auto IV 0.9373 0.9656 BioShock 0.9403 0.9525 26. Outliers: Muscular Endurance. The muscular Call of Duty 4 0.9378 0.9416 endurance of 15 randomly selected males was measured after Rock Band 0.9119 0.9225 taking a single 600-milligram dose of vitamin C and also after The Orange Box 0.8838 0.9624 taking a sugar placebo. Muscular endurance was measured by Guitar Hero III: 0.8390 0.8622 repetitive grip strength.6 The following data set represents the Legends of Rock differences in muscular endurance (vitamin C 2 placebo).

Larose_3e_ch14.indd 28 10/30/15 11:03 AM 14-29 Chapter 14 Nonparametric Statistics

14.4 Wilcoxon Rank Sum Test for Two Independent Samples

OBJECTIVE By the end of this section, I will be able to . . . 1 Perform the Wilcoxon rank sum test for the difference in population , using two independent samples

In Section 14.3, we compared data from dependent samples. Here, in Section 14.4, we analyze data from independent samples. Recall from Section 10.1 that two samples are independent when the subjects selected for the first sample do not determine the sub- jects in the second sample. In Section 10.2, we learned how to perform a hypothesis test for the difference in population means using two independent samples. The two-sample t test that we learned in that section required either that each sample size be large (at least 30) or that each population be normally distributed. Here, in Section 14.4, we will learn about the Wilcoxon rank sum test for the difference in population medi- ans using two independent samples, which has less stringent conditions.

1 Wilcoxon Rank Sum Test for the Difference in Population Medians Using Two Independent Samples The requirements for the Wilcoxon rank sum test are less strict, as we shall see.

The Wilcoxon rank sum test is a nonparametric hypothesis test in which the original data from two independent samples are transformed into their ranks. It tests whether the two The Wilcoxon rank sum test is population medians are equal or not. equivalent to the Mann-Whitney test, another nonparametric test used in some textbooks to test for In the Wilcoxon rank sum test, the two samples are temporarily combined, and the the difference in population ranks of the combined data values are calculated. Then the ranks are summed sepa- medians. (By an “equivalent rately for each sample. hypothesis test,” we mean a hypothesis test that is applicable to R 5 the sum of the ranks for the first sample the same situations and always 1

provides the same conclusions.) R2 5 the sum of the ranks for the second sample

Example 13 Finding the ranks of combined data and summing the ranks for each sample The following table shows the pulse rates in beats per minute for a random sample of five women and a random sample of four men. a. Combine the data sets and find the ranks. b. Find the sum of the ranks for the women and the sum of the ranks for the men.

Women 66 77 57 62 68 Men 79 71 68 71 Solution a. We temporarily combine the two samples and arrange the values in increasing order. We then rank the data values from smallest to largest, as shown in the following table. Note that we have two pulse rates of 68 beats per minute. Had these not been tied, they would have had ranks 4 and 5. We therefore assign to

Larose_3e_ch14.indd 29 10/30/15 11:03 AM 14.4 Wilcoxon Rank Sum Test for Two Independent Samples 14-30

each the mean rank (4 1 5)∙2 5 4.5. Similarly, the two pulse rates of 71 beats per minute are assigned the mean rank (6 1 7)∙2 5 6.5.

Combined data 57 62 66 68 68 71 71 77 79 Rank 1 2 3 4.5 4.5 6.5 6.5 8 9 b. The sum of the ranks for the women is

R1 5 1 1 2 1 3 1 4.5 1 8 5 18.5 NOW YOU CAN DO The sum of the ranks for the men is

Exercises 7–10. R2 5 4.5 1 6.5 1 6.5 1 9 5 26.5

Suppose we have two independent samples. Let M1 and M2 represent the popula- tion median of the first and second samples, respectively. Then we have the following two-tailed hypotheses for the Wilcoxon rank sum test:

H0 : M1 5 M2 versus Ha : M1 Þ M2 The null hypothesis states that the two populations have the same median. If this is When performing the Wilcoxon true, we expect that R , the sum of the ranks for the first sample, will not be very dif- rank sum test, we need to find 1 R1 ferent from R , the sum of the ranks for the second sample. Large differences between only, the sum of the ranks for the 2 first sample. It is not necessary to R1 and R2 will therefore lead us to reject the null hypothesis that no difference exists in find the sum of the ranks for the the population medians. When the conditions are met, the distribution of R1 follows an

second sample, R2. approximately normal distribution.

Wilcoxon Rank Sum Test for Two Independent Samples The requirements are that (a) the samples are independent random samples, (b) each sample size is larger than 10, and (c) the shapes of the distributions are the same. It is not required that the populations be normally distributed. Note: In this section, we assume that condition (c) is satisfied. Step 1 state the hypotheses. Choose one of the forms in Table 13.

Table 13 Hypotheses for the Wilcoxon rank sum test Null hypothesis Alternative hypothesis Type of test

H0 : M1 5 M2 Ha : M1 . M2 Right-tailed test

H0 : M1 5 M2 Ha : M1 , M2 Left-tailed test

H0 : M1 5 M2 Ha : M1 Þ M2 Two-tailed test

Step 2 Find the critical value and state the rejection rule. Use Table 14 to find the critical value and the rejection rule.

Table 14 Critical values and rejection rules for the Wilcoxon rank sum test Form of hypothesis test Right-tailed Left-tailed Two-tailed

H0 : M1 5 M2 H0 : M1 5 M2 H0 : M1 5 M2 Ha : M1 . M2 Ha : M1 , M2 Ha : M1 Þ M2

a 5 0.10 Zcrit 5 1.28 Zcrit 5 21.28 Zcrit 5 1.645 a 5 0.05 Zcrit 5 1.645 Zcrit 5 21.645 Zcrit 5 1.96 a 5 0.01 Zcrit 5 2.33 Zcrit 5 22.33 Zcrit 5 2.58

Rejection rule Reject H0 if Reject H0 if Reject H0 if Zdata $ Zcrit Zdata # Zcrit Zdata # 2Zcrit or if Zdata $ Zcrit

Larose_3e_ch14.indd 30 10/30/15 11:03 AM 14-31 Chapter 14 Nonparametric Statistics

Step 3 Find the value of the test statistic Zdata. R 2 m Z 5 1 R data s R where n sn 1 n 1 1d m 5 1 1 2 R 2 n n sn 1 n 1 1d s 5 1 2 1 2 R Î 12 5 n1 and n2 represent the sample sizes for samples 1 and 2, respectively, and R1 the sum of the ranks for the first sample. Step 4 state the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule.

Example 14 Performing the Wilcoxon rank sum test We are interested in testing whether the population median pulse rate for women (Population 1) is less than that for men (Population 2). We use the data from Example 13 supplemented with an additional seven women and seven men, sampled randomly and independently. The data are presented below.8 Perform the Wilcoxon rank sum test at level of significance a = 0.05.

Women 66 77 57 62 68 78 73 81 84 69 62 79 Men 79 71 68 71 68 86 73 58 68 74 78

Solution The data were obtained using random samples. Also, we assume that the distributions

of the populations have the same shape. Also, we have n1 5 12 and n2 5 11, so the conditions for performing the Wilcoxon rank sum test are satisfied. Step 1 State the hypotheses. The key words “less than” indicate that we have a left- tailed test, from Table 13:

H0 : M1 5 M2 versus Ha : M1 , M2

where M1 and M2 represent the population median pulse rates of the first (women) and second (men) samples, respectively. Step 2 Find the critical value and state the rejection rule. The level of significance

is a 5 0.05, so from Table 14 our critical value is Zcrit 5 21.645, and our rejection rule

is to reject H0 if Zdata # 21.645. Step 3 Find the value of the test statistic. We combine the two samples and arrange in increasing order. We then rank the data values from smallest to largest, as shown in the following table, assigning ties to the mean rank value.

Combined data 57 58 62 62 66 68 68 68 68 69 71 71 Rank 1 2 3.5 3.5 5 7.5 7.5 7.5 7.5 10 11.5 11.5 Combined data 73 73 74 77 78 78 79 79 81 84 86 Rank 13.5 13.5 15 16 17.5 17.5 19.5 19.5 21 22 23

The sum of the ranks for the women is

R1 5 1 1 3.5 1 3.5 1 5 1 7.5 1 10 1 13.5 1 16 1 17.5 1 19.5 1 21 1 22 5 140

Larose_3e_ch14.indd 31 10/30/15 11:03 AM 14.4 Wilcoxon Rank Sum Test for Two Independent Samples 14-32

We have n sn 1 n 1 1d 12s12 1 11 1 1d m 5 1 1 2 5 5 144 R 2 2

n n sn 1 n 1 1d 12s11ds12 1 11 1 1d s 5 1 2 1 2 5 < 16.2481 R Î 12 Î 12 So that

R1 1 mR 140 2 144 Zdata 5 < < 20.2462 sR 16.2481

Step 4 State the conclusion and the interpretation. We said in Step 2 that we would reject H if Z # 21.645. But Z < 20.2462, which is not # 21.645. NOW YOU CAN DO 0 data data Therefore, our conclusion is to not reject H0. There is insufficient evidence that the Exercises 11–14. population median pulse rate for women is less than that for men.

Example 15 Performing the Wilcoxon rank sum test using technology A study investigated whether there was a difference in physical activity levels between female adolescents with anorexia nervosa (AN) and those without AN.9 In this study,

the amount of physical activity (in minutes for the year) of n1 5 314 randomly selected

female adolescents with AN (patients) and n2 5 340 randomly selected female ado- lescents without AN (controls) was estimated by interviewing their mothers. The sam- ples were drawn independently. Use Minitab and SPSS to test whether the population

Dennys Bisogn/ Getty Images median minutes of physical activity for the patients differs from that for the controls, using level of significance a 5 0.01. Solution

Because both the patients and the controls were randomly selected, because n1 . 10

and n2 . 10, and because we assume that both population shapes are the same, we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : M1 5 M2 versus Ha : M1 Þ M2

where M1 and M2 represent the population median activity level (in minutes) of the patients and the controls, respectively. Step 2 Find the critical value and state the rejection rule. The level of significance

is a 5 0.01, so our critical value is Zcrit 5 2.58. We will reject H0 if Zdata # 22.58 or if

Zdata $ 2.58. Step 3 Find the value of the test statistic. We use the instructions provided in the Step-by-Step Technology Guide at the end of this section. Figure 16 shows the Minitab results from the Mann-Whitney test, which is equivalent to the Wilcoxon rank sum test for independent samples. Figure 17 shows the SPSS results from the Mann-Whitney test.

Minitab Mann-Whitney results (equivalent to Wilcoxon rank sum test)

N Median with AN 314 4200.0 without AN 340 3240.0

Point estimate for ETA1-ETA2 is 810.0 95.0 Percent CI for ETA1-ETA2 is (150.0,1485.1) W = 109336.5

Figure 16 Minitab results.

Larose_3e_ch14.indd 32 10/30/15 11:03 AM 14-33 Chapter 14 Nonparametric Statistics

FIGURE 17 SPSS results.

The highlighted “W 5 109336.5” represents R1 in our notation. We have n sn 1 n 1 1d 314s314 1 340 1 1d m 5 1 1 2 5 5 102,835 R 2 2 n n sn 1 n 1 1d 314s340ds314 1 340 1 1d s 5 1 2 1 2 5 < 2413.9836 R Î 12 Î 12 So that R1 1 mR 109,336.5 2 102,835 Zdata 5 < < 2.6933 sR 2413.9836

Step 4 State the conclusion and the interpretation. We said we will reject H0 if

Zdata # 22.58 or if Zdata $ 2.58. We have Zdata < 2.6933, which is greater than 2.58.

Therefore, we reject H0. There is evidence that the population median amount of physical activity for female adolescents with AN differs from the population median amount of physical activity for female adolescents without AN.

STEP-BY-STEP TECHNOLOGY GUIDE: Wilcoxon Rank Sum Test

TI-83/84 Neither the TI-83/84 calculators nor Excel has a built-in function for the Wilcoxon rank sum test.

MINITAB Step 1 Enter the values of the first variable in C1 and the values Step 3 For First Sample, type C1. For Second Sample, type of the second in C2. C2. Select the Not Equal form of the Alternative hypothesis, and Step 2 Click Stat > Nonparametrics > Mann-Whitney…. click OK.

Larose_3e_ch14.indd 33 10/30/15 11:03 AM 14.4 Wilcoxon Rank Sum Test for Two Independent Samples 14-34

SPSS Step 1 Enter the activity data in the first column and a numeric code Step 3 In the Fields tab, move Activity to Test Fields and Group for group (for example, 0 for control and 1 for patients) in the second to Groups. column. Under the Variable View tab, name your variables Activity Step 4 In the Settings tab, select Customize tests and check and Group, set Decimals at 0 for Group, and set the Measure for Mann-Whitney (2 samples). Click Run. Activity to Scale and the Measure for Group to Nominal. Step 5 Double-click on the output to open the Model Viewer Step 2 Click Analyze > Nonparametric Tests > Independent window, and observe the results on the right-hand side, shown in Samples…. Figure 17 of Example 15.

CRUNCHIT! Step 1 Click File, highlight Load from Larose, Discostat3e > Step 3 For Sample 1, select Women. For Sample 2, select Chapter 14, and select Example 14. Men. Step 2 Click Statistics, highlight Non-parametrics, and select Step 4 For Location shift under null hypothesis, input 0. For Mann-Whitney U. Alternative, choose Less than. Click Calculate.

Section 14.4 Summary 1. The Wilcoxon rank sum test is a nonparametric The two samples are temporarily combined, and the ranks hypothesis test in which the original data from two of the combined data values are calculated. Then the sum independent samples are transformed into their ranks. It tests of the ranks for the first sample is used to calculate the test whether the two population medians are equal or not. statistic.

Section 14.4 Exercises

CLARIFYING THE CONCEPTS 7. Sample 1 4 3 5 4 7 9 2 9 2 3 5 1. What do we mean when we say that we have two Sample 2 11 7 5 3 10 8 6 3 3 4 5 3 independent samples? (p. 14-30) 2. Which hypothesis test did we learn about in Section 10.2 8. Sample 1 6 5 9 11 6 12 7 12 8 10 8 6 that examined the difference in population means for two independent samples? What were the conditions for this test? Sample 2 20 19 16 20 19 11 20 10 10 11 11 Are the conditions for the Wilcoxon rank sum test stricter or less strict? (p. 14-29) 9. Sample 1 96 98 81 94 89 88 84 88 84 80 81 97 3. True or false: When performing the Wilcoxon rank sum Sample 2 97 97 86 90 82 85 96 81 85 79 79 80 96 83 test, it is not necessary to find the sum of the ranks for the second sample, R . (p. 14-30) 2 10. Sample 1 565 544 509 523 598 525 521 530 4. Clearly explain the meaning of M and M . (p. 14-30) 1 2 523 544 589 589 5. If the null hypothesis is true, what do we expect Sample 2 532 572 589 544 601 548 561 539 regarding R1 and R2? (p. 14-30) 6. What are the requirements for performing the Wilcoxon 578 549 582 rank sum test? (p. 14-30) For Exercises 11–14, we are interested in whether the PRACTICING THE TECHNIQUES population medians differ. Do the following: a. State the hypotheses. b. Find the critical value Z and state the rejection • CHECK IT OUT! crit rule. To do Check out Topic c. Find the value of the test statistic Zdata. Exercises 7–10 Example 13 Finding and summing the d. State the conclusion and the interpretation. ranks of combined data 11. Use the data and the value you calculated for R1 in Exercises 11–14 Example 14 Performing the Wilcoxon Exercise 7. Use level of significance a 5 0.05.

rank sum test for two 12. Use the data and the value you calculated for R1 in independent samples Exercise 8. Use level of significance a 5 0.05.

13. Use the data and the value you calculated for R1 in

For Exercises 7–10, calculate R1, the sum of the ranks for the Exercise 9. Use level of significance a 5 0.10.

first sample. The data represent two independent random 14. Use the data and the value you calculated for R1 in samples. Exercise 10. Use level of significance a 5 0.10.

Larose_3e_ch14.indd 34 10/30/15 11:03 AM 14-35 Chapter 14 Nonparametric Statistics

APPLYING THE CONCEPTS European Carbon African Carbon 15. Facebook Game Pages. The following table shows nation emissions nation emissions the number of fans for independent random samples of Portugal 61.71 Tanzania 4.68 Facebook pages for games and Facebook pages for television shows as of February 11, 2009. Test whether the Spain 372.62 Zimbabwe 10.33 population median number of fans of Facebook pages for United Kingdom 585.71 games differs from the population median number of fans Source: U.S. Energy Information Administration, 2008. of Facebook pages for television shows, using level of significance a 5 0.10. The data are shown in thousands. 17. Property Taxes. You want to move to either a small facebook town in Ohio or a small town in North Carolina. You did some research on property taxes in each state and chose the Number of fans of Facebook game and Facebook two independent random samples shown in the table below. television show pages The data represent the property taxes in dollars for a residence assessed at $250,000. Test whether the population Facebook game Fans Facebook TV Fans median property tax in Ohio differs from that in North page (1000s) show page (1000s) Carolina, using level of significance a 5 0.05. Guitar Hero 640 House 1445 propertytax World of Warcraft 167 American Idol 377 Pro Evolution Soccer 497 Grey’s Anatomy 1244 Ohio 270 315 177 245 180 292 291 298 Grand Theft Auto 4 459 Gossip Girl 981 270 165 400 268 289 285 225 Texas Hold ’em 191 Futurama 546 North Carolina 206 129 176 120 154 123 164 147 Poker 207 138 143 201 Need for Speed 248 Lost 379 Source: U.S. Bureau. Crash Bandicoot 394 South Park 146 Call of Duty 4 227 CSI: Miami 363 18. Florida Cities versus Texas Cities. Does the Final Fantasy Series 197 Family Guy 855 metropolitan-level gross domestic product differ for Mario Kart 399 The Office 567 cities in Florida versus cities in Texas? Independent The Sims 2 568 Mythbusters 545 random samples of Florida and Texas cities were drawn, The Simpsons 807 and the gross domestic product of the cities was recorded. Test whether the population median metropolitan-level Source: allfacebook.com. gross domestic product differs for cities in Florida versus cities in Texas, using level of significance a 5 0.10. 16. Carbon Emissions. Independent random samples of flvs.tx European and African nations were taken, and the carbon dioxide emissions from fossil fuels were recorded (in Gross domestic product for cities in Florida and Texas millions of metric tons). Test whether the population median carbon emissions per nation in Europe differs from that of GDP GDP the nations in Africa, using level of significance a 5 0.01. Florida city ($ millions) Texas city ($ millions) carbon2 Sarasota 24,772 Abilene 4,927 Fort Myers 21,838 Amarillo 8,435 Carbon emissions from European and African nations Daytona Beach 11,919 Austin 71,176 European Carbon African Carbon Gainesville 8,903 College Station 5,669 nation emissions nation emissions Jacksonville 58,163 Corpus Christi 14,352 Belgium 147.58 Algeria 88.23 Miami 248,029 Dallas 338,493 Czech Republic 116.30 Congo 5.53 Orlando 97,384 El Paso 23,563 Denmark 59.13 Egypt 151.62 Pensacola 13,040 Houston 344,516 France 417.75 Ethiopia 5.13 Tallahassee 12,152 San Antonio 72,738 Germany 857.60 Kenya 10.79 Tampa-St. 108,520 Port Arthur 13,476 Greece 107.07 Mozambique 4.98 Petersburg Ireland 46.86 Rwanda 0.83 Winter Haven 17,309 Brownsville 6,555 Italy 468.19 South Africa 443.58 Killeen 12,286 Poland 303.42 Sudan 12.26 Source: U.S. Bureau of Economic Analysis.

Larose_3e_ch14.indd 35 10/30/15 11:03 AM 14.5 Kruskal-Wallis Test 14-36

19. Phosphorus and Potassium in Food. The following per county differs for California versus Georgia, using level data represent independent random samples taken from a of significance a 5 0.05. gacaincome population of food items, recording the amount of phosphorus in the first sample and the amount of potassium Income in California and Georgia in the second sample (both measurements are in milligrams). Test whether the population median amount Per capita Per capita of phosphorus differs from the population median amount California personal Georgia personal of potassium, using level of significance a 5 0.05. county income ($) county income ($) Alameda 45,689 Treutlen 18,840 phospotassium Ventura 42,746 Effingham 28,443 Phosphorus (mg) 424 14 36 121 395 0 927 222 143 Napa 47,491 Echols 19,171 97 66 31 140 142 0 110 89 131 Solano 35,074 Wilcox 21,546 54 71 7 129 56 117 34 Yolo 31,990 Whitfield 29,838 Potassium (mg) 106 387 627 237 66 31 50 103 18 Tulare 24,153 Monroe 30,352 265 271 62 17 132 302 7 336 San Benito 32,472 Fannin 25,020 292 298 278 Colusa 25,201 Henry 26,876 Source: U.S. Department of Agriculture. Santa Clara 55,735 Liberty 24,216 Monterey 38,373 Stephens 25,931 20. Income in California and Georgia. The following table contains the per capita personal income for independent Shasta 30,762 Dooly 21,228 random samples of counties in California and Georgia. Test San Mateo 66,839 whether the population median per capita personal income Source: U.S. Bureau of Economic Analysis.

14.5 Kruskal-Wallis Test

OBJECTIVE By the end of this section, I will be able to . . . 1 Perform the Kruskal-Wallis test for equal medians in three or more populations.

In Section 14.4, we learned the Wilcoxon rank sum test, which tests whether the popu- lation medians of two independent random samples are equal. Here, in Section 14.5, we extend this method from two populations to three or more populations.

1 Kruskal-Wallis Test for Equal Medians in Three or More Populations The Kruskal-Wallis test is used to determine whether the population medians of three or more independent random samples are equal. In Chapter 12, we learned how to perform (ANOVA), which is a hypothesis test to determine if the population means of three or more populations are equal. However, ANOVA requires that each population be normally distributed. The Kruskal-Wallis test is less strict, in that it does not require that the populations be normally distributed. Thus, the Kruskal- Wallis test is more widely applicable than is ANOVA.

The Kruskal-Wallis test is a nonparametric hypothesis test in which the original data from three or more independent samples are transformed into their ranks. It tests whether the population medians are all equal.

To calculate the test statistic for the Kruskal-Wallis test, we temporarily combine all the data values from all the samples and find the ranks of the combined data values.

Larose_3e_ch14.indd 36 10/30/15 11:03 AM 14-37 Chapter 14 Nonparametric Statistics

So far, this is exactly what we did for the Wilcoxon rank sum test, except that now we have k (three or more) samples instead of just two samples. Then the ranks are summed separately for each of the k samples.

R1 5 the sum of the ranks for the first sample

R2 5 the sum of the ranks for the second sample, and so on, until :

Rk 5 the sum of the ranks for the kth (last) sample

Let n1, n2, . . . , nk represent the sample sizes for samples 1, 2, . . . , k, respectively. And let N represent the total number of data values in all the samples combined; that is, . . . N 5 n1 1 n2 1 1 nk. To perform the Kruskal-Wallis test, each of the sample sizes

n1, n2, . . . , nk must be at least 5. Then the Kruskal-Wallis test statistic is given by R2 R2 R2 2 12 1 2 k xdata 5 1 1 ? ? ? 1 2 3sN 1 1d NsN 1 1d1 n1 n2 nk2

2 2 When the conditions are met, xdata follows a x distribution with k 2 1 degrees of freedom.

Example 16 Calculating the Kruskal-Wallis test statistic The U.S. Small Business Administration publishes the number of small businesses in medium-size cities. We are interested in testing whether the population median num- ber of small businesses per city is the same in Florida, North Carolina, and Texas. For the following independent random samples given in the table below, calculate the test statistic for the Kruskal-Wallis test, using these steps: a. Temporarily combine the three samples and arrange them in increasing order. Then rank the data values from smallest to largest. Resolve ties using the mean rank, as we have done in the previous sections. b. Calculate the sum of the ranks for each sample, R , R , and R . citybusiness 1 2 3 2 c. Finally, calculate xdata.

Number North Number of Number of small Carolina small of small Florida city businesses city businesses Texas city businesses Gainesville 3,718 Asheville 4,883 El Paso 8,150 Tallahassee 4,948 Wilmington 5,825 Lubbock 4,403 Daytona Beach 9,489 Greenville 2,153 Killeen 3,274 Melbourne 8,771 Fayetteville 3,424 College Station 2,276 Sarasota 13,729 Rocky Mount 2,108 Laredo 3,070 Lakeland 6,865 Amarillo 3,855 Naples 7,184

Solution a. The combined data, and their ranks, are shown here. Combined data 2,108 2,153 2,276 3,070 3,274 3,424 3,718 3,855 4,403 Rank 1 2 3 4 5 6 7 8 9 Combined data 4,883 4,948 5,825 6,865 7,184 8,150 8,771 9,489 13,729 Rank 10 11 12 13 14 15 16 17 18

Larose_3e_ch14.indd 37 10/30/15 11:03 AM 14.5 Kruskal-Wallis Test 14-38

b. The sum of the ranks for Florida is

R1 5 7 1 11 1 13 1 14 1 16 1 17 1 18 5 96 The sum of the ranks for North Carolina is

R2 5 1 1 2 1 6 1 10 1 12 5 31 The sum of the ranks for Texas is

R3 5 3 1 4 1 5 1 8 1 9 1 15 5 44 Also, there are 7 cities in the Florida sample, 5 cities in the North Carolina sample, and

6 cities in the Texas sample, so that n1 5 7, n2 5 5, and n3 5 6, and the total sample size is N 5 7 1 5 1 6 5 18. c. Finally, the value of the test statistic is

12 R2 R2 R2 2 1 2 Á k xdata 5 1 1 1 2 3sN 1 1d NsN 1 1d 1 n1 n2 nk 2 12 962 312 442 5 1 1 2 3s19d ≅ 7.261 18s19d 1 7 5 6 2

NOW YOU CAN DO Later, we will find out if this value for the test statistic warrants rejection of the null Exercises 7–14. hypothesis. But first, we need to learn the hypotheses for the Kruskal-Wallis test.

Recall from Chapter 12 that the null hypothesis for ANOVA is that all population means are equal, and that the alternative hypothesis is that not all the population means are equal. The hypotheses for the Kruskal-Wallis test are the same, except that we are testing for medians instead of means.

Hypotheses for the Kruskal-Wallis Test

H0 : The population medians are all equal.

Ha : Not all the population medians are equal.

Next, we will summarize the steps for performing the Kruskal-Wallis test for the equality of three or more population medians.

Kruskal-Wallis Test for k Independent Samples The requirements are (a) there are k $ 3 independent samples, each randomly selected, and (b) there are at least 5 data values in each sample. It is not required that the populations be normally distributed. Step 1 state the hypotheses.

H0 : The population medians are all equal.

Ha : Not all the population medians are equal.

2 2 Step 2 Find the x critical value xcrit and state the rejection rule. Use Appendix Table E. Select the column with “Area to the right of critical value” equal a x2 to the given level of significance . The value of crit is in the row with degrees of freedom k 2 1. The Kruskal-Wallis test is always a right-tailed test, so that the rejection x2 $ x2 rule is always to reject H0 if data crit.

Larose_3e_ch14.indd 38 10/30/15 11:03 AM 14-39 Chapter 14 Nonparametric Statistics

2 Step 3 Find the value of the test statistic xdata.

12 R2 R2 R2 x2 5 1 1 2 1 ? ? ? 1 k 2 3sN 1 1d data NsN 1 1d1 n n n 2 1 2 k where 5 R1 the sum of the ranks for the first sample 5 R2 the sum of the ranks for the second sample, and so on, until o

Rk 5 the sum of the ranks for the kth (last) sample

and where n1, n2, . . ., nk represent the sample sizes for samples 1, 2, . . . , k, 5 1 1 . . . 1 respectively, and N n1 n2 nk Step 4 state the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule.

Example 17 Performing the Kruskal-Wallis test Use the data in Example 16 to test whether the population median number of small businesses per city is the same in Florida, North Carolina, and Texas. Use the Kruskal- Wallis test with level of significance a 5 0.05. Solution Each sample is independent and randomly selected, and each sample has at least five data values. Thus, the conditions for the Kruskal-Wallis test are met, and we may pro- ceed with the hypothesis test. Step 1 State the hypotheses.

H0 : The population median numbers of small businesses per city are all equal.

Ha : Not all the population median numbers of small businesses per city are equal.

2 2 Step 2 Find the x critical value xcrit and state the rejection rule. We have level of significance a 5 0.05. There are k 5 3 samples, so our degrees of freedom equals k 2 1 5 3 2 1 5 2. Using Appendix Table E, we select the column headed “0.05” and 2 the row with degrees of freedom 5 2. This gives us xcrit 5 5.991 (see Figure 18). The 2 rejection rule is to reject H0 if xdata $ 5.991.

Area to the right of critical value Degrees of freedom 0.995 0.99 0.975 0.95 0.90 0.10 0.05 0.025 0.01 0.005 1 — — 0.001 0.004 0.016 2.706 3.841 5.024 6.635 7.879 2 0.010 0.020 0.051 0.103 0.211 4.605 5.991 7.378 9.210 10.597

Figure 18 Finding the x2 critical value for the Kruskal-Wallis test.

2 Step 3 Find the value of the test statistic x data. From Example 16, we have 2 xdata ≈ 7.261. NOW YOU CAN DO Step 4 State the conclusion and the interpretation. Because 7.261 $ 5.991, we reject H0. Evidence exists that not all the population median numbers of small Exercises 15–18. businesses per city are equal for Florida, North Carolina, and Texas.

Larose_3e_ch14.indd 39 10/30/15 11:03 AM 14.5 Kruskal-Wallis Test 14-40

Example 18 Performing the Kruskal-Wallis test using technology Recall the Chapter 12 Case Study, which investigated whether the amount of informa- tion a professor posts about himself or herself (that is, self-disclosure) on the online social network Facebook is related to student motivation.10 A professor constructed three different Facebook sites: one offering low self-disclosure, one offering medium self-disclosure, and one offering high self-disclosure. Study participants (students not enrolled in the professor’s courses) were then randomly and independently assigned to access and browse one of the three Facebook sites, develop an impression of the professor, and complete the research . Student motivation was measured using a set of 16 items, and the sum of the 16 items was calculated to form the total motivation score. Use technology and the Kruskal-Wallis test at level of significance a 5 0.01 to test whether the population median motivation scores are equal for the three types of Facebook pages (low, medium, and high self-disclosure). There were 43 © Elena Elisseeva/SuperFusion/SuperStock students assigned to the low-disclosure page, 43 assigned to the medium-disclosure page, and 44 assigned to the high-disclosure page.

Solution Each sample is independent and randomly selected, and there are at least five data values in each sample. Thus, the conditions for the Kruskal-Wallis test are met, and we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : The population median motivation scores are all equal.

Ha : Not all the population median motivation scores are equal.

2 2 Step 2 Find the x critical value xcrit and state the rejection rule. We have level of significance a 5 0.01. There are k 5 3 samples, so our degrees of freedom equals 2 k 2 1 5 3 2 1 5 2. Using Appendix Table E, we find xcrit 5 9.210. The rejection rule 2 is to reject H0 if xdata $ 9.210. 2 Step 3 Find the value of the test statistic xdata. We use the instructions in the Step- by-Step Technology Guide at the end of this section. Figure 19 shows the Minitab results from the Kruskal-Wallis test applied to the Facebook data. Figure 20 shows the 2 output from the same test in JMP. Minitab denotes xdata as “H” (use the one that is 2 adjusted for ties). Thus, from Figure 19, xdata 5 15.79.

FIGURE 19 Minitab Kruskal-Wallis results. FIGURE 20 JMP Kruskal-Wallis results.

Step 4 State the conclusion and the interpretation. Because 15.29 . 9.210, we reject

H0. There is evidence that not all the population median motivation scores are equal for the low-disclosure, medium-disclosure, and high-disclosure Facebook pages.

Larose_3e_ch14.indd 40 10/30/15 11:03 AM 14-41 Chapter 14 Nonparametric Statistics

STEP-BY-STEP TECHNOLOGY GUIDE: Kruskal-Wallis Test Neither TI-83/84 calculators nor Excel have a built-in function for the Kruskal-Wallis test.

MINITAB We use Example 18 to illustrate. Step 2 Click Stat > Nonparametrics > Kruskal-Wallis…. Step 1 Enter the Motivation values for all samples in C1 and Step 3 For Response, type C1. For Factor, type C2. Click OK. the group label in C2. The group data indicate which sample the Output is shown in Figure 19 of Example 18. response data values are drawn from.

SPSS Step 1 Enter the Motivation data in the first column. Enter a numeric code for the self-disclosure level in the second column. Step 2 Under the Variable View tab, rename the columns Motivation and Group. Assign Decimals of 0 for Group. Change Measure to Scale for Motivation and Nominal for Group. Step 3 Click Analyze > Non-parametric Tests > Independent Samples… . Step 4 Under the Fields tab, move Motivation to Test Fields and Group to Groups. Step 5 Under the Settings tab, click Customize tests and select Kruskal-Wallis 1-way ANOVA (k samples). Click Run. Step 6 Double-click the output to bring up the Model Viewer window. Observe the results on the right-hand side, shown in Figure 21.

FIGURE 21 SPSS results.

JMP Step 1 Enter the motivation score in the first column. Enter a Step 4 Select the red triangle beside “One-Way Analysis of numeric code for the self-disclosure level in the second column. Motivation by Group,” click Nonparametric, and select Wilcoxon Step 2 Rename the columns Motivation and Group. Right-click Test. Output for the Kruskal-Wallis Tests appears, under the Group, select Column Info… and change Data Type to Character. heading Wilcoxon/Kruskal-Wallis Tests. See Figure 20 in Step 3 Click Analyze > Fit Y by X. Move Motivation to Y, Example 18. Response and Group to X, Factor. Click OK.

CRUNCHIT! For data with groups in different columns (unstacked data): Step 1 Select Statistics, highlight Non-parametrics, and select Step 1 Select Statistics, highlight Non-parametrics, and select Kruskal-Wallis. Kruskal-Wallis. Step 2 Select the Grouped tab. For Data, select the column Step 2 In the Columns tab, select the columns that contain the that contains the data. For Group by, select the column that data. Click Calculate. contains the group labels. Click Calculate. For data with values in one column and groups in another column (stacked data):

Larose_3e_ch14.indd 41 10/30/15 11:03 AM 14.5 Kruskal-Wallis Test 14-42

Section 14.5 Summary 1. The Kruskal-Wallis test tests whether the medians of k combined data values are calculated. Then the ranks are independent samples are equal. In the Kruskal-Wallis test, summed separately for each sample. These sums are used to the k samples are temporarily combined, and the ranks of the calculate the test statistic for this test.

Section 14.5 Exercises

CLARIFYING THE CONCEPTS 10. Sample 1 113 186 162 122 197 190 1. Explain how the Kruskal-Wallis test is an extension of Sample 2 127 197 178 102 162 144 the Wilcoxon rank sum test from Section 14.4. (p. 14-37) Sample 3 120 142 198 167 165 156 178 2. What is the difference between the Kruskal-Wallis test and the analysis of variance (ANOVA) from Chapter 12? (p. 14-36) Sample 4 167 102 122 113 109 3. True or false: To calculate the test statistic for the Sample 5 124 138 187 109 100 159 142 Kruskal-Wallis test, we temporarily combine all the data 2 values from all the samples and find the ranks of the For Exercises 11–14, calculate xdata. combined data values, just as we did in Section 14.4 for the 11. Use the data and the statistics you calculated in Exercise 7. Wilcoxon rank sum test. (p. 14-39) 12. Use the data and the statistics you calculated in Exercise 8. 4. What is the meaning of the notation k for the Kruskal- 13. Use the data and the statistics you calculated in Exercise 9. Wallis test? (p. 14-38) 14. Use the data and the statistics you calculated in Exercise 10. 5. Explain what the notation N means for the Kruskal- For Exercises 15–18, we are interested in whether the Wallis test. (p. 14-39) population medians differ. Do the following: 6. When the conditions are met, what distribution does the a. State the hypotheses. test statistic for the Kruskal-Wallis test follow? (p. 14-37) 2 b. Find the critical value xcrit and state the rejection rule. 2 c. Find the value of the test statistic xdata. PRACTICING THE TECHNIQUES d. State the conclusion and the interpretation. 15. Use the data in Exercise 7 and the value you calculated • CHECK IT OUT! 2 for xdata in Exercise 11. Use level of significance a 5 0.05. To do Check out Topic 16. Use the data in Exercise 8 and the value you calculated for x2 in Exercise 12. Use level of significance a 5 0.05. Exercises 7–14 Example 16 Calculating the data Kruskal-Wallis test 17. Use the data in Exercise 9 and the value you calculated 2 statistic for x data in Exercise 13. Use level of significance a 5 0.01. 18. Use the data in Exercise 10 and the value you calculated Exercises 15–18 Example 17 Performing the for x2 in Exercise 14. Use level of significance a 5 0.01. Kruskal-Wallis test data APPLYING THE CONCEPTS For Exercises 7–10, calculate R , the sum of the ranks for the 1 19. Student-Run Café Business. In Chapter 2, Example 8, first sample, R , R , and, if appropriate, R and R . Also find 2 3 4 5 we looked at data from a student-run café business. The the sample sizes and the total sample size. The data represent table contains the number of food items sold per day. Test independent random samples. whether the population median number of items sold is the 7. Sample 1 2 3 4 5 5 same for wraps, muffins, and chips, using level of significance a 5 0.05. Sample 2 6 9 10 7 9 cafeanova Sample 3 5 3 3 1 2 Wraps Muffins Chips 8. Sample 1 9 6 8 3 1 12 6 7 13 3 16 Sample 2 6 7 4 10 9 19 10 8 Sample 3 9 3 10 1 2 5 1 4 9. Sample 1 184 152 168 164 183 143 22 8 10 Sample 2 193 182 112 155 145 20. The Pros versus the Darts. In the Chapter 3 Case Sample 3 144 149 150 112 127 133 Study, we examined stock market returns for professional Sample 4 129 172 193 172 162 187 financial analysts, compared with random darts and the Dow Jones Industrial Average (DJIA). The table contains daily Sample 5 158 152 137 172 114 stock market returns. Test whether the population median

Larose_3e_ch14.indd 42 10/30/15 11:03 AM 14-43 Chapter 14 Nonparametric Statistics

stock market returns are the same across all three groups, States, Canada, and Mexico. Use level of significance using level of significance a 5 0.01. prosdartsanova a 5 0.01. infantmortality Pros Darts DJIA U.S. state Infant mortality rate 10.6 20.6 4.4 California 5.8 27.8 18.5 11.2 29.1 1.8 3.7 Florida 7.2 2.2 11.7 17.6 Georgia 8.5 14.1 1.8 0.2 Illinois 8.4 Pennsylvania 7.1 21. Weight and Age. The Chapter 4 Case Study looked at Texas 6.4 body measurements for physically fit males and females. Is there a difference in weight among different age groups? The Virginia 7.7 table contains the weights of five randomly chosen females from each of three age groups: younger (18–22), middle Canadian province Infant mortality rate (23–30), and older (311). Test whether the population median weight is the same for younger, middle, and older females, Alberta 4.8 Manitoba 7.5 using level of significance a 5 0.05. weightages Nova Scotia 4.4 Younger Middle Older Ontario 5.5 119.0 142.9 121.3 Quebec 5.6 124.8 104.3 107.4 130.7 115.1 169.3 130.1 98.8 122.8 Mexican state Infant mortality rate 155.4 110.2 155.4 Campeche 26.0 Chihuahua 23.4 22. The Full Moon and Emergency Room Visits. Is there Sonora 22.6 a difference in emergency room visits before, during, and Tabasco 25.3 after a full moon? A study looked at the admission rate (number of patients per day) to the emergency room of a Veracruz 28.0 Virginia mental health clinic over a series of 12 full moons. Yucatan 27.0 The data are provided in the table. Assume the data represent Source: The Poverty Mapping Project at the Earth Institute independent random samples. Is there evidence of a at Columbia University. difference in emergency room visits before, during, and after the full moon? Test whether the population median number 24. Environmental Performance Index. The of emergency room visits is the same before, during, and Environmental Performance Index (EPI) is a measure of a after a full moon, using level of significance a 5 0.05. nation’s commitment to environmental protection and global fullmoon sustainability. Data for 2008 were released at the World Economic Summit’s annual meeting in Davos, Switzerland. Before During After The following data represent independent random samples 6.4 11.5 5 13 5.8 13.5 of the EPI ratings for nations from four continental regions. Test whether the population median EPI is the same in 7.1 13.8 13 16 9.2 13.1 the four continental regions, using level of significance 6.5 15.4 14 25 7.9 15.8 a 5 0.05. epirating 8.6 15.7 12 14 7.7 13.3 8.1 11.7 6 14 11.0 12.8 Americas EPI European Union EPI 10.4 15.8 9 20 12.9 14.5 Canada 88.3 France 87.8 Brazil 82.7 Germany 86.3 23. Global Infant Mortality. The following data set represents the infant mortality rate for states or provinces in USA 81.0 United Kingdom 86.3 the United States, Canada, and Mexico. The infant mortality Mexico 79.8 Portugal 85.8 rate is defined as the number of children who die before their Jamaica 79.1 Italy 84.2 first birthday, for every 1000 live births. The data represent Spain 83.1 independent random samples. Test whether the population median infant mortality rate is the same for the United Ireland 82.7

Larose_3e_ch14.indd 43 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-44

Sub-Saharan Africa EPI Asia and Pacific EPI Nutritional Kenya 69.0 Japan 84.5 Cereal Manufacturer rating South Africa 69.0 Taiwan 80.8 Kix General Mills 39.2411 Ethiopia 58.8 Australia 79.8 Double Chex Ralston-Purina 44.3309 Rwanda 54.9 Vietnam 73.9 Triples General Mills 39.1062 Chad 45.9 China 65.1 Rice Chex Ralston-Purina 41.9989 India 60.3 Raisin Nut Bran General Mills 39.7034 Source: Yale Center for Environmental Law and Policy. Just Right Crunchy Kellogg’s 36.5237 Nuggets 25. The data in the accompanying table represent the Raisin Bran Kellogg’s 39.2592 nutritional ratings of breakfast cereals for three manufacturer Frosted Flakes Kellogg’s 31.4360 brands.11 The data were selected independently and Cinnamon Toast Crunch General Mills 19.8236 randomly. Test whether the population median nutritional Almond Delight Ralston-Purina 34.3848 rating differs by manufacturer, using level of significance a 5 0.05. cerealnutrition 26. Ant Sizes. A study compared the sizes of ants from different colonies. Researchers measured the masses Nutritional ratings of breakfast cereals (in milligrams) of random samples of ants from three different colonies, which were selected independently. The Nutritional samples are shown here. Test whether the population median Cereal Manufacturer rating sizes differ in the three ant colonies, using level of Just Right Fruit & Nut Kellogg’s 36.4715 significance a 5 0.05. antcolony Corn Chex Ralston-Purina 41.4450 Count Chocula General Mills 22.3965 Colony Size Colony Size Colony Size Colony Size Rice Krispies Kellogg’s 40.5602 3 78 2 59 2 77 1 75 Wheat Chex Ralston-Purina 49.7874 3 89 2 74 3 116 1 87 Product 19 Kellogg’s 41.5035 1 78 1 43 3 29 3 144 Honey Nut Cheerios General Mills 31.0722 2 111 1 130 3 153 1 112 Apple Jacks Kellogg’s 33.1741 2 147 3 122 3 93 1 65

14.6 Rank Correlation Test

ObjectiveS By the end of this section, I will be able to . . . 1 Perform the rank correlation test for paired data.

In Chapter 4, we learned how to calculate the , which measures the strength of the linear association between two numerical variables. Here, in Sec- tion 14.6, we will learn how to calculate the rank correlation of two variables, which is the correlation of the variables based on ranks. We will also learn how to test whether the rank correlation between the variables is significant. 1 Rank Correlation Test Similar to many nonparametric tests, the rank correlation test is a nonparametric hypothesis test that uses data that are ranked.

The rank correlation test (also called Spearman’s rank correlation test) is based on the ranks of matched-pair data. This test may also be applied when the original data are ranks. In the rank correlation test we investigate whether two variables are related by analyzing the ranks of matched-pair data. The rank correlation test may also be used to detect a nonlinear relationship between two variables.

Larose_3e_ch14.indd 44 10/30/15 11:03 AM 14-45 Chapter 14 Nonparametric Statistics

The hypotheses are

H0: No rank correlation exists between the two variables.

Ha: A rank correlation exists between the two variables. The advantages to using the rank correlation test are that (a) it can be applied to ranked data, whereas linear correlation cannot, (b) it does not require normality, and (c) it can sometimes be used to uncover nonlinear relationships. A disadvantage of using the rank correlation test is that its efficiency rating is 0.91. That is, 100 data val- ues are needed to achieve the same power that a linear correlation test achieves with only 91 data values, when the conditions for both tests are met. To find the test statistic, we must calculate and square the paired differences of the ranks, a procedure shown in the next example.

Example 19 Calculating the test statistic for the rank correlation test

femaleliteracy The fertility rate is the mean number of children born to a typical woman in the country, and the female literacy rate is the percentage of women at least 15 years old who can read and write. The table contains the female literacy rate (in percent) and the fertility rate (in numbers of children) for a random sample of 10 countries.

Country Female literacy Fertility Afghanistan 21 6.69 India 48 2.73 Sudan 51 4.72 Saudi Arabia 71 4.00 South Africa 86 2.20 China 87 1.73 Israel 94 2.41 Italy 98 1.28 United States 99 2.09 Poland 100 1.25 ImagesBazaar/Getty Images ImagesBazaar/Getty Calculate the test statistic for the rank correlation test, using the following steps: a. Rank the values of the first variable (female literacy) from lowest to highest. b. Rank the values of the second variable (fertility) from lowest to highest. c. For each subject (country), find the difference in ranks, d, and square the difference in ranks to get d2. Add up the d2-values to get d2.

d. Complete the calculation of the test statistic rdata:

6 d2 r 5 1 2 o data nsn2 2 1d where n represents the sample size (number of matched pairs).

Solution

Table 15 contains the calculations needed to find rdata.

Larose_3e_ch14.indd 45 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-46

Table 15 Table of calculations to find d 2 Female Literacy Fertility Difference Country literacy Fertility rank rank d d 2 Afghanistan 21 6.69 1 10 29 81 India 48 2.73 2 7 25 25 Sudan 51 4.72 3 9 26 36 Saudi Arabia 71 4.00 4 8 24 16 South Africa 86 2.20 5 5 0 0 China 87 1.73 6 3 3 9 Israel 94 2.41 7 6 1 1 Italy 98 1.28 8 2 6 36 United States 99 2.09 9 4 5 25 Poland 100 1.25 10 1 9 81 d 2 5 310

Because there are n 5 10 countries, the value of the test statistic is given by

6 d2 6s310d r 5 1 2 o 5 1 2 < 20.8788 data nsn2 2 1d 10s99d NOW YOU CAN DO Exercises 9–12. We now present the steps for performing the rank correlation test.

Rank Correlation Test The sample paired data must be randomly selected. There is no requirement of normality. Step 1 state the hypotheses.

H0 : No rank correlation exists between the two variables.

Ha : A rank correlation exists between the two variables. Step 2 Find the critical value and state the rejection rule. ● Small-Sample Case (n # 30): Use Appendix Table K. Select the column with the appropriate level of significance a and the row with the appropriate sample size n. $ The rejection rule for the rank correlation test is always to reject H0 if rdata rcrit or if # rdata –rcrit. ● Large-Sample Case (n . 30): A normal approximation is used. The critical value Zcrit and the rejection rule are given in Table 16.

Table 16 Critical values and rejection rule for the rank correlation test, large-sample case

Level of significance a Critical value Zcrit Rejection rule

0.10 1.645yÏn 2 1 Reject H0 if

0.05 1.96yÏn 2 1 Zdata # 2Zcrit

0.01 2.58yÏn 2 1 or if Zdata $ Zcrit

Step 3 Find the value of the test statistic. ● small-Sample Case (n # 30): Use the following steps, preferably with a table similar to Table 15. If the original data already consist of ranks, then skip Steps a and b. a. Rank the values of the first variable from lowest to highest.

Larose_3e_ch14.indd 46 10/30/15 11:03 AM 14-47 Chapter 14 Nonparametric Statistics

b. Rank the values of the second variable from lowest to highest. c. For each subject, find the difference in ranks, d, and square the difference in ranks to get d2. Add up the d2-values to get d2. d. Complete the calculation of the test statistic: 6 d2 r 5 1 2 o data nsn2 2 1d where n represents the sample size (number of matched pairs). ● Large-Sample Case (n . 30): Use Steps a–d from the small-sample case. However,

we are using a normal approximation, so the test statistic is called Zdata.

6 d2 z 5 1 2 o data nsn2 2 1d Step 4 state the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule.

Example 20 Performing the rank correlation test Use the data in Example 19 to test whether a rank correlation exists between female literacy and fertility. Use level of significance a 5 0.01. Solution The data come from a random sample, so we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : No rank correlation exists between female literacy and fertility.

Ha : A rank correlation exists between female literacy and fertility.

Step 2 Find the critical value and state the rejection rule. There are n 5 10 countries in the data set in Table 15, so we apply the small-sample case (n # 30). Use Appendix Table K. We select the column with level of significance a 5 0.01 and the

row with n 5 10. Our critical value is rcrit 5 0.794 (see Figure 22). We will reject H0 if

rdata $ 0.794 or if rdata # 20.794.

n a 5 0.10 a 5 0.05 a 5 0.02 a 5 0.01 5 0.900 * * * 6 0.829 0.886 0.943 * 7 0.714 0.786 0.893 0.929 8 0.643 0.738 0.833 0.881 9 0.600 0.700 0.783 0.833 10 0.564 0.648 0.745 0.794

Figure 22 Finding the critical value rcrit for the rank correlation test.

Step 3 Find the value of the test statistic rdata. In Example 19, we found rdata ≈ 20.8788. Step 4 State the conclusion and the interpretation. Because 20.8788 # 20.794,

our conclusion is to reject H0. There is evidence for a rank correlation between female

literacy and fertility. Because rdata is negative, the association between female literacy NOW YOU CAN DO and fertility is a negative relationship. That is, as female literacy increases, fertility Exercises 13–20. tends to decrease, and vice versa.

Larose_3e_ch14.indd 47 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-48

Example 21 Rank correlation test: Large-sample case Expand the previous example from n 5 10 countries to a random sample of n 5 37 countries, and conduct the same hypothesis test, using the same level of significance

a 5 0.01. Assume that the 37 countries yield a test statistic of Zdata 5 20.831. Solution The expanded data set comes from a random sample, so we proceed with the hypoth- esis test. Step 1 State the hypotheses.

H0 : No rank correlation exists between female literacy and fertility.

Ha : A rank correlation exists between female literacy and fertility. Step 2 Find the critical value and state the rejection rule. There are now n 5 37 countries, so we apply the large-sample case (n . 30). With level of significance a 5

0.01, we find our critical value Zcrit from Table 16: 2.58 Z 5 5 0.43 crit Ï37 2 1

We will reject H0 if Zdata $ 0.43 or if Zdata # 20.43.

Step 3 Find the value of the test statistic rdata. We use the instructions provided in the Step-by-Step Technology Guide at the end of this section. Figure 23 shows the

Minitab results, with rdata denoted as “Pearson correlation of female literacy and fertility 5 20.831.” Although Minitab thus identifies the statistic as the linear correlation coefficient for numerical data that we learned in Chapter 4, this statistic is nevertheless equal to the rank correlation coefficient, because it is based on ranks.

Correlations: C12, C13

Pearson correlation of female literacy and fertility = -0.831 P–Value = 0.000

Figure 23 Minitab results.

Step 4 State the conclusion and the interpretation. Because 20.831 # 20.43, we

reject H0, just as we did for the small-sample case. There is evidence for a rank correlation between female literacy and fertility.

Example 22 Using rank correlation to detect a nonlinear pattern In the Chapter 13 Case Study, “How Fair Is the Scoring in Scrabble?” we noted from scrabble a scatterplot of Scrabble point values versus English-language letter frequencies that the relationship between the variables was not linear. Thus, we could not use a analysis. However, we can use rank correlation to test whether the two vari- ables are associated, because linearity is not a condition for applying the rank correla- tion test. For the following random sample of letters, use the rank correlation test to investi- gate whether an association exists between English-language frequencies and Scrabble point values. Use level of significance a 5 0.05. Note from Figure 24 that the relation- ship between the variables is certainly nonlinear.

Larose_3e_ch14.indd 48 10/30/15 11:03 AM 14-49 Chapter 14 Nonparametric Statistics

Letter Frequency Scrabble points 10 Q X Q 0.003 10 8 L 0.035 1 6 G 0.016 2 K E 0.130 1 4 G

X 0.005 8 in Scrabble Points 2 L S T E T 0.093 1 0 S 0.063 1 0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 K 0.003 5 Relative frequency in English language

Figure 24 A linear relationship. Solution The data come from a random sample, so we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : No rank correlation exists between language frequency and Scrabble points.

Ha : A rank correlation exists between language frequency and Scrabble points. Step 2 Find the critical value and state the rejection rule. There are n 5 8 letters in the random sample, so we apply the small-sample case (n # 30). Using Appendix Table K, we select the column with level of significance a 5 0.05 and the row with n 5 8. Our

critical value is rcrit 5 0.738. We will reject H0 if rdata $ 0.738 or if rdata # 20.738.

Step 3 Find the value of the test statistic. See Table 17.

Table 17 Table of calculations to find Sd2 Scrabble Frequency Scrabble Difference Letter Frequency points rank rank d d2 Q 0.003 10 1.5 8 26.5 42.25 L 0.035 1 5 2.5 2.5 6.25 G 0.016 2 4 5 21 1 E 0.130 1 8 2.5 5.5 30.25 X 0.005 8 3 7 24 16 T 0.093 1 7 2.5 4.5 20.25 S 0.063 1 6 2.5 3.5 12.25 K 0.003 5 1.5 6 24.5 20.25 Sd 2 5 148.5

There are n 5 8 letters in the sample, so the value of the test statistic is given by

6 d2 6s148.5d r 5 1 2 o 5 1 2 ≅ 20.7679 data nsn2 2 1d 8s63d

Step 4 State the conclusion and the interpretation. Because 20.7679 # 20.738,

we reject H0. There is evidence for a rank correlation between the frequency of letters in the English language and the number of points each letter is worth in the game of

Scrabble. Because rdata is negative, the relationship is also negative. That is, high point values are associated with low frequency in English, and vice versa.

Larose_3e_ch14.indd 49 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-50

Does a Rank Correlation Exist Between the 2007

case and 2014 Vehicle Gas Mileages? study We return to the random sample of 14 vehicle gas mileages (shown below in Table 18) for the Chapter 14 Case Study. Recall that we are dealing with matched-pair data, comparing the miles per gallon (mpg) for the same vehicles from two different years. In Section 14.2, we tested whether the median gas mileage increased. However, the data take the form of matched pairs, so we can also investigate whether an associa- tion exists between the 2007 and 2014 vehicle gas mileages using the rank correlation test. Test whether a rank correlation exists between the 2007 mpg and the 2014 mpg, using level of significance a 5 0.01.

Table 18 Table of calculations to find d2 Combined mpg Combined mpg 2000 mpg 2007 mpg Difference Make Model for 2007 for 2014 rank rank d d2 Chevrolet Tahoe 17 17 4.5 3 1.5 2.25 Chevrolet Suburban 17 17 4.5 3 1.5 2.25 Dodge Caravan 21 20 8.5 8 0.5 0.25 Ford Explorer 17 19 4.5 6.5 −2 4 Ford F150 Pickup 16 18 1 5 −4 16 Ford Mustang 17 19 4.5 6.5 −2 4 Ford Taurus 23 21 10 9 1 1 GMC Savana Cargo 17 16 4.5 1 3.5 12.25 GMC Yukon XL 17 17 4.5 3 1.5 2.25 Subaru Forester 25 27 12 12 0 0 Subaru Impreza 25 27 12 12 0 0 Subaru Legacy 25 27 12 12 0 0 Toyota Corolla 36 35 14 14 0 0 Toyota Tacoma 21 23 8.5 10 −1.5 2.25

What Result Might We Expect? Consider Figure 25, which shows a scatterplot of the 2014 mpg versus the 2007 vehicle mpg. There appears to be a rather strong positive relationship between the two variables, and thus a strong correlation. We would therefore expect to reject the null hypothesis that there is no rank correlation.

35

30

25 2014 mpg

20

15 15 20 25 30 35 2007 mpg

Figure 25 Scatterplot of 2014 versus 2007 vehicle mpg.

Larose_3e_ch14.indd 50 10/30/15 11:03 AM 14-51 Chapter 14 Nonparametric Statistics

S olution The data come from a random sample of matched pairs, so we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : No rank correlation exists between the 2007 mpg and the 2014 mpg.

Ha : A rank correlation exists between the 2007 mpg and the 2014 mpg.

Step 2 Find the critical value rcrit and state the rejection rule. There are n 5 14 vehicles in the data set, so we apply the small-sample case (n # 30). In Appendix Table K we select the column with level of significance a 5 0.01 and the row with n 5 14. Our

critical value is rcrit 5 0.679. We will reject H0 if rdata $ 0.679 or if rdata # 20.679.

2 Step 3 Find the value of the test statistic rdata. We use Table 18 to find d We have od 2 5 46.5 Then, because there are n 5 14 vehicles, the value of the test statistic is given by

6 d2 6s46.5d r 5 1 2 o 5 1 2 < 0.8978 data nsn2 2 1d 14s195d

Step 4 State the conclusion and the interpretation. Because rdata ≈ 0.8978 $

0.679, we reject H0. Evidence exists for a rank correlation between the 2007 vehicle

mpg and the 2014 vehicle mpg. Because rdata is positive, the association between 2007 and 2014 vehicle mpg is a positive relationship. In other words, vehicles that had low gas mileage in 2007 tended to have low gas mileage in 2014, while the vehicles that had high gas mileage in 2007 tended to have high gas mileage in 2014.

STEP-BY-STEP TECHNOLOGY GUIDE: Rank Correlation Test Although the TI-83/84 and Excel do not have a built-in function for the rank correlation test, we can find the rank correlation as follows: (a) for each data value in the first sample, substitute its rank within that sample, (b) for each data value in the second sample, substitute its rank within that sample, and (c) find the value of the correlation coefficient r (see Section 4.1) for the two sets of ranks.

TI-83/84 Step 1 Enter the ranks into lists L1 and L2. Make sure that the Step 3 Press STAT, and highlight CALC. Select LinReg(a+bx) two lists represent paired data; that is, the first value in L1 and press ENTER twice. The displayed value of r is the value of represents the same subject as the first value in L2, and so on. the rank correlation. Step 2 Press 2nd and then CATALOG. Scroll down to DiagnosticOn and press ENTER twice.

EXCEL Step 1 Enter the ranks into columns A and B. Make sure Step 2 In cell C1, type 5 CORREL(A1 : An, B1:Bn), where n is that the two lists represent paired data; that is, the first value in A replaced by the sample size for your data. Hit Enter. The represents the same subject as the first value in B, and so on. displayed value of r is the value of the rank correlation.

MINITAB Step 1 Enter the raw data values into columns C1 and C2. Step 2 Select Stat . Basic Statistics . Correlation… . Make sure that the two lists represent paired data; that is, the first Step 3 Enter C1 and C2 under Variables. Under Method, value in C1 represents the same subject as the first value in C2, choose Spearman rho and click OK. and so on.

Larose_3e_ch14.indd 51 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-52

SPSS Step 1 Enter the raw data values into the first two columns. Step 2 Select Analyze . Correlate . Bivariate… . Make sure that the two lists represent paired data; that is, the first Step 3 Move the two variables to Variables, uncheck Pearson, value in the first column represents the same subject as the first check Spearman, and click OK. value in the second column, and so on.

JMP Step 1 Click File > New > Data Table. Enter the raw data Step 2 Select Analyze . Multivariate Methods . Multivariate values into Column 1 and Column 2. Make sure that the two lists Step 3 Move the two variables to Y, Columns and click OK. represent paired data; that is, the first value in Column 1 represents Step 4 Click the red arrow beside Multivariate, highlight the same subject as the first value in Column 2, and so on. Nonparametric Correlations, and select Spearman’s r.

Section 14.6 Summary 1. The rank correlation test (also called Spearman’s rank the ranks of matched-pair data. The rank correlation test correlation test) is a nonparametric hypothesis test based on investigates whether the two variables are associated.

Section 14.6 Exercises CLARIFYING THE CONCEPTS For Exercises 9–12, you are given random samples of paired 1. What is the rank correlation test used for? (p. 14-44) data. Do the following: 2. Describe three advantages and one disadvantage to a. Rank the data within each sample, using our using the rank correlation test. (p. 14-45) convention for handling ties. 3. Is the rank correlation test used for dependent or b. Calculate the sum of the squared differences of the 2 independent samples? Explain. (p. 14-46) ranks, d . c. Compute the value of the test statistic rdata. 4. The test statistic rdata is based on the calculation of the 2 sum of the squared differences of the ranks, d . Explain the 9. Sample 1 7 1 1 0 4 3 steps involved in calculating d 2. (p. 14-45) Sample 2 6 1 6 9 9 10 5. What is the general form for the hypotheses for the rank correlation test? (p. 14-46) 10. Sample 1 8 10 2 9 9 7 6. In Chapter 13, we found that linear regression was not appropriate when the relationship between the variables was Sample 2 6 3 7 2 9 4 not linear. Does this condition also hold true for the rank 11. Sample 1 25 21 28 28 19 25 27 20 correlation test? (p. 14-48) 7. Suppose that two Olympic judges each rank five figure Sample 2 60 62 65 70 64 69 58 69 skaters from 1 through 5, and their are exactly 12. the same. What is the value of the sum of the squared Sample 1 31 29 24 24 27 20 37 32 2 Sample 2 38 59 54 70 54 60 54 52 differences d ? What is the value of the test statistic rdata? (pp. 14-45, 14-46) 8. Based on your answer to Exercise 7, what is the For Exercises 13–16, find the critical value rcrit. conclusion of the rank correlation test for association 13. Use the data from Exercise 9 and level of significance between the two judges? Explain. (p. 14-47) a 5 0.01. 14. Use the data from Exercise 10 and level of significance PRACTICING THE TECHNIQUES a 5 0.05. 15. Use the data from Exercise 11 and level of significance • CHECK IT OUT! a 5 0.10. To do Check out Topic 16. Use the data from Exercise 12 and level of significance Exercises 9–12 Example 19 Calculating the test a 5 0.05. statistic for the rank For Exercises 17–20, perform the rank correlation test for correlation test the indicated data sets. Exercises 13–20 Example 20 Performing the rank a. State the hypotheses.

correlation test b. Find the critical value rcrit and state the rejection rule.

Larose_3e_ch14.indd 52 10/30/15 11:03 AM 14-53 Chapter 14 Nonparametric Statistics

c. Calculate the test statistic rdata. (AP) poll and the USA Today poll. Test whether a rank d. State the conclusion and the interpretation. correlation exists between the two polls, using level of 17. Use the data and test statistic from Exercise 9, level of significance a 5 0.10. collegefootball

significance a 5 0.01, and rcrit from Exercise 13. 18. Use the data and test statistic from Exercise 10, level of College AP Poll USA Today Poll

significance a 5 0.05, and rcrit from Exercise 14. Florida State 1500 1475 19. Use the data and test statistic from Exercise 11, level of Auburn 1428 1388 significance a 5 0.10, and r from Exercise 15. crit Michigan State 1385 1375 20. Use the data and test statistic from Exercise 12, level of South Carolina 1247 1219 significance a 5 0.05, and r from Exercise 16. crit Missouri 1236 1200 APPLYING THE CONCEPTS Oklahoma 1205 1189 Alabama 1114 1086 21. Ranking the Presidents. A study asked a randomly selected group of liberal historians and a randomly selected Clemson 1078 1091 group of conservative historians to rank the presidents of the Oregon 974 975 United States since George Washington.12 Interestingly, both UCF 959 865 groups agreed on the top five presidents, but the rankings Stanford 936 872 were not exactly the same. The rankings for the top five are Ohio State 816 872 shown here. Test whether a rank correlation exists between Baylor 778 796 the liberal ranks and the conservative ranks, using level of LSU 717 719 significance a 5 0.10. Note that you need not calculate the Louisville 693 703 ranks, as the ranks are given. presidents UCLA 632 597 Oklahoma State 598 587 Conservative President Liberal rank rank Texas A&M 459 443 USC 299 313 Abraham Lincoln 1 1 Notre Dame 256 125 George Washington 3 2 Arizona State 255 302 Franklin Roosevelt 2 3 Wisconsin 245 266 Thomas Jefferson 4 4 Duke 190 202 Theodore Roosevelt 5 5 Vanderbilt 117 180 22. Best Countries for Business. The Web site www. 24. Population and Area. Does an association exist doingbusiness.org publishes rankings on the best countries for between the size (in square miles) of a nation and the doing business. The following data set represents a random number of people who live in that nation (the population)? sample of nations and their rankings in two categories: ease of The following data set represents a random sample of 12 doing business and ease of starting up a new business. Test countries and their areas and populations. Test whether a whether a rank correlation exists between the two categories, rank correlation exists between area and population, using using level of significance a 5 0.05. Note that you need not level of significance a 5 0.05. populationarea calculate the ranks, as the ranks are given. bestbusiness Area Ease of doing Ease of starting Nation (square miles) Population Nation business a new business Bangladesh 55,598 147,365,352 Ireland 2 2 United States 3,718,691 298,444,215 Japan 4 6 China 3,705,386 1,313,973,713 Canada 3 1 India 1,269,338 1,095,351,995 South Africa 5 4 Greece 50,942 10,688,058 United States 1 3 Canada 3,855,081 33,098,932 Mongolia 7 5 Japan 145,882 127,463,611 Mexico 6 7 Kazakhstan 1,049,150 15,233,244 Mexico 761,602 107,449,525 23. College Football. Different polls do not all show the Saudi Arabia 756,981 27,019,731 same rankings for the best teams in college football. The Singapore 267 4,492,150 table contains the points (calculated by votes received) for the top 24 teams for the 2013 season in the Associated Press Australia 2,967,893 20,264,082

Larose_3e_ch14.indd 53 10/30/15 11:03 AM 14.6 Rank Correlation Test 14-54

25. Video Game Ranking. GameRankings.com publishes Rank of summary statistics for reviews of video games. The overall Tuition following data set represents a random sample of video Community college quality and fees games and their average reviewer score for the PlayStation 3 platform and the Xbox 360 platform, as of January 23, 2009. Atlanta Technical College, GA 1 $1362 Test whether a rank correlation exists between the two game Cascadia Community College, WA 2 $2642 platforms, using level of significance a 5 0.10. Southern Univ. at Shreveport, LA 3 $2252 gameranking Southwestern CC, NC 4 $1171 Hazard CC, KY 5 $2616 PlayStation 3 Xbox 360 North Florida Community College, 6 $1910 mean reviewer mean reviewer FL Game score score Indianhead College, WI 7 $2912 Grand Theft Auto IV 0.9373 0.9656 Southeast Kentucky CC, KY 8 $2760 BioShock 0.9403 0.9525 Zane State College, OH 9 $3849 Call of Duty 4: 0.9378 0.9416 Modern Warfare Baldwin College, GA 10 $2098 Rock Band 0.9119 0.9225 Texas State Technical College, 11 $3930 Marshall, TX The Orange Box 0.8838 0.9624 Lake City CC, FL 12 $2979 Guitar Hero III: 0.8390 0.8622 Legends of Rock Itasca CC, MN 13 $4590 South Piedmont CC, NC 14 $1319 26. Environmental Scores. Greenpeace International Vermilion CC, MN 15 $4366 publishes its rankings of the major manufacturers of electronics, according to their policies on toxic chemicals, Hawaii CC, HI 16 $1478 recycling, and climate change. The following data set Ellsworth CC, IA 17 $3108 represents the scores received for a random sample of Chipola College, FL 18 $2137 companies in Greenpeace’s September 2008 report and their Martin CC, NC 19 $1302 November 2008 report. Higher scores mean that the Texas State Technical College, TX 20 $3105 company is more environmentally responsible in these areas. Test whether a rank correlation exists between the two South Texas College, TX 21 $1996 reports, using level of significance a 5 0.05. Skagit Valley College, WA 22 $2712 Valencia CC, FL 23 $2091 environmentalco MiraCosta College, CA 24 $590 Electronics September November Florida CC at Jacksonville, FL 25 $1714 company 2008 score 2008 score New Hampshire CC, NH 26 $5464 Nokia 7.0 6.9 Frank Phillips College, TX 27 $2766 Toshiba 4.7 5.9 Mesabi CC, MN 28 $4174 Samsung 5.7 5.9 Northwest Vista College, TX 29 $2292 Microsoft 2.2 2.9 New Mexico University Grants, NM 30 $1320 Motorola 3.7 5.3 Sharp 3.1 4.9 28. Age and Weight. The relationship between age and Dell 4.7 4.7 weight is nonlinear, so that linear regression should not be Philips 4.3 4.1 used to test for the relationship. The Centers for Disease Control and Prevention published a case study regarding a 27. Community Colleges. The following data set represents particular child, recording the age and weight of this child at the results of the Washington Monthly’s ranking of the top 30 various intervals. Assume that the data set represents a community colleges in the nation. Two rankings are provided: random sample. Use the rank correlation test to test for a the first for overall quality and the second for tuition and fees. relationship between age and weight, using level of Test whether a rank correlation exists between the two significance a 5 0.01. variables, using level of significance a 5 0.05. You need to ageweight calculate the ranks for the “tuition and fees” variable, but not for the “overall quality” variable. communitycollege

Larose_3e_ch14.indd 54 10/30/15 11:03 AM 14-55 Chapter 14 Nonparametric Statistics

Age of child Weight cancer per 100,000 people and the number of cigarettes in months in ounces smoked in hundreds per capita. Use the rank correlation test to test for a relationship between the number of deaths from 0 103 bladder cancer and the per capita number of cigarettes 1 152 smoked, using level of significance a 5 0.05. 3 194 4 229 cigarettecancer 6 276 8 276 Deaths from 10 288 Cigarettes per bladder cancer per 12 304 State capita (100s) 100,000 people 15 319 Kansas 21.84 2.91 18 334 Washington 21.17 4.04 24 359 Oklahoma 23.44 2.93 30 394 Maryland 25.91 5.21 Source: Centers for Disease Control and Prevention. Texas 20.08 2.94 29. Cigarettes and Bladder Cancer. A study examined the Louisiana 21.58 4.65 relationship between the number of cigarettes smoked and Massachusetts 26.92 4.69 various types of cancer.13 The relationship between bladder Rhode Island 29.18 4.99 cancer and the number of cigarettes may involve a nonlinear Florida 28.27 4.46 component. The following data set is a random sample of U.S. states, along with the number of deaths from bladder Alaska 30.34 3.46

14.7 Runs Test for Randomness ObjectiveS By the end of this section, I will be able to . . . 1 Perform the runs test for randomness.

Recall from Chapter 13 that one of the assumptions for the linear regression model was that the values of the response variable y were independent. We checked this assump- tion using a scatterplot of the residuals against the fitted values; if systematic curvature was present, then the assumption was violated. Here, in Section 14.7, we learn a hypothesis test for checking this assumption, called the runs test for randomness.

1 Runs Test for Randomness In contrast to the other sections in this chapter, in this section we look upon our data set as a sequence. The first observation is considered to occur before the second, which Caution Note that we are is before the third, and so on. That is, a sequence is an ordered data set. considering the data set to The runs test for randomness helps us determine whether the data in the sequence ! be a sequence (time- are random or whether there is a pattern in the sequence. The runs test applies to data ordered) only for the application of the runs test for randomness. We that have two possible outcomes (such as female or male) or data that can be reex- are not suggesting that the data set pressed as one of two outcomes (such as correct or incorrect answers on a multiple- itself is necessarily time-ordered. choice quiz). The runs test works by counting the number of runs in the data set.

A sequence is an ordered data set. A run is a sequence of observations sharing the same value (of two possible values), preceded or followed by data having the other possible value or by no data at all. The runs test for randomness tests whether the data in a sequence are random or whether there is a pattern in the sequence.

Larose_3e_ch14.indd 55 10/30/15 11:03 AM 14.7 Runs Test for Randomness 14-56

For example, suppose that we are noting the gender (F 5 female, M 5 male) of the first 16 students to enter your statistics classroom today as they walk in the door. Here are two possible sequences: Sequence 1: F F F F F F F F M M M M M M M M Sequence 2: F M F M F M F M F M F M F M F M In the first sequence, there is a run of eight females, followed by a run of eight males. The eight females form a run because they represent a sequence of observations shar- ing the same value: F. Similarly, the eight males form a run. In Sequence 2, we note that the genders are alternating. The first data value F is followed immediately by an observation with a different value: M. Thus, the first data value itself forms a run. Simi- larly, each of the remaining observations forms a run of length 1.

The following notation is used in conducting a runs test for randomness: 5 n1 the number of observations having the first distinct outcome 5 n2 the number of observations having the second distinct outcome 5 5 1 n the total number of observations in the data set, n n1 n2 G 5 the number of runs in the sequence

Example 23 Notation used for the runs test for randomness The following sequence represents the genders of 20 students in a statistics class recorded as they enter the classroom: F F M M M F F F M F F F M M F F M F F M

Calculate the values of n1, n2, n, and G. S olution NOW YOU CAN DO There are n1 5 12 females and n2 5 8 males, so that n 5 n1 1 n2 5 12 1 8 5 20. There Exercises 5–8. are G 5 10 runs.

If the number of runs is too low or too high, this is evidence that a pattern exists in the data set. If the number of runs is neither too high nor too low, this is evidence that no time-ordered pattern exists in the data set, which may then be considered random. Thus, the runs test for randomness tests whether the number of runs is either too high or too low. There are large- and small-sample cases for the test statistic and the critical values for the runs test for randomness, as shown in the following steps.

Runs Test for Randomness Two conditions are necessary for the runs test: (a) the data are ordered, and (b) each data value represents one of two distinct outcomes (such as female or male). Step 1 state the hypotheses.

H0 : The sequence of data is random.

Ha : The sequence of data is not random. Step 2 Find the critical values, and state the rejection rule.

● Small-Sample Case (n1 # 20, n2 # 20, and level of significance a 5 0.05): Use Appendix Table L. Note that the table is applicable only for level of significance a 5 0.05. Find the row with the appropriate value of n1 and the column with the

Larose_3e_ch14.indd 56 10/30/15 11:03 AM 14-57 Chapter 14 Nonparametric Statistics

appropriate value of n2. The two values at the intersection of this row and column

represent the lower critical value Gcrit, lower and the upper critical value Gcrit, upper. The # $ rejection rule is to reject H0 if Gdata Gcrit, lower or if Gdata Gcrit, upper. ● Large-Sample Case (n1 . 20 or n2 . 20): A normal approximation is used. See Table 19.

Table 19 Critical values and rejection rule for the runs test, large-sample case Level of

significance  Critical value Zcrit Rejection rule

0.10 1.645 Reject H0 if

0.05 1.96 Zdata # 2Zcrit

0.01 2.58 or if Zdata $ Zcrit

Step 3 Find the value of the test statistic.

● Small-Sample Case (n1 # 20 and n2 # 20): The test statistic Gdata is simply the number of runs, G: 5 Gdata G

● Large-Sample Case (n1 . 20 or n2 . 20): First find the number of runs G. Then calculate the following quantities:

2n n m 5 1 2 1 1 G 1 n1 n2 s2n n ds2n n 2 n 2 n d s 5 1 2 1 2 1 2 G Î sn 1 n d2 sn 1 n 2 1d 1 2 1 2

Finally, the test statistic is Zdata:

G 2 m z 5 G data s G Step 4 state the conclusion and the interpretation. Compare the test statistic with the critical value, using the rejection rule.

Example 24 Conducting the runs test for randomness Test whether the sequence from Example 23 is random by conducting the runs test for randomness, using level of significance a 5 0.05. Solution We know that the data are time-ordered, and that each data value represents one of two distinct outcomes. We may thus proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : The sequence of data is random.

Ha : The sequence of data is not random.

Step 2 Find the critical values, and state the rejection rule. We have n1 5 12

females and n2 5 8 males, so the small-sample case applies (n1 # 20 and n2 # 20). In

Larose_3e_ch14.indd 57 10/30/15 11:03 AM 14.7 Runs Test for Randomness 14-58

Value of n2 2 3 4 5 6 7 8 9 10 11 12 1 1 1 1 1 1 1 1 1 1 2 2

1 6 6 6 6 6 6 6 6 6 6 6 1 2 3 3 4 5 5 5 6 6 7 10 6 8 10 12 13 14 15 16 16 17 17 1 2 3 4 4 5 5 6 6 7 7 Value of n of Value 11 6 8 10 12 13 14 15 16 17 17 18 2 2 3 4 4 5 6 6 7 7 7 12 6 8 10 12 13 14 16 16 17 18 19

Figure 26 Finding the critical values for the runs test for randomness.

Appendix Table L we find the row with n1 5 12 and the column with n2 5 8, giving us

the critical values Gcrit, lower 5 6 and Gcrit, upper 5 16 (see Figure 26). We will reject H0 if

Gdata # 6 or if Gdata $ 16. Step 3 Find the value of the test statistic. We have the small-sample case, so the

test statistic Gdata is simply the number of runs, G:

Gdata 5 G 5 10

Step 4 State the conclusion and the interpretation. Because Gdata 5 10 is not # 6

NOW YOU CAN DO and is not $ 16, we do not reject H0. There is insufficient evidence that the sequence is Exercises 9–20. not random.

The runs test may also be used for numerical data, as long as the numerical data are classified into two categories, as shown in the following example.

Example 25 Runs test for randomness of numerical data classified into categories The weather station at the University of Missouri at Columbia publishes daily infor- mation on the amount of rain that falls at Sanborn Field at the university. The follow- ing 62 observations represent the daily rainfall information for the months of July and August 2008. For example, on July 1 the weather station reported 0.00 inch of rain, and on July 2 the weather station reported 0.37 inch of rain. We categorize each day’s rainfall as follows: N 5 no rain falling, and R 5 some rain falling. Test whether the sequence is random by conducting the runs test for randomness, using level of sig- nificance a 5 0.10.

N R R N N N N R R N N R N N N N N N N N N R N R R N R R N R R N N N N N N N N N N N R N R N N N N N R R R N N N N N R N N N Solution The data are ordered, because they are arranged from July 1 to August 31, 2008. Also, each data value represents one of two distinct outcomes: some rain or no rain. We may thus proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : The sequence of data is random.

Ha : The sequence of data is not random.

Larose_3e_ch14.indd 58 10/30/15 11:03 AM 14-59 Chapter 14 Nonparametric Statistics

Step 2 Find the critical values, and state the rejection rule. We have n1 5 18 rainy

days and n2 5 44 days with no rain. Because n2 . 20, the large-sample case applies.

From Table 19, the critical value is 1.645, and we will reject H0 if Zdata # 21.645 or if

Zdata $ 1.645.

Step 3 Find the value of the test statistic. We have n 5 n1 1 n2 5 18 1 44 5 62, and there are G 5 23 runs. Then

2n1 n2 2s18ds44d mG 5 1 1 5 1 1 < 26.5484 n1 1 n2 18 1 44 s2n n ds2n n 2 n 2 n d [2s18ds44d][2s18ds44d 2 18 2 44] s 5 1 2 1 2 1 2 5 < 3.2065 G Î sn 1 n d2 sn 1 n 2 1d Î s18 1 44d2 s18 1 44 2 1d 1 2 1 2

Finally, the test statistic is

23 2 26.5484 z 5 < 21.1066 data 3.2065 Step 4 State the conclusion and the interpretation. Because 21.1066 is not less

than 21.645 and is not more than 1.645, we do not reject H0. There is insufficient evidence that the sequence is not random.

The runs test for randomness may also be used to test the independence assump- tion for linear regression data, as shown in the following example. The important thing to remember is that the runs test should be applied to the residuals, which are ordered by the size of the fits (y⁄).

Example 26 Using the runs test for linear regression Consider the following ordered bivariate data set and the accompanying scatterplot (Figure 27). We are interested in performing linear regression of the y variable on the x variable. Make a scatterplot of the residuals (y 2y⁄) versus the fits (y⁄). ­Classify the residuals as being either positive (P) or negative (N). Then evaluate the indepen- dence assumption for the linear regression model by performing the runs test for ­randomness on the residuals, ordered by the fits.

x y x y 0.0 1.00000 3.3 20.98748 1.0 0.3 0.95534 3.6 20.89676 2 0.6 0.82534 3.9 0.72593 0.5 0.9 0.62161 4.2 20.49026

1.2 0.36236 4.5 20.21080 y 0 1.5 0.07074 4.8 0.08750 Ϫ 1.8 20.22720 5.1 0.37798 0.5 2.1 20.50485 5.4 0.63469 Ϫ1.0 2.4 20.73739 5.7 0.83471 0 1 2 3 4 5 6 7 2.7 20.90407 6.0 0.96017 x 3.0 20.98999 6.3 0.99986 Figure 27 Scatterplot of y versus x. Do you see a pattern here?

Larose_3e_ch14.indd 59 10/30/15 11:03 AM 14.7 Runs Test for Randomness 14-60

Solution The scatterplot of the residuals versus the fits is shown in Figure 28.

1.0

0.5

0 Residuals Ϫ0.5

Ϫ1.0

0.040 0.042 0.044 0.046 0.048 0.050 0.052 0.054 0.056 Fits

Figure 28 Scatterplot of the residuals versus the fits.

What Results Might We Expect? When applied to linear , the runs test for randomness tests whether a pattern exists in the residuals. Do you observe a pattern in the scatterplot of the residuals (Figure 28)? If so, then what might we expect our conclusion to be for the runs test? Yes, there appears to be a descending and then ascending pattern in the data (In fact, can you discern the exact relationship between x and y?), and thus we expect to reject the null hypothesis that the data are random

By examining Figure 28, we can classify the residuals from left to right as positive or negative, giving us: P P P P P P N N N N N N N N N N P P P P P P The residuals are ordered by the size of the fits, and we have classified eachresidual ­ into one of two distinct outcomes. Thus, we may proceed with the hypothesis test. Step 1 State the hypotheses.

H0 : The sequence of residuals is random.

Ha : The sequence of residuals is not random.

Step 2 Find the critical values, and state the rejection rule. We have n1 5 12

positives and n2 5 10 negatives, so the small-sample case applies (n1 # 20 and n2 # 20).

From Appendix Table L we find our critical values Gcrit, lower 5 7 and Gcrit, upper 5 17. We

will reject H0 if Gdata # 7 or if Gdata $ 17. Step 3 Find the value of the test statistic. We have the small-sample case, so the

test statistic Gdata is simply the number of runs, G:

Gdata 5 G 5 3 By the way, have you guessed the Step 4 State the conclusion and the interpretation. Because G 5 3 is less than 7, equation of the pattern shown in data we reject H . Evidence exists that the sequence of residuals is not random. The residuals Figures 27 and 28? The 0 relationship between x and y is are nonrandom, so the independence assumption for the linear regression model is y 5 cos(x). violated, and we should not proceed with a linear regression analysis.

Larose_3e_ch14.indd 60 10/30/15 11:03 AM 14-61 Chapter 14 Nonparametric Statistics

STEP-BY-STEP TECHNOLOGY GUIDE: Runs Test for Randomness

TI-83/84 The TI-83/84 calculators and Excel do not have a built-in function for the runs test for randomness. MINITAB Minitab can perform the runs test for randomness for numerical Step 3 For the variable, type C1. Select Above and Below, and data only. enter the value that is used to classify the data into two distinct Step 1 Enter the numerical data in column C1. categories. For example, in Example 26, we would enter 0 here, Step 2 Click Stat > Nonparametrics > Runs Test…. because values above 0 are positive and values below 0 are negative. Click OK.

SPSS SPSS can perform the runs test for randomness for numerical data Step 3 Move the first column to Test Variable List. For Cut Point only. select Custom, and enter the value that is used to classify the data Step 1 Enter the numerical data in the first column. into two distinct categories. Click OK. Step 2 Click Analyze > Nonparametric Tests > Legacy Dialogs > Runs….

Section 14.7 Summary 1. The runs test for randomness helps us determine if the possible outcomes (such as female or male). The sample data in a sequence are random or whether a pattern exists in data are ordered in a sequence, and the runs test determines the sequence. The runs test applies to data that have two whether there are too many or too few runs.

Section 14.7 Exercises CLARIFYING THE CONCEPTS 5. M M F F F M F M F M M M M F M M M 1. Describe what a sequence is. (p. 14-55) 6. N N N N N N P P P P P P P P N N N N N 2. Clearly describe what the runs test for randomness is N N used for. (p. 14-55) 7. T F T F T F F T T F T F T F T T F T F T 3. Explain what a run is. (p. 14-55) F T F F F T F T F T F T F F T F T F T T T F 4. What does it mean if the number of runs in a sequence 8. Y Y N N Y Y Y N N Y Y N N N Y N N N is too low or too high? (p. 14-56) N Y Y N N Y Y Y N N N N Y Y N N N N N Y Y Y Y Y Y Y PRACTICING THE TECHNIQUES 9. Find Gcrit, lower and Gcrit, upper for the sequence in Exercise 5 for level of significance a 5 0.05. • CHECK IT OUT! 10. Find Gcrit, lower and Gcrit, upper for the sequence in Exercise 6 To do Check out Topic for level of significance a 5 0.05. 11. Find the critical value Z for the sequence in Exercise 7 Exercises 5–8 Example 23 Notation used for the crit for level of significance a 5 0.01. runs test for 12. Find the critical value Z for the sequence in Exercise 8 randomness crit for level of significance a 5 0.10. Exercises 9–20 Example 24 Conducting the runs

test for randomness For Exercises 13 and 14, calculate the test statistic Gdata. 13. For the sequence in Exercise 5 For Exercises 5–8, you are given sequences of data. 14. For the sequence in Exercise 6 Calculate the following:

a. n1, the number of observations having the first For Exercises 15 and 16, do the following: distinct outcome a. Calculate mG. b. n , the number of observations having the second 2 b. Calculate sG. distinct outcome c. Compute the test statistic Zdata. c. n 5 n1 1 n2 15. For the sequence in Exercise 7 d. G, the number of runs in the sequence 16. For the sequence in Exercise 8

Larose_3e_ch14.indd 61 10/30/15 11:03 AM Chapter 14 Formulas and Vocabulary 14-62

For Exercises 17–20, conduct the runs test for randomness N N A A A N A A A A A N A A A N N A N using the following steps: N N N N N N N N N N N N A A N A A N A A a. State the hypotheses. A A N A N N N A N b. Find the critical values. 25. Douglas Fir Trees: Annual Growth versus Age. The c. Calculate the test statistic. following scatterplot depicts the residuals versus the fits from a d. State the conclusion and the interpretation. regression of the annual growth of Douglas fir trees versus the 17. Use the sequence in Exercise 5, the critical values in age of the tree.16 Proceeding from left to right, classify each Exercise 9, the test statistic in Exercise 13, and level of residual as either above zero (A) or below zero (B). Then significance a 5 0.05. perform the runs test to determine whether the independence 18. Use the sequence in Exercise 6, the critical values in assumption is violated, using level of significance a 5 0.05.

Exercise 10, the test statistic in Exercise 14, and level of 1.0 significance a 5 0.05. 19. Use the sequence in Exercise 7, the critical value in Exercise 11, the test statistic in Exercise 15, and level of significance a 5 0.01. 0.5 20. Use the sequence in Exercise 8, the critical value in Exercise 12, the test statistic in Exercise 16, and level of

significance a 5 0.10. Residuals 0

APPLYING THE CONCEPTS

21. Florida Lottery Winners. The following sequence Ϫ0.5 represents whether there is one (A) or more than one (B) winning ticket for the Florida Lotto Jackpot lottery for the year 2008. Test whether the A/B sequence is random, using 0.7 0.8 0.9 1.0 1.1 1.2 1.3 level of significance a 5 0.05. Fits A A A A A A A A A A A A A A B B A A A A B A 26. Women’s Pulse Rates versus Temperature. The 22. Boston Red Sox. The following sequence represents the following scatterplot depicts the residuals versus the fits from a last 15 games of the 2013 regular season, showing whether regression of pulse rates versus body temperatures for a random the Red Sox won (W) or lost (L) the game. Test whether the sample of 20 women. Proceeding from left to right, classify sequence is random, using level of significance a 5 0.05. each residual as either above zero (A) or below zero (B). Then W L W L W W L W W W L L W W W perform the runs test to determine whether the independence 23. Nobel Prize Winners. The following sequence assumption is violated, using level of significance a 5 0.05. represents the nationality of the Nobel Prize in 10 Economics winners (2000–2013), with A representing an 14 American and O representing all other nationalities. Test 5 whether the sequence is random, using level of significance a 5 0.05. 0 A A A A A O A A O O A A A A A A O A A A O A A A A A A A A A Ϫ5

24. Super Bowl Winners. The following sequence Residuals Ϫ10 represents the conference of the Super Bowl winners from 1967 to 2014, where A represents the American Football Ϫ15 Conference and N represents the National Football Conference.15 Test whether the sequence is random, using Ϫ20 level of significance a 5 0.10. 70 72 74 76 78 80 82 Fits Chapter 14 Formulas and Vocabulary

●● SECTION 14.1 Zdata (p. 14-8). ●● Efficiency (p. 14-4) n ●● Nonparametric hypothesis tests (p. 14-3) sS 1 0.5d 2 data 2 ●● Parametric hypothesis tests (p. 14-3) Z 5 data Ïn SECTION 14.2 2 ●● Sign test (p. 14-5) ●● Sdata (p. 14-7)

Larose_3e_ch14.indd 62 10/30/15 11:04 AM 14-63 Chapter 14 Nonparametric Statistics

SECTION 14.3 where ●● Boxplot criterion for assessing symmetry (p. 14-19) R1 5 the sum of the ranks for the first sample ●● Symmetry (p. 14-18) R2 5 the sum of the ranks for the second sample, and so ●● Tdata (p. 14-22) on, until ●● Wilcoxon signed rank test (p. 14-20) Rk 5 the sum of the ranks for the kth (last) sample and where n , n , . . . , n represent the sample sizes for SECTION 14.4 1 2 k samples 1, 2, ..., k, respectively, and N 5 the total ●● Independent samples (p. 14-29) number of data values in all the samples combined; that is, ●● Wilcoxon rank sum test (p. 14-29) ●● N 5 n1 1 n2 1 · · · 1 nk. Zdata (p. 14-31). SECTION 14.6 R1 2 mR Z 5 ●● Rank correlation test (p. 14-44) data s R ●● rdata (p. 14-47). The test statistic for the rank correlation where test is n sn 1 n 1 1d 6 d2 m 5 1 1 2 r 5 1 2 o R 2 data nsn2 2 1d n n sn 1 n 1 1d where d 5 the difference in ranks between the two samples. s 5 1 2 1 2 R Î 12 SECTION 14.7 ●● G (p. 14-57) and where n and n represent the sample sizes for data 1 2 ●● Run (p. 14-55) samples 1 and 2, respectively, and R 5 the sum of the 1 ●● Runs test for randomness (p. 14-55) ranks for the first sample. ●● Sequence (p. 14-55) ●● Z (p. 14-57). The test statistic for the large-sample case SECTION 14.5 data for the runs test for randomness is ●● Kruskal-Wallis test (p. 14-36) ●● 2 G 2 mG xdata (p. 14-39). The test statistic for the Kruskal-Wallis Zdata 5 test is sG where 12 R2 R2 R2 2 1 2 k 2n n 2n n 2n n 2 n 2 n x 5 1 1 Á 1 2 3sN 1 1d 1 2 s 1 2ds 1 2 1 2d data N N 1 1 n n n m 5 1 1 and s 5 s d 1 1 2 k 2 G G 2 n 1 n Î sn 1 n d sn 1 n 2 1d 1 2 1 2 1 2

Chapter 14 Review Exercises

6. H0 : M 5 50 vs. Ha : M Þ 50, n 5 17, level of SECTION 14.1 significance a 5 0.05. There are 10 pluses and 6 minuses. 1. What is a nonparametric hypothesis test? Explain why One data value equals 50. the term “distribution-free” may be more accurate. 7. H0 : Md 5 500 vs. Ha : Md Þ 500, n 5 12, level of 2. Explain why the sign test may be less efficient than the significance a 5 0.10. There are 9 pluses, 0 minuses, and 3 ties. Wilcoxon signed rank test when both are compared to the t 8. NHL Goals Scored. Between 2003 and 2014, the test for dependent sample data. National Hockey League endured two lockout seasons and 3. Why is there no efficiency rating in Table 1 (page 14-4) underwent a number of rules changes. Did this affect the for the runs test? number of goals scored? The following table shows the SECTION 14.2 mean goals scored per game for a random sample of five NHL teams for the 2003–2004 and the 2013–2014 seasons. 4. Explain the meaning of the notation M0 in the hypotheses for the sign test for a single population median. Test whether the population median of the difference in mean number of goals scored per game is greater than zero, 5. Explain the meaning of the notation Md in the hypotheses for the sign test for matched-pair data. using level of significance a 5 0.05. nhlgoals

For Exercises 6 and 7 do the following. (Hint: Exercise 6 2003–2004 2013–2014 represents the sign test for a single population median. Exercise 7 represents the matched-pair sign test.) Detroit Red Wings 3.11 2.65 Tampa Bay Lightning 2.99 2.83 a. Use Appendix Table I to find the value of Scrit. b. State the rejection rule. Phoenix Coyotes 2.29 2.56 c. Calculate S . data Colorado Avalanche 2.88 2.99 d. Provide the conclusion and the interpretation of the hypothesis test. Dallas Stars 2.37 2.82

Larose_3e_ch14.indd 63 10/30/15 11:04 AM Chapter 14 Review Exercises 14-64

9. Eighth-Grade Alcohol Use. The National Institute on Heating Cooling Alcohol Abuse and Alcoholism (NIAAA) reports on the City degree-days degree-days proportion of eighth-graders who have used alcohol (Source: http://www.niaaa.nih.gov/publications). A random sample of Austin 1648 2974 100 eighth-graders this year showed that 41 of them had College Station 1616 2938 used alcohol. Test whether the population proportion of Dallas 2219 2878 eighth-graders who have used alcohol is less than 0.5, using El Paso 2543 2254 level of significance a 5 0.05. Houston 1174 3179 SECTION 14.3 Killeen 2190 2477 10. For the Wilcoxon signed rank test, what do the notations San Antonio 1573 3038

T1 and T– mean? SECTION 14.4 For Exercises 11 and 12, perform the indicated Wilcoxon For Exercises 17 and 18, test whether the population signed rank test for a single population median, using medians differ, using level of significance a 5 0.01. The level of significance a 5 0.05. data represent two independent random samples.

11. H0 : M # 10 vs. Ha : M . 10, with n 5 20 and T2 5 70. 12. H : M 5 100 vs. H : M Þ 100, with n 5 10, T 5 15, 17. 0 a 1 Sample 1 24 22 28 24 33 34 38 20 32 27 32 and T 5 40.  2 33 34 26 22 40 For Exercises 13 and 14, perform the indicated Wilcoxon Sample 2 36 25 29 23 29 34 28 32 27 38 38 signed rank test for the population median of two dependent 18. Sample 1 71 73 59 61 68 51 60 56 59 66 67 samples, using level of significance a 5 0.05. 70 62 13. H0 : Md $ 0 vs. Ha : Md , 0, with n 5 18 and T1 5 49. 14. H : M = 0 vs. H : M Þ 0, with n 5 20, T 5 150, and Sample 2 59 69 68 74 62 64 60 74 50 67 54 0 d a d 1 74 73 52 T2 5 60. 15. Precipitation in Florida. The following table shows 19. Unemployment Rates. The following table contains the the annual precipitation (in inches) for a random sample of unemployment rates for independent random samples of cities in Florida. Use the Wilcoxon signed rank test to test cities in Ohio and Virginia. Test whether the population whether the population median annual precipitation in median unemployment rate differs between cities in Ohio Florida differs from 50 inches, using level of significance and cities in Virginia, using level of significance a 5 0.05. a 5 0.05. unemployment flprecipitation Unemployment Unemployment City Annual precipitation (inches) Ohio city rate Virginia city rate Gainesville 49.56 Akron 6.6 Alexandria 2.8 Jacksonville 51.88 Cincinnati 6.4 Charlottesville 4.6 Miami 58.53 Cleveland 7.9 Lynchburg 4.4 Tampa 44.77 Columbus 5.4 Richmond 5.3 Fort Lauderdale 64.19 Dayton 7.6 Roanoke 4.2 Orlando 48.35 Toledo 7.5 Petersburg 7.3 Virginia Beach 3.4 Source: U.S. Census Bureau.

16. Hot and Cold in Texas. Is the weather in Texas on the SECTION 14.5 hot side or the cold side? The following table shows the For Exercises 20 and 21, test whether the population annual number of heating degree-days and cooling ­ medians differ, using level of significance a 5 0.05. The degree-days for a random sample of cities in Texas.17 Test, data represent independent random samples. using the Wilcoxon signed rank test, whether the population 20. median of the differences (heating degree-days minus Sample 1 11 14 17 13 18 12 10 cooling degree-days) is less than zero, using level of Sample 2 17 15 15 15 18 18 significance a 5 0.05. Sample 3 11 19 18 12 11 12 11 15 hotcoldtx Sample 4 21 22 20 21 23 19 17 23 24

Larose_3e_ch14.indd 64 10/30/15 11:04 AM 14-65 Chapter 14 Nonparametric Statistics

21. Sample 1 12 15 13 16 19 12 12 15 24. Sample 1 25 22 28 30 20 25 Sample 2 12 15 18 17 17 14 20 11 Sample 2 35 31 37 39 31 35 Sample 3 11 17 19 17 11 12 17 Sample 4 17 19 23 21 22 20 25. Hot and Cold in California. The following table contains a random sample of 13 cities in California, along 22. Manufacturing Workers. The following tables contain with the average number of heating degree-days and cooling the number of workers employed in manufacturing for degree-days for each city. Test whether a rank correlation independent random samples of cities in Connecticut, Georgia, exists between heating degree-days and cooling degree-days, and Illinois. Test whether the population median number of using level of significance a 5 0.05. hotcoldca manufacturing workers differs among the three states. Use level of significance a 5 0.05. manufacturing Heating Cooling Connecticut city Workers California city degree-days degree-days Bridgeport 5,991 Arcadia 1295 1575 Danbury 6,553 Burlingame 2720 184 Hartford 1,646 Simi Valley 1822 1485 Middletown 4,670 Azusa 1727 1191 New Britain 3,603 Palo Alto 2584 452 New Haven 3,253 Lake Forest 1465 1183 Waterbury 4,808 Santee 1313 1261 Torrance 1526 742 Georgia city Workers Whittier 1295 1575 Atlanta 15,002 Dana Point 1756 666 Athens 6,966 Camarillo 1961 389 Columbus 11,116 Glendora 1727 1191 Dalton 17,718 Bellflower 1211 1186 Savannah 8,679 Source: U.S. Census Bureau.

Illinois city Workers SECTION 14.7 For Exercises 26 and 27, you are given sequences of data. Danville 3,632 Conduct the runs test for randomness, using level of Champaign 2,776 significance a 5 0.05. DeKalb 2,205 26. Y Y Y Y Y N N N N N N N Y Y Y Y Y Y Y Evanston 1,939 N N N N N 27. M F F M M M F F M F F M F M M M F F F Peoria 4,763 M F M Waukegan 4,780 28. Presidential Election Winners. Since 1852, every U.S. presidential election has been won by either the Democratic SECTION 14.6 Party or the Republican Party. The following sequence For Exercises 23 and 24, you are given random samples of represents the presidential election winners since 1852, with paired data. Perform the rank correlation test, using level of D representing Democrat and R representing Republican.18 significance a 5 0.05. Test whether the sequence is random, using level of 23. Sample 1 10 12 15 13 18 15 significance a 5 0.10. D D R R R R R R D R D R R R R D D R R R D Sample 2 9 6 3 7 1 1 D D D D D R R D D R R D R R R D D R R D D

Larose_3e_ch14.indd 65 10/30/15 11:04 AM Chapter 14 Quiz 14-66

Chapter 14 Quiz

True or False 11. Carbon Emissions. The following table shows the 1. True or false: The hypotheses for the Wilcoxon signed carbon dioxide emissions (in millions of metric tons) rank test for the population median of the differences are the from the consumption of fossil fuels in 2000 and 2005 for same as those for the corresponding sign test. a random sample of 10 nations. Test whether the emissions 2. True or false: The sample size used in the Wilcoxon signed have been increasing. That is, test, using a sign test, whether rank test always equals the number of data values in the sample. the population median of the difference (2005 2 2000) in 3. True or false: In the Wilcoxon rank sum test, the two carbon dioxide emissions is greater than zero, using level of samples are temporarily combined, and the ranks of the significance a 5 0.05. carbon3 combined data values are calculated. Then the ranks are summed separately for each sample. Carbon emissions Carbon emissions Fill in the Blank in 2000 (millions of in 2005 (millions 4. A convenient graphic for assessing the symmetry of a Nation metric tons) of metric tons) data distribution is a ______. Brazil 342.1 360.6 5. The cutoff sample size between using the small-sample case and the large-sample case for the Wilcoxon signed rank Canada 558.4 631.3 test is ______. China 2912.6 5322.7 6. The Kruskal-Wallis test is the nonparametric alternative France 399.0 415.3 to ______of ______, which we learned in an India 994.1 1165.7 earlier chapter. Ireland 40.4 44.1 Short Answer South Africa 383.4 423.8 7. In the Wilcoxon signed rank test for matched-pair data, which data values need to be omitted? Thailand 160.6 234.2 8. Is the Wilcoxon rank sum test used for dependent or Vietnam 47.4 80.4 independent samples? What about the Wilcoxon signed rank United States 5823.5 5957.0 test? 9. State the conditions for performing the Kruskal-Wallis test. 12. Military Veterans. The following table contains Calculations and Interpretations the number of U.S. military veterans (in thousands) for a 10. Children Without Health Insurance. The following random sample of 13 states. militaryvets table contains the number of children (in thousands) who are not covered by health insurance for a random sample of a. Verify that the data are symmetric. 24 states. Use the sign test to test whether the population b. Use the Wilcoxon signed rank test to test whether the median number of children per state without health population median number of veterans per state insurance is greater than 75,000, using level of significance differs from 100,000, using level of significance a 5 0.05. a 5 0.05. childhealth

Children Children State Veterans (1000s) without health without health Montana 104 insurance insurance Vermont 55 State (1000s) State (1000s) Alaska 75 Idaho 52 Wisconsin 63 New Hampshire 132 Georgia 314 Massachusetts 103 Oklahoma 114 Illinois 302 Kansas 237 Delaware 24 California 1225 Nevada 246 Minnesota 104 New Mexico 93 Arkansas 262 Louisiana 170 Missouri 127 South Dakota 74 Alabama 82 New York 380 Florida 771 Ohio 157 West Virginia 178 Colorado 176 Arkansas 65 Maine 144 Washington 105 Connecticut 49 Delaware 81 Pennsylvania 203 Texas 1392 North Dakota 58 Tennessee 94 Indiana 123 Mississippi 216 Source: U.S. Census Bureau.

Larose_3e_ch14.indd 66 10/30/15 11:04 AM 14-67 Chapter 14 Nonparametric Statistics

13. Trade Balance. Table 20 contains the trade balance (in Table 20 U.S. trade balances millions of dollars) that the United States has with a random Trade Trade sample of 12 European countries and a random sample European balance Asian balance of 11 Asian countries. Positive numbers indicate that our country ($ millions) country ($ millions) exports to that country exceed in value our imports from that country. Negative numbers indicate that exports are Austria –7,497 Bangladesh –2,976 less than imports. Test whether the population median trade Belgium 10,009 China –256,207 balance with European countries differs from the population Czech Republic –1,168 Japan –82,760 median trade balance with Asian countries, using level of Germany –44,513 South Korea –12,918 significance a 5 0.05. Greece 918 Israel –7,775 Ireland –21,436 Malaysia –20,948 United Kingdom –6,629 Nepal –61 Netherlands 14,560 Thailand –14,300 Norway –4,256 Taiwan –11,968 France –14,140 Saudi Arabia –25,230 Luxembourg 475 Cambodia –2,325 Finland –2,133

Notes and Data Sources 1. See www.fueleconomy.gov, which is an excellent Web site for 10. Joseph Maze, Richard Murphy, and Cheri Simonds, “I’ll see tips on improving gas mileage. you on Facebook: the effects of computer-mediated teacher self- 2. blog.mozilla.com/metrics. disclosure on student motivation, affective learning, and classroom 3. Sophos.com. climate,” Communication Edition 56 (2007): 1–17. 4. P. A. Mackowiak, S. S. Wasserman, and M. M. Levine, “A 11. The data set is adapted from the Cereals data set from the Data critical appraisal of 98.6 degrees F, the upper limit of the normal and Story Library, lib.stat.cmu.edu/DASL/. body temperature, and other legacies of Carl Reinhold August 12. Robert K. Murray and Tim H. Blessing, Greatness in the White Wunderlich, Journal of the American Medical Association 268 House: Rating the Presidents, from Washington Through Ronald (1992): 1578–80. Reagan, 2nd ed. (University Park: Pennsylvania State University 5. U.S. Small Business Administration. Press, 1994). 6. R.E. Keith and E. Merrill, “The effects of vitamin C on maxi- 13. J.F. Fraumeni, “Cigarette smoking and cancers of the urinary mum grip strength and muscular endurance,” Journal of Sports tract: geographic variations in the United States,” Journal of the Medicine and Physical Fitness 23 (1983): 253–56. Data available National Cancer Institute 41, 1205–11. Data courtesy of the Data at http://www.statsci.org/data/general/vitaminc.html. and Story Library lib.stat.cmu.edu/DASL/. 7. Data set adapted from Karin Olson and John Hanson, “Using 14. Nobelprize.org. Reiki to manage pain,” Cancer Prevention and Control 1, no. 2 15. NFL.com. (1997): 108–13. 16. “Height-age curves for planted stands of Douglas fir, with 8. Data represent random samples from the Pulse Rates data set, ­adjustments for density,” by James Flewelling et al., College of originally from P. A. Mackowiak, S.S. Wasserman, and M.M. Levine. Forest Resources, University of Washington (2001). See n. 4. 17. InfoPlease Almanac. 9. Caroline Davis, Elizabeth Blackmore, Deborah Katzman, and 18. Ibid. John Fox, Anorexia Nervosa Case Study, Statistical Society of Canada Annual Conference, Montreal, 2004. http://www.ssc.ca/ en/education/archived-case-studies/case-study-II-for-ssc-2004.

Larose_3e_ch14.indd 67 10/30/15 11:04 AM