Login
📚 Mostly Harmless Statistics
Chapters ▾

13 Nonparametric Tests

13.01: Advantages and Disadvantages of Nonparametric Methods

The z-test, t-test, and F-test that we have used in the previous chapters are called parametric tests. These tests have many assumptions that have to be met for the hypothesis test results to be valid. This chapter gives alternative methods for a few of these tests when these assumptions are not met.

Advantages for using nonparametric methods:

  • They can be used to test population parameters when the variable is not normally distributed.
  • They can be used when the data are nominal or ordinal.
  • They can be used to test hypotheses that do not involve population parameters.
  • In some cases, the computations are easier than those for the parametric counterparts.
  • They are easy to understand.

Disadvantages for using nonparametric methods:

  • They are less sensitive than their parametric counterparts when the assumptions of the parametric methods are met. Therefore, larger differences are needed before the null hypothesis can be rejected.
  • They tend to use less information than the parametric tests. For example, the sign test requires the researcher to determine only whether the data values are above or below the median, not how much above or below the median each value is.
  • They are less efficient than their parametric counterparts when the assumptions of the parametric methods are met. That is, larger sample sizes are needed to overcome the loss of information. For example, the nonparametric sign test is about 60% as efficient as its parametric counterpart, the t-test. Thus, a sample size of 100 is needed for use of the sign test, compared with a sample size of 60 for use of the t-test to obtain the same results.

13.02: Sign Test

The sign test can be used for both one sample or for two dependent groups. The sign test uses a Binomial Distribution and looks at the probability of a success as 50%. The median is the 50th percentile, so many times we will state our null hypothesis as the median is equal to a certain value. However, sometimes we will state the hypothesis in terms of a proportion.

Two-Tailed Test Right-Tailed Test Left-Tailed Test
\(H_{0}:\) Median \(= \text{MD}_{0}\)
\(H_{1}:\) Median \(\neq \text{MD}_{0}\)
\(H_{0}:\) Median \(= \text{MD}_{0}\)
\(H_{1}:\) Median \(> \text{MD}_{0}\)
\(H_{0}:\) Median \(= \text{MD}_{0}\)
\(H_{1}:\) Median \(< \text{MD}_{0}\)

\(\text{MD}_{0}\) is a placeholder for the number for the hypothesized median.

The Sign Test Procedure

For the single-sample test, compare each value with the conjectured median. If a data value is larger than the hypothesized median, replace the value with a positive sign. If a data value is smaller than the hypothesized median, replace the value with a negative sign. If the data value equals the hypothesized median, replace the value with a 0.

The sample size is the number of plus and minus signs added together (do not include data values that tie with the median). For the paired-sample sign test, subtract the group 2 values from the group 1 values and indicate the difference with a positive or negative sign, or 0 (if they tie) and \(n\) = total number of positive and negative signs (do not include differences of zero).

Use the binomial distribution to find the p-value using technology.

  • For a two-tailed test, the test statistic, \(x\), is the smaller of the plus or minus signs. If \(x\) is the test statistic, the p-value for a two-tailed test is the \(2 \cdot \text{P} (X \leq x)\).
  • For a right-tailed test, the test statistic, \(x\), is the number of plus signs. For a left-tailed test, the test statistic, \(x\), is the number of minus signs. The p-value for a one-tailed test is the \(\text{P} (X \geq x)\).

The sign test is an alternative to the one sample t-test when you have a small sample size, but the population is not normally distributed. The sign test is also an alternative to the paired sample t-test when you have a small sample size and the difference in the pairs is not normally distributed. The sign test does not detect the magnitude of the difference between the hypothesized value and is not as efficient as the t-test.

A student tells her parents that the median rental rate for a studio apartment in Portland is $700. Her parents are skeptical and believe the rent is different. A random sample of studio rentals is taken from the internet; prices are listed below. Test the claim that there is a difference using \(\alpha\) = 0.10. Should the parents believe their daughter?

700 650 800 975 855 785 759 640 950 715 825 980 895 1025 850 915 740 985 770 785 700 925
Solution

1. The hypotheses for this example are:

\(H_{0}:\) Median \(= 700\)
\(H_{1}:\) Median \(\neq 700\)

2. Find the test statistic. Compare each value to the median. If the value is below the median, then give it a negative sign; if the value is above the mean, then give it a positive sign. If the value is tied with the median, then give it a zero.

700
0
650
-
800
+
975
+
855
+
785
+
759
+
640
-
950
+
715
+
825
+
980
+
895
+
1025
+
850
+
915
+
740
+
985
+
770
+
785
+
700
0
925
+

Count the number of positive and negative signs. Positive signs = 18, Negative signs = 2. The sample size is then \(18 + 2 = 20\). The test statistic is the smaller of the number of plus or minus signs. Therefore, in this case, the test statistic is 2.

3. Using the p-value method, the p-value is \(2 \cdot \text{P} (X \leq \text{Test Statistic})\) using a binomial distribution with \(p = 0.5\). With the sample size \(n = 20\) and \(p = 0.5\), then \(q = 1 - p = 0.5\).

The test statistic is \(x = 2\), so find \(2 \cdot \text{P} (X \leq 2)\).

\(\text{P} (X \leq 2) = \text{P}(X = 0) + \text{P}(X = 1) + \text{P}(X = 2) = {}_{20} C_{0} \cdot 0.5^{0} \cdot 0.5^{20} + {}_{20} C_{1} \cdot 0.5^{1} \cdot 0.5^{19} + {}_{20} C_{2} \cdot 0.5^{2} \cdot 0.5^{18} = 0.0000010 + 0.0000191 + 0.0001812 = 0.000201.\)

Since this is a two-tailed test, we multiply the probability by 2 to get \(2 \cdot 0.000201 = 0.000402\).

We can also use the TI-84 calculator for a two-tailed test, to get \(2* \text{binomcdf}(20,0.5,2) = 0.000402.\)

Selecting the binomial cdf function from the distribution menu of a TI-84 calculator. Two times the binomial cdf of the TI-84, with inputs 20, 0.5, and 2, is 0.000402.

The p-value = 0.000402.

4. The p-value is smaller than alpha; therefore reject \(H_{0}\).

5. There is enough evidence to support the parents’ claim that the median rent for a studio apartment in Portland is not $700.

The critical values for the sign test come from a binomial distribution when the probability of a success is 50% since the median is the 50th percentile, and the sample size is 20.

If you were to calculate the discrete probability distribution for each possible value of \(x\), you would get the following discrete probability distribution table (Figure 13-1) and corresponding graph (Figure 13-2).

Table of discrete probability distribution for each value of x between 0 and 20. The sum of the probabilities for x=0 through x=5 is 0.0206949, and the sum of the probabilities for x=15 through x=20 is 0.0206949.
Figure 13-1: Discrete probability distribution table for each value of \(x\).
Binomial distribution bar graph for n=20, p=0.5. The bars for x=0 through x=5 and the bars for x=15 through x=20 are highlighted.
Figure 13-2: Graph of binomial distribution data from Figure 13-1, with the two tails highlighted.

When we add up the highlighted probabilities we would get a probability of approximately \(0.0206949 + 0.0206949 = 0.0414\), which is below our alpha 0.05 for a two-tailed test. If we were to add in the values of \(x = 6\) and \(x = 14\) we would get 0.1153, which is above our value for alpha.

Figure 13-2 is a bar graph of showing the binomial distribution and shaded critical values. This means that \(x = 5\) and \(x = 15\) are the critical values for a two-tailed sign test with \(n = 20\). If the test statistic is less than or equal to 5 or greater than or equal to 15, we would reject \(H_{0}\).

The test statistic is the smaller of plus or minus signs, which is 2. Since \(2 \leq 5\), we would reject \(H_{0}\), which agrees with the p-value method.

If you were doing a one-tailed test you would use the probabilities for one of the tails.

A professor believes that a new online learning curriculum is increasing the median final exam score from the previous year, which was 75. A random sample of final exam scores were collected for students that went through the new curriculum. Test to see if the new curriculum is effective using \(\alpha = 0.05\).

78 100 75 64 87 80 72 91 89 70 82 76
Solution

The hypotheses are:

\(H_{0}:\) Median \(= 75\)
\(H_{1}:\) Median \(> 75\)

Find the test statistic. Compare each value to the median. If the value is below the median then give it a negative sign, if the value is above the mean then give it a positive sign. If the value is tied with the median then give it a zero.

78
+
100
+
75
0
64
-
87
+
80
+
72
-
91
+
89
+
70
-
82
+
76
+

Count the number of positive and negative signs. Positive signs = 8, Negative signs = 3. The sample size is then \(8 + 3 = 11\).

The test statistic for a right tailed test is the number of plus signs. Therefore, in this case, the test statistic is 8.

To find the critical value, use technology to find the probabilities for \(x = 0\) to \(x=11\) for a binomial distribution with \(n = 11\) and \(p = 0.5\). See Figure 13-3 for the results. Since \(\alpha = 0.05\), add up the areas starting at the bottom at \(x = 11\) until you get a sum of no more than 0.05.

\(\text{P} (9 \leq X \leq 11) = \text{P}(X=9) + \text{P}(X=10) + \text{P}(X=11) = {}_{11} C_{10} \cdot 0.5^{9} \cdot 0.5^{2} + {}_{11} C_{10} \cdot 0.5^{10} \cdot 0.5^{1} + {}_{11} C_{11} \cdot 0.5^{0} \cdot 0.5^{11} = 0.03272.\)

If we add in the next value of \(\text{P}(X = 8) = 0.08057\), the sum would exceed 0.05, so we would stop at a critical value of \(X = 9\). See Figure 13-4.

Discrete probability distribution table for values of x from 0 through 11. The sum of the probabilities for x=9, 10, and 11 is 0.03272.
Figure 13-3: Discrete probability distribution table for each value of \(x\).
Bar graph of binomial distribution for n=11 and p=0.5. The bars for values of 9, 10, and 11 are highlighted.
Figure 13-4: Graph of binomial distribution data from Figure 13-3, with the right tail highlighted.

Since the test statistic \(X = 8\) is not in the rejection area, we would fail to reject \(H_{0}\).

At the 5% significance level, there is not enough evidence to support the claim that there is a statistically significant difference in final exam scores for the new online curriculum.

The median annual salary for high school teachers in the United States was $60,320. A teacher believes that the median high school salary in Oregon is significantly less than the national median. A sample of 100 high school teacher’s salaries found that 58 were below $60,320, 40 were above $60,320 and 2 were $60,320. Use \(\alpha = 0.05\) to test their claim.

Solution

The hypotheses are:

\(H_{0}:\) Median = $60,320
\(H_{1}:\) Median < $60,320 (claim)

The sample size \(n = 58 + 40 = 98\).

We will use \(x = 58\). The p-value is found by taking \(\text{P}(X \geq 58)\). This is a lot of work by hand, so use technology. For a TI-84 calculator use \(1 - \text{binomcdf}(98, 0.5, 58) = 0.0272.\)

On a TI-84 calculator, 1 minus the binomial cdf with inputs 98, 5, and 58 is 0.0271952788.

The p-value = 0.0427, which is less than \(\alpha = 0.05\), so reject \(H_{0}\).

There is enough evidence to support the claim that the median high school salary in Oregon is significantly less than the national median of $60,320.

The sign test can also be used for dependent samples when the assumptions for a paired t-test are not met.

A manufacturer believes that if routine maintenance (cleaning and oiling of machines) is increased to once a day rather than once a week, the number of defective parts produced by the machines will decrease. Nine machines are selected, and the number of defective parts produced over a 24-hour operating period is counted. Maintenance is then increased to once a day for a week, and the number of defective parts each machine produces is again counted over a 24-hour operating period. The data are shown here. At \(\alpha = 0.05\), can the manufacturer conclude that the additional maintenance reduces the number of defective parts manufactured by the machines?

Machine 1 2 3 4 5 6 7 8 9 Before 6 18 5 4 16 13 20 9 3 After 5 16 7 4 18 12 14 7 1
Solution

\(H_{0}:\) The additional maintenance does not reduce the number of defective parts manufactured by the machines.
\(H_{1}:\) The additional maintenance reduces the number of defective parts manufactured by the machines.

Next, for each pair, take \(\text{Before} - \text{After}\). If this difference is positive then put a \(+\) sign next to it, if the difference is negative then put a \(–\) sign next to it and if the difference is zero then put a 0 next to it.

Machine 1 2 3 4 5 6 7 8 9
Before 6 18 5 4 16 13 20 9 3
After 5 16 7 4 18 12 14 7 1
Sign of Difference \(+\) \(+\) \(-\) 0 \(-\) \(+\) \(+\) \(+\) \(+\)

Count the number of positive and negative signs. Positive signs = 6, Negative signs = 2. The sample size is then \(6 + 2 = 8\).

Note that this is a right-tailed test, since we are looking at “reducing” defective parts so that \(\text{Before} > \text{After}\). The test statistic is the number of plus signs, \(x = 6\).

\(\text{P}(X \geq 6) = \text{P}(X=6) + \text{P}(X=7) + \text{P}(X=8) = {}_{8} C_{6} \cdot 0.5^{6} \cdot 0.5^{2} + {}_{8} C_{7} \cdot 0.5^{7} \cdot 0.5^{1} + {}_{8} C_{8} \cdot 0.5^{8} \cdot 0.5^{0} = 0.109375 + 0.031250 + 0.003906 = 0.144531\), which is the p-value.

For a TI calculator, use \(1 - \text{binomcdf}(8, 0.5, 6) = 0.1445\). The p-value = 0.1445, which is greater than \(\alpha = 0.05\); therefore do not reject \(H_{0}\).

There is not enough evidence to support the claim that the additional maintenance reduces the number of defective parts manufactured by the machines.

13.03: Ranking Data

The last few sections in this chapter require one to rank a data set. To rank a data set, you first must arrange the data from smallest to largest. The smallest value gets a rank of 1, the next smallest gets a rank of 2, etc. If there are any values that tie, then each of the tied values gets the average of the corresponding ranks.

Rank the following random sample: \(8, -4, 1, -3, 5, 2, -3, 0, 5, 3, 5.\)

Solution

First, sort the data from smallest to largest: \(-4, -3, -3, 0, 1, 2, 3, 5, 5, 5, 8\)

Next, rank the data. The \(-4\) gets a rank of 1. There is a tie between the next two values of \(-3\). They would have received the ranks of 2 and 3, but we do not want one of the values to be ranked higher than the other so we give both \(-3\)’s a rank of \(\frac{2+3}{2} = 2.5\). Then the next value of \(0\) gets a rank of 4 (we already used the 2nd and 3rd positions). The next set of ties for the three \(5\)’s occurs for the rank of 8th, 9th and 10th place. The average of these ranks is \(\frac{8+9+10}{3} = 9\). The following is a table of the sorted data with the corresponding ranks.

Data \(-4\) \(-3\) \(-3\) \(0\) \(1\) \(2\) \(3\) \(5\) \(5\) \(5\) \(8\) Rank 1 2.5 2.5 4 5 6 7 9 9 9 11

If there is no tie for the last data point, then your last rank will be the same as your sample size.

What is the rank for the number 15 in the following sample: \(10, 25, 15, 8, 20, 15, 10, 9, 8, 22\)?

Solution

Order the data from smallest to largest: \(8, 8, 9, 10, 10, 15, 15, 20, 22, 25\). Next, rank the data. The two \(8\)’s tie for first and second place, so each gets a rank of \(\frac{1+2}{2} = 1.5\). The \(9\) is in the third spot so it gets a rank of 3. The two \(10\)’s tie for fourth and fifth place so each gets a rank of \(\frac{4 + 5}{2} = 4.5\). The two \(15\)’s tie for sixth and seventh place so each gets a rank of \(\frac{6+7}{2} = 6.5\). The next three numbers get the ranks of 8, 9 and 10.

The answer, then, is 6.5, the rank of the number \(15\).

The Tevis Cup Ride is a 24-hour, 100-mile horse race over the Sierra Nevada mountains from Lake Tahoe to Auburn in a single day. The top 10 completion times for 2019 are shown below. Rank the completion times.

Name Completion Time Sanoma Blakeley \(09\text{:}27 \text{ PM}\) Jeremy Reynolds \(09\text{:}27 \text{ PM}\) Haley Moquin \(09\text{:}36 \text{ PM}\) Richard George \(09\text{:}37 \text{ PM}\) Suzanne Huff \(09\text{:}54 \text{ PM}\) Karen Donley \(09\text{:}54 \text{ PM}\) Nicki Meuten \(10\text{:}06 \text{ PM}\) Gwen Hall \(10\text{:}20 \text{ PM}\) Lindsay Fisher \(10\text{:}28 \text{ PM}\) Suzanne Hayes \(10\text{:}29 \text{ PM}\)
Solution

The data are already ordered. There are two ties at \(9\text{:}27\) and \(9\text{:}54\).

Time \(9\text{:}27\) \(9\text{:}27\) \(9\text{:}36\) \(9\text{:}37\) \(9\text{:}54\) \(9\text{:}54\) \(10\text{:}06\) \(10\text{:}20\) \(10\text{:}28\) \(10\text{:}29\)
Rank 1.5 1.5 3 4 5.5 5.5 7 8 9 10

13.04: Wilcoxon Signed-Rank Test

The Wilcoxon Signed-Rank Sum test is the non-parametric alternative to the dependent t-test. The Wilcoxon Signed-Rank Sum test compares the medians of two dependent distributions. The Signed-Rank Sum test, developed by Frank Wilcoxon, finds the difference between paired data values and ranks the absolute value of the differences. Then we sum the ranks for all the negative and positive differences separately. The absolute value of the smaller of these summed ranks is called \(w_{s}\). If there were any differences of zero you would not count them in your sample size.

Black-and-white portrait photograph of Frank Wilcoxon.
Frank Wilcoxon
Small Sample Size Case: \(n < 30\)

When the sample size is less than 30, the test statistic is \(w_{s}\), the absolute value of the smaller of the sum of ranks. Figure 13-5 provides critical values for the Wilcoxon Signed-Rank test. If the test statistic \(w_{s}\) is greater than the critical value from the table, we fail to reject \(H_{0}\). If the test statistic \(w_{s}\) is less than or equal to the critical value from the table, we reject \(H_{0}\).

Figure 13-5: Critical Values for the Signed Rank Test. Dashes indicate that the sample is too small to reject \(H_{0}\).
  1-Tailed \(\alpha\)   2-Tailed \(\alpha\)
\(n\) 0.01 0.05 0.10   0.01 0.05 0.10
5 - 0 2   - - 0
6 - 2 3   - 0 2
7 0 3 5   - 2 3
8 1 5 8   0 3 5
9 3 8 10   1 5 8
10 5 10 14   3 8 10
11 7 13 17   5 10 13
12 9 17 21   7 13 17
13 12 21 26   9 17 21
14 15 25 31   12 21 25
15 19 30 36   15 25 30
16 23 35 42   19 29 35
17 27 41 48   23 34 41
18 32 47 55   27 40 47
19 37 53 62   32 46 53
20 43 60 69   37 52 60
21 49 67 77   42 58 67
22 55 75 86   48 65 75
23 62 83 94   54 73 83
24 69 91 104   61 81 91
25 76 100 113   68 89 100
26 84 110 124   75 98 110
27 92 119 134   83 107 119
28 101 130 145   91 116 130
29 110 140 157   100 126 140
Example \(\PageIndex{1}\)

In an effort to increase production of an automobile part, the factory manager decides to play music in the manufacturing area. Eight workers are selected, and the number of items each produced for a specific day is recorded. After one week of music, the same workers are monitored again. The data are given in the table. At \(\alpha = 0.05\), can the manager conclude that listening to music has increased production? Use the Wilcoxon Signed-Rank Test since there is no mention of the population being normally distributed.

Worker 1 2 3 4 5 6 7 8 9

Before 6 8 10 9 5 12 9 5 7

After 10 12 9 12 8 13 8 5 10

Solution

The correct hypotheses are:

\(H_{0}\): Music in the manufacturing area does not increase production.
\(H_{1}\): Music in the manufacturing area increases production.

This is a left-tailed test.

In order to compute the t-test statistic, first compute the differences between each of the matched pairs.

Before \((x_{1})\) 6 8 10 9 5 12 9 5 7
After \((x_{2})\) 10 12 9 12 8 13 8 5 10
\(D = x_{1} - x_{2}\) –4 –4 1 –3 –3 –1 1 0 –3

Take the absolute value of each difference.

Before \((x_{1})\) 6 8 10 9 5 12 9 5 7
After \((x_{2})\) 10 12 9 12 8 13 8 5 10
\(D = x_{1} - x_{2}\) –4 –4 1 –3 –3 –1 1 0 –3
\(|D|\) 4 4 1 3 3 1 1 0 3

Rank the data and drop any ties. At this point, if any of the differences are zero, that pair is no longer used and is not ranked.

Before \((x_{1})\) 6 8 10 9 5 12 9 5 7
After \((x_{2})\) 10 12 9 12 8 13 8 5 10
\(D = x_{1} - x_{2}\) –4 –4 1 –3 –3 –1 1 0 –3
\(|D|\) 4 4 1 3 3 1 1 0 3
Rank 7.5 7.5 2 5 5 2 2 drop 5

The sample size \(n\) is the number of differences that are not zero. So, in this case, \(n = 8\). Next, take the sign of the difference and attach this plus or minus sign to each rank.

Before \((x_{1})\) 6 8 10 9 5 12 9 7
After \((x_{2})\) 10 12 9 12 8 13 8 10
\(D = x_{1} - x_{2}\) –4 –4 1 –3 –3 –1 1 –3
\(|D|\) 4 4 1 3 3 1 1 3
Rank 7.5 7.5 2 5 5 2 2 5
Signed Rank –7.5 –7.5 +2 –5 –5 -2 +2 –5

Find the sum of the positive and negative ranks:

Positive ranks: \(2 + 2 = 4\)

Negative ranks: \((-7.5) + (-7.5) + (-5) + (-5) + (-2) + (-5) = -32\).

Take the smaller of the absolute value of the sums of the ranks: \(|4| = 4, |-32| = 32\), so 4 is smaller.

This is our test statistic called \(w_{s} = 4\).

Next, use the table in Figure 13-5 to get the critical value. The table provides critical values for two-tailed tests.

This is a one-tailed test, with \(\alpha = 0.05\) and \(n = 8\). See Figure 13-6 that shows which row and column from Figure 13- 5 to use to find the critical value.

Figure 13-6: Critical value for 1-tailed test with \(\alpha = 0.05\) and \(n=8\).
    1-Tailed \(\alpha\)  
\(n\) 0.01 0.05 0.10
5 - 0 2
6 - 2 3
7 0 3 5
8 1 5 8

The critical value = 5. The test statistic \(w_{s} = 4\) is less than the critical value of 5.

The decision rule for the critical values in Figure 13-5 is to reject the null if the test statistic is less than or equal to the critical value, and do not reject the null hypothesis if the test statistic is larger than the critical value.

Since \(w_{s} < \text{Critical Value} = 5\), the decision is to reject \(H_{0}\). There is enough evidence to support the claim that listening to music has increased production.

When the sample size is 30 or more,a paired t-test may be used in most situations. However, if your population is heavily skewed or you are using interval data, then use the large sample size normal approximation Wilcoxon Signed-Rank test.

Large Sample Size Case: \(n \geq 30\)

We can use the normal approximation for sample sizes of 30 or more. The formula for the test statistic is: \[z = \frac{\left(w_{s} - \left(\dfrac{n (n+1)}{4}\right) \right)}{\sqrt{\left( \dfrac{n(n+1)(2n+1)}{24} \right)}} \nonumber\]

where \(n\) is the reduced samples size excluding any differences of zero, and \(w_{s}\) is the smaller in absolute value of the signed ranks for a two-tailed test, the sum of the positive ranks for a left-tailed test, or the sum of the negative ranks for a right-tailed test. The sample size \(n\) is the reduced sample size not including any differences of zero.

Example \(\PageIndex{2}\)

A pharmaceutical company is testing to see if there is a significant difference in the pain relief for two new pain medications. They randomly assign the two different pain medications for 34 patients with chronic pain and record the pain rating for each patient one hour after each dose. The pain ratings are on a sliding scale from 1 to 10. The results are listed below. Use the Wilcoxon Signed-Rank test to see if there is a significant difference at \(\alpha = 0.05\).

Patient Drug 1 Drug 2 Patient Drug 1 Drug 2 Patient Drug 1 Drug 2 1 2.4 2.5   13 4 6.1   25 4 5.1 2 4.7 3.3   14 2.2 2.9   26 5.5 4.4 3 1.2 5.3   15 2.7 4.3   27 3.6 3.6 4 5.9 5.6   16 2.9 3.3   28 3.8 3.5 5 4.5 5   17 5 5   29 5.4 4.8 6 4 5.3   18 3.1 5.1   30 2.4 3.2 7 2.5 4.6   19 3.3 3.3   31 4.1 2.6 8 3 2.5   20 3 5.9   32 4.5 5.7 9 5 3.4   21 5.4 3.2   33 4 5.8 10 5.8 5.4   22 4.2 5.9   34 6 5 11 1.9 5.1   23 3.6 5.9         12 3.2 4.3   24 2.2 5.6        Solution
Solution

The correct hypotheses are:

\(H_{0}\): There is no difference in the pain scale rating for the two pain medications.
\(H_{1}\): There is a difference in the pain scale rating for the two pain medications.

Compute the differences between each of the matched pairs. Rank the absolute value of the differences. Make sure to average the ranks repeated differences and do not rank any differences of zero. After the differences are ranked, attach this sign of the difference to each rank.

Patient Drug 1 Drug 2 Difference \(|D|\) Rank Signed Rank
1 2.4 2.5 –0.1 0.1 1 –1
2 4.7 3.3 1.4 1.4 17 17
3 1.2 5.3 –4.1 4.1 31 –31
4 5.9 5.6 0.3 0.3 2.5 2.5
5 4.5 5 –0.5 0.5 6.5 –6.5
6 4 5.3 –1.3 1.3 16 –16
7 2.5 4.6 –2.1 2.1 24.5 –24.5
8 3 2.5 0.5 0.5 6.5 6.5
9 5 3.4 1.6 1.6 19.5 19.5
10 5.8 5.4 0.4 0.4 4.5 4.5
11 1.9 5.1 –3.2 3.2 29 –29
12 3.2 4.3 –1.1 1.1 13 –13
13 4 6.1 –2.1 2.1 24.5 –24.5
14 2.2 2.9 –0.7 0.7 9 –9
15 2.7 4.3 –1.6 1.6 19.5 –19.5
16 2.9 3.3 –0.4 0.4 4.5 –4.5
17 5 5 0      
18 3.1 5.1 –2 2 23 –23
19 3.3 3.3 0      
20 3 5.9 –2.9 2.9 28 –28
21 5.4 3.2 2.2 2.2 26 26
22 4.2 5.9 –1.7 1.7 21 –21
23 3.6 5.9 –2.3 2.3 27 –27
24 2.2 5.6 –3.4 3.4 30 –30
25 4 5.1 –1.1 1.1 13 – 13
26 5.5 4.4 1.1 1.1 13 13
27 3.6 3.6 0      
28 3.8 3.5 0.3 0.3 2.5 2.5
29 5.4 4.8 0.6 0.6 8 8
30 2.4 3.2 –0.8 0.8 10 –10
31 4.1 2.6 1.5 1.5 18 18
32 4.5 5.7 –1.2 1.2 15 –15
33 4 5.8 –1.8 1.8 22 –22
34 6 5 1 1 11 11

Find the sum of the positive and negative ranks:

Positive ranks: \(17 + 2.5 + 6.5 + 19.5 + 4.5 + 26 + 13 + 2.5 + 8 + 18 + 11 = 128.5\)

Negative ranks: \((-1) + (-31) + (-6.5) + (-16) + (-24.5) + (-29) + (-13) + (-24.5) + (-9) + (-19.5) + (-4.5) + (-23) + (-28) + (-21) + (-27) + (-30) + (-13) + (-10) + (-15) + (-22) = -367.5\).

Take the smaller of the absolute value of the sums of the ranks: \(|128.5| = 128.5, |-367.5| = 367.5\), so 128.5 is smaller.

The smaller of the absolute value of the sum of the ranks is \(w_{s} = 128.5\).

Throw out the three differences of zero. The sample size is \(n = 31\).

The test statistic is: \(z = \frac{\left(w_{s} - \left(\frac{n(n+1)}{4}\right)\right)}{\sqrt{\left( \frac{n (n+1) (2n+1)}{24}\right) }} = \frac{\left(128.5 - \left( \frac{31 \cdot 32}{4}\right) \right)}{\sqrt{\left( \frac{31 \cdot 32 \cdot 63}{24}\right) }} = \frac{(128.5 - 248)}{\sqrt{(2604)}} = -2.341787\)

Either the \(z\) critical value or p-value method may be used, similar to how we used previous z-tests.

Compute the \(z_{\alpha/2}\) critical values. Draw and label the distribution; see Figure 13-7.

z_alpha/2 critical values of positive and negative 1.96.
Figure 13-7: \(z_{\alpha/2}\) critical values.

Use the inverse normal function \(\text{invNorm}(0.025,0,1)\) to get \(z_{\alpha/2} = \pm 1.96\). The test statistic \(z = -2.3418\) is in the shaded critical region, so reject \(H_{0}\).

There is enough evidence to support the claim that there is a significant difference in the pain scale rating for the two pain medications.

These calculations can be done by hand or using the following online calculator: http://www.socscistatistics.com/tests/signedranks.

The TI calculators and Excel do not have built-in nonparametric tests.

It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much – the wheel, New York, wars and so on – whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man – for precisely the same reasons.

(Adams, 2002)

13.05: Mann-Whitney U Test

The Mann-Whitney U Test is the non-parametric alternative to the independent t-test. The test was expanded on Frank Wilcoxon’s Rank Sum test by Henry Mann and Donald Whitney.

Black and white portrait photograph of Henry Mann.
Henry Mann

The independent t-test assumes the populations are normally distributed. When these conditions are not met, the Mann-Whitney Test is an alternative method.

If two groups come from the same distribution and were randomly assigned labels, then the two different groups should have values somewhat equally distributed between the two groups. The Mann-Whitney Test looks at all the possible rankings between the data points. For large sample sizes, a normal approximation of the distribution of ranks is used.

Small Sample Size Case \((n \leq 20)\)

Combine the data from both groups and sort from smallest to largest. Make sure to label the data values so you know which group they came from. Rank the data. Sum the ranks separately from each group. Let \(R_{1}\) = sum of ranks for group one and \(R_{2}\) = sum of ranks for group two.

Find the \(U\) statistic for both groups: \(U_{1} = R_{1} - \frac{n_{1} \left(n_{1}+1\right)}{2}, U_{2} = R_{2} - \frac{n_{2} \left(n_{2}+1\right)}{2}\).

The test statistic \(U = \text{Min} \left(U_{1}, U_{2}\right)\) is the smaller of \(U_{1}\) or \(U_{2}\). Critical values are found given in the tables in Figures 13-6 \((\alpha = 0.05)\) and 13-7 \((\alpha = 0.01)\).

Figure 13-8: Critical Values for 2-Tailed Mann-Whitney U Test for \(\alpha = 0.05\)
\(n_{2}\)
\(n_{1}\) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 - - - - - - 0 0 0 0 1 1 1 1 1 2 2 2 2
3 - - - 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8
4 - - 0 1 2 3 4 4 5 6 7 8 9 10 11 11 12 13 13
5 - 0 1 2 3 5 6 7 8 9 11 12 13 14 15 17 18 19 20
6 - 1 2 3 5 6 8 10 11 13 14 16 17 19 21 22 24 25 27
7 - 1 3 5 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34
8 0 2 4 6 8 10 13 15 17 19 22 24 26 29 31 34 36 38 41
9 0 2 4 7 10 12 15 17 21 23 26 28 31 34 37 39 42 45 48
10 0 3 5 8 11 14 17 20 23 26 29 33 36 39 42 45 48 52 55
11 0 3 6 9 13 16 19 23 26 30 33 37 40 44 47 51 55 58 62
12 1 4 7 11 14 18 22 26 29 33 37 41 45 49 53 57 61 65 69
13 1 4 8 12 16 20 24 28 33 37 41 45 50 54 59 63 67 72 76
14 1 5 9 13 17 22 26 31 36 40 45 50 55 59 64 67 74 78 83
15 1 5 10 14 19 24 29 34 39 44 49 54 59 64 70 75 80 85 90
16 1 6 11 15 21 26 31 37 42 47 53 59 64 70 75 81 86 92 98
17 2 6 11 17 22 28 34 39 45 51 57 63 67 75 81 87 93 99 105
18 2 7 12 18 24 30 36 42 48 55 61 67 74 80 86 93 99 106 112
19 2 7 13 19 25 32 38 45 52 58 65 72 78 85 92 99 106 113 119
20 2 8 14 20 27 34 41 48 55 62 69 76 83 90 98 105 112 119 127
Figure 13-9: Critical Values for 2-Tailed Mann-Whitney U Test for \(\alpha = 0.01\)
\(n_{2}\)
\(n_{1}\) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
2 - - - - - - - - - - - - - - - - - 0 0
3 - - - - - - - 0 0 0 1 1 1 2 2 2 2 3 3
4 - - - - 0 0 1 1 2 2 3 3 4 5 5 6 6 7 8
5 - - - 0 1 1 2 3 4 5 6 7 7 8 9 10 11 12 13
6 - - 0 1 2 3 4 5 6 7 9 10 11 12 13 15 16 17 18
7 - - 0 1 3 4 6 7 9 10 12 13 15 16 18 19 21 22 24
8 - - 1 2 4 6 7 9 11 13 15 17 18 20 22 24 26 28 30
9 - 0 1 3 5 7 9 11 13 16 18 20 22 24 27 29 31 33 36
10 - 0 2 4 6 9 11 13 16 18 21 24 26 29 31 34 37 39 42
11 - 0 2 5 7 10 13 16 18 21 24 27 30 33 36 39 42 45 46
12 - 1 3 6 9 12 15 18 21 24 27 31 34 37 41 44 47 51 54
13 - 1 3 7 10 13 17 20 24 27 31 34 38 42 45 49 53 56 60
14 - 1 4 7 11 15 18 22 26 30 34 38 42 46 50 54 58 63 67
15 - 2 5 8 12 16 20 24 29 33 37 42 46 51 55 60 64 69 73
16 - 2 5 9 13 18 22 27 31 36 41 45 50 55 60 65 70 74 79
17 - 2 6 10 15 19 24 29 34 39 44 49 54 60 65 70 75 81 86
18 - 2 6 11 16 21 26 31 37 42 47 53 58 64 70 75 81 87 92
19 0 3 7 12 17 22 28 33 39 45 51 56 63 69 74 81 87 93 99
20 0 3 8 13 18 24 30 36 42 46 54 60 67 73 79 86 92 99 105

If \(U\) is less than or equal to the critical value, then reject \(H_{0}\). Dashes indicate that the sample is too small to reject \(H_{0}\).

If you have only sample size above 20, use the following online calculator to find the critical value: https://www.socscistatistics.com/tests/mannwhitney/default.aspx.

Student employees are a major part of most college campus employment. Two major departments that participate in student hiring are listed below with the number of hours worked by students for a month. At the 0.05 level of significance, is there sufficient evidence to conclude a difference in hours between the two departments?

Athletics 20 24 17 12 18 22 25 30 15 19   Library 35 28 24 20 25 18 22 26 31 21 19
Solution

The hypotheses are:

\(H_{0}\): There is no difference in the number of hours student employees work for the athletics department and the library.
\(H_{1}\): There is a difference in the number of hours student employees work for the athletics department and the library.

Since the sample sizes are small and the distributions are not assumed to be normally distributed, the t-test for independent groups should not be used. Instead, we will use the nonparametric Mann-Whitney Test. To start, combine the groups, sort the data from smallest to largest, and note which group the data point is from.

Rank the data and look for the ties. Figure 13-10 shows the ranks for the combined data.

Figure 13-10: Ranks for combined and ordered data.
Student Department Hours Rank
1 Athletics 12 1
2 Athletics 15 2
3 Athletics 17 3
4 Athletics 18 4.5
5 Library 18 4.5
6 Athletics 19 6.5
7 Library 19 6.5
8 Athletics 20 8.5
9 Library 20 8.5
10 Library 21 10
11 Athletics 22 11.5
12 Library 22 11.5
13 Athletics 24 13.5
14 Library 24 13.5
15 Athletics 25 15.5
16 Library 25 15.5
17 Library 26 17
18 Library 28 18
19 Athletics 30 19
20 Library 31 20
21 Library 35 21

Sum the ranks for each group:

\(R_{1} = 1 + 2 + 3 + 4.5 + 6.5 + 8.5 + 11.5 + 13.5 + 15.5 + 19 = 85\)

\(R_{2} = 4.5 + 6.5 +8.5 + 10 + 11.5 + 13.5 + 15.5 + 17 + 18 + 20 + 21 = 146\)

Compute the test statistic:

\(U_{1} = R_{1} - \frac{n_{1} \left(n_{1}+1\right)}{2} = 85 - \frac{10 \cdot 11}{2} = 30\)

\(U_{2} = R_{2} - \frac{n_{2} \left(n_{2}+1\right)}{2} = 146 - \frac{11 \cdot 12}{2} = 80\)

\(U = 30\)

Find the critical value using Figure 13-8, where \(n_{1} = 10\) and \(n_{2} = 11\). The critical value = 26.

Do not reject \(H_{0}\), since \(U = 30 > \text{CV} = 26\).

There is not enough evidence to support the claim that there is a difference in the number of hours student employees work for the athletics department and the library.

Large Sample Size Case (\(n_{1} > 20\) and \(n_{2} > 20\))

Find the \(U\) statistic for both groups: \(U_{1} = R_{1} - \frac{n_{1} \left(n_{1}+1\right)}{2}\), \(U_{2} = R_{2} - \frac{n_{2} \left(n_{2}+1\right)}{2}\).

Let \(U = \text{Min} \left(U_{1}, U_{2}\right)\), the smaller of \(U_{1}\) or \(U_{2}\). The formula for the test statistic is: \[z = \frac{\left(U - \left( \dfrac{n_{1} \cdot n_{2}}{2} \right)\right)}{\sqrt{\dfrac{n_{1} \cdot n_{2} \left(n_{1} + n_{2} + 1\right)}{12}}} \nonumber\]

A manager believes that the sales of coffee at their Portland store is more than the sales at their Cannon Beach store. They take a random sample of weekly sales from the two stores over the last year. Use the Mann-Whitney test to see if the manager’s claim could be true. Use the p-value method with \(\alpha = 0.05\).

Portland Cannon Beach 1510 1257   3585 1510 4125 4677   4399 5244 1510 3055   1764 1510 5244 1764   3853 4399 4125 6128   5244 1510 6128 3319   1510 5244 3319 6433   2533 4125 3319 5244   3585 2275 3055 6134   2533 2275 4025 3015   4399 3585       4125 5244\
Solution

Always choose group 1 as the group with the smallest sample size: in this case, Portland. (If the sample sizes are equal, then whatever group comes first in the problem is group one.) If there are no ties at the end, the last rank should match the total of both sample sizes.

Combine the data, keeping the group label, then rank the combined data.

Order Store Sales Rank Order Store Sales Rank
1 Portland 1257 1   22 Cannon Beach 3585 21
2 Portland 1510 4.5   23 Cannon Beach 3853 23
3 Portland 1510 4.5   24 Portland 4025 24
4 Cannon Beach 1510 4.5   25 Portland 4125 26.5
5 Cannon Beach 1510 4.5   26 Portland 4125 26.5
6 Cannon Beach 1510 4.5   27 Cannon Beach 4125 26.5
7 Cannon Beach 1510 4.5   28 Cannon Beach 4125 26.5
8 Portland 1764 8.5   29 Cannon Beach 4399 30
9 Cannon Beach 1764 8.5   30 Cannon Beach 4399 30
10 Cannon Beach 2275 10.5   31 Cannon Beach 4399 30
11 Cannon Beach 2275 10.5   32 Portland 4677 32
12 Cannon Beach 2533 12.5   33 Portland 5244 35.5
13 Cannon Beach 2533 12.5   34 Portland 5244 35.5
14 Portland 3015 14   35 Cannon Beach 5244 35.5
15 Portland 3055 15.5   36 Cannon Beach 5244 35.5
16 Portland 3055 15.5   37 Cannon Beach 5244 35.5
17 Portland 3319 18   38 Cannon Beach 5244 35.5
18 Portland 3319 18   39 Portland 6128 39.5
19 Portland 3319 18   40 Portland 6128 39.5
20 Cannon Beach 3585 21   41 Portland 6134 41
21 Cannon Beach 3585 21   42 Portland 6433 42

The hypotheses are:

\(H_{0}\): There is no difference in the coffee sales between the Portland and Cannon Beach stores.
\(H_{1}\): There is a difference in the coffee sales between the Portland and Cannon Beach stores.

Sum the ranks for each group.

The sum for the Portland store’s ranks: \(R_{1} = 459.5\).
The sum for the Cannon Beach store’s ranks: \(R_{2} = 443.5\).

Compute the test statistic:

\(U_{1} = R_{1} - \frac{n_{1} \left(n_{1}+1\right)}{2} = 459.5 - \frac{20 \cdot 21}{2} = 249.5\)

\(U_{2} = R_{2} - \frac{n_{2} \left(n_{2}+1\right)}{2} = 443.5 - \frac{22 \cdot 23}{2} = 190.5\)

\(U = 190.5\)

\(z = \frac{190.5 - \left(\frac{20 \cdot 22}{2}\right)}{\sqrt{ \left(\frac{20 \cdot 22 (20 + 22 + 1)}{12}\right) }} = -0.7429\)

This test uses the standard normal distribution with the same technique for finding a p-value or critical value as the z-test performed in previous chapters. Compute the p-value for a standard normal distribution for \(z = -0.7429\) for a two-tailed test using \(2 * \text{normalcdf}(-1E99,-0.7429,0,1) = 0.4575\).

Using a TI-84 calculator to find 2 times the normal cdf with parameters -1E99, -0.7429, 0, and 1, to get an answer of 0.45754.

The p-value = \(0.4575 > \alpha = 0.05\); therefore, do not reject \(H_{0}\).

This is a two-tailed test with \(\alpha = 0.05\). Use the lower tail area of \(\alpha/2 = 0.05\) and you get critical values of \(z_{\alpha/2} = \pm 1.96\).

There is not enough evidence to support the claim that there is a difference in coffee sales between the Portland and Cannon beach stores.

There are no shortcut keys on the TI calculators or Excel for this Nonparametric Test. Note that if your data has tied ranks, there are several methods not addressed in this text, to correct the standard deviation. Hence, the z-score in some software packages may not match your results calculated by hand.

13.06: Chapter 13 Formulas

Ranking Data

  • Order the data from smallest to largest.
  • The smallest value gets a rank of 1.
  • The next smallest gets a rank of 2, etc.
  • If there are any values that tie, then each of the tied values gets the average of the corresponding ranks.





Sign Test

\(H_{0}:\) Median \(= MD_{0}\)
\(H_{1}:\) Median \(\neq MD_{0}\)
p-value uses binomial distribution with \(p = 0.5\) and \(n\) is the sample size not including ties with the median or differences of 0.

  • For a two-tailed test, the test statistic, \(x\), is the smaller of the plus or minus signs. If \(x\) is the test statistic, the p-value for a two-tailed test is \(2* \text{P}(X \leq x)\).
  • For a right-tailed test, the test statistic, \(x\), is the number of plus signs. For a left-tailed test, the test statistic, \(x\), is the number of minus signs. The p-value for a one-tailed test is the \(\text{P}(X \geq x)\) for a right-tailed test, or \(\text{P}(X \leq x)\) for a left-tailed test.

Wilcoxon Signed-Rank Test

\(n\) is the sample size not including a difference of 0.

When \(n < 30\), use test statistic \(w_{s}\), which is the absolute value of the smaller of the sum of ranks. CV uses table in Figure 13-5. If critical value is not in tables then use an online calculator: http://www.socscistatistics.com/tests/signedranks.

When \(n \geq 30\), use z-test statistic: \[z = \frac{\left(w_{s} - \left(\dfrac{n (n+1)}{4}\right) \right)}{\sqrt{\left( \dfrac{n(n+1)(2n+1)}{24} \right)}} \nonumber\]

Mann-Whitney U Test

When \(n_{1} \leq 20\) and \(n_{2} \leq 20\):

\(U_{1} = R_{1} - \frac{n_{1} \left(n_{1}+1\right)}{2}, U_{2} = R_{2} - \frac{n_{2} \left(n_{2}+1\right)}{2}\).

\(U = \text{Min} \left(U_{1}, U_{2}\right)\)

CV uses table in Figures 13-8 or 13-9. If critical value is not in tables then use an online calculator: https://www.socscistatistics.com/tests/mannwhitney/default.aspx.

When \(n_{1} > 20\) and \(n_{2} > 20\) use z-test statistic: \[z = \frac{\left(U - \left(\dfrac{n_{1} \cdot n_{2}}{2}\right) \right)}{\sqrt{\left( \dfrac{n_{1} \cdot n_{2} \left(n_{1} + n_{2} + 1\right)}{12} \right)}} \nonumber\]

“For instance, a race of hyperintelligent pan‐dimensional beings once built themselves a gigantic supercomputer called Deep Thought to calculate once and for all the Answer to the Ultimate Question of Life, the Universe, and Everything. For seven and a half million years, Deep Thought computed and calculated, and in the end announced that the answer was in fact Forty‐two - and so another, even bigger, computer had to be built to find out what the actual question was.”

(Adams, 2002)

13.07: Chapter 13 Exercises

Chapter 13 Exercises

For exercises 1-6, show all 5 steps for hypothesis testing:

a) State the hypotheses.
b) Compute the test statistic.
c) Compute the critical value or p-value.
d) State the decision.
e) Write a summary.

1. A real estate agent suggests that the median rent for a one-bedroom apartment in Portland has changed from last year’s median of $825 per month. A sample of 12 one-bedroom apartments shows these monthly rents in dollars for a one-bedroom apartment; 820, 720, 960, 660, 735, 910, 825, 1050, 915, 905, 1050, 950. Is there enough evidence to claim that the median rent has changed from $825? Use \(\alpha = 0.05\).

2. The median age in the United States is 38 years old. The mayor of a particular city believes that her population is considerably “younger.” At \(\alpha = 0.05\), is there sufficient evidence to support her claim. The data below represent a random selection of persons from the city.

40 36 27 72 12 30 52 45 10 24
22 25 43 39 48 25 95 29 19 30
50 37 18 36 15 60 38 42 41 61

3. A meteorologist believes that the median temperature for the month of July in Jacksonville, Florida, is higher than the previous July’s 81˚F. The following sample shows the temperatures taken at noon in Jacksonville during July. Is there enough evidence to support the meteorologist’s claim? Use \(\alpha = 0.05\).

79 85 81 95 80 98 82 81 76 84 90 93

4. A sample of 10 Kitti’s hog-nosed bats’ weights in grams is shown below. Test the claim that median weight for all bumblebee bats is not equal to 2 grams, using a 1% level of significance.

Weight 2.22 1.6 1.78 1.52 1.61 1.98 1.56 2.24 1.55 2.28

5. Test to see if the median assessed property value (in $1,000s) changed between 2010 and 2016. Use the sign test and \(\alpha = 0.05\).

Ward A B C D E F G H I J K
2010 184 414 22 99 116 49 24 50 282 25 141
2016 161 382 22 190 120 52 28 50 297 40 148

6. A company institutes an exercise break for its workers to see if this will improve job satisfaction. Scores for 10 workers were sampled from a questionnaire before and after the exercise break was implemented. Higher scores indicate a higher job satisfaction. Use the sign test to see if the exercise break increased the job satisfaction scores. Use \(\alpha = 0.05\).

Before 34 28 29 45 26 27 24 15 15 27
After 33 36 29 50 37 29 25 20 18 28

7. Rank the following data set: \(-15, -25, -5, -5, -8, -15, -2, -4, -5\).

8. Rank the following data set: \(6, 3, 0, 2, 3, 5, 4, 8, 9, 5, 6, 5, 7. 9\).

9. Rank the following data set: \(1, 2, 9, 3, 5, 1, 2, 8, 6\).

10. Rank the following data set: \(5, -1, 2, 0, 1, -1, 0, 3, 9, 6, 1, 1, 4\).


For exercises 11-20, show all 5 steps for hypothesis testing:

a) State the hypotheses.
b) Compute the test statistic.
c) Compute the critical value or p-value.
d) State the decision.
e) Write a summary.

11. A manager wishes to see if the time (in minutes) it takes for their workers to complete a certain task will decrease when they are allowed to wear earbuds at work. A random sample of 20 workers' times were collected before and after. Test the claim that the time to complete the task has decreased at a significance level of \(\alpha = 0.01\) using the Wilcoxon Signed-Rank test. You obtain the following sample data.

Before After Before After
69 62.3   61.7 56.8
71.5 61.6   55.9 44.7
39.3 21.4   56.8 50.6
67.7 60.4   71 63.4
38.3 47.9   80.6 68.9
85.9 77.6   59.8 35.5
67.3 75.1   72.1 77
59.8 46.3   49.9 38.4
72.1 65   56.2 55.4
79 83   63.3 51.6

12. Doctors developed an intensive intervention program for obese patients with heart disease. Subjects with a BMI of 30 kg/m2 or more with heart disease were assigned to a three-month lifestyle change of diet and exercise. Patients’ Left Ventricle Ejection Fraction (LVEF) are measured before and after intervention. Larger numbers indicate a healthier heart. Test to see if the intervention program significantly increased the LVEF. Use the Wilcoxon Signed-Rank test with \(\alpha = 0.05\).

Before 44 49 50 49 57 62 39 41 52 42
After 56 58 64 60 63 71 49 51 60 55

13. An adviser is testing out a new online learning module for a placement test. They wish to test the claim that the new online learning module increased placement scores at a significance level of \(\alpha = 0.05\). You obtain the following paired sample of 19 students who took the placement test before and after the learning module. Use the Wilcoxon Signed-Rank test.

Before After Before After Before After Before After
55.8 57.1   11.4 20.6   42.6 51.5   46.1 57
51.7 58.3   30.6 35.2   61.2 76.6   72.8 66.1
76.6 83.6   53 46.7   26.8 28.6   42.2 38.1
47.5 49.5   21 22.5   11.4 14.5   51.3 42.4
48.6 51.1   58.5 47.7   56.3 43.7      

14. Dating couples were matched according to who asked the other person out first. Their age was then compared. Is there a significant difference in the age of dating couples based on who asked out the other person first? Dependent samples, use \(\alpha = 0.05\) and the Wilcoxon Signed-Rank test.

First Asked 18 43 32 27 15 45 21 22
Accepted 16 38 35 29 14 46 25 28

15. In Major League Baseball, the American League (AL) allows a designated hitter (DH) to bat in place of the pitcher, but in the National League (NL), the pitcher has to bat. However, when an AL team is the visiting team for a game against an NL team, the AL team must abide by the home team’s rules and thus, the pitcher must bat. A researcher is curious if an AL team would score differently for games in which the DH was used. She samples 20 games for an AL team for which the DH was used, and 20 games for which there was no DH. The data are below. Use the Mann-Whitney test with \(\alpha = 0.05\).

With Designated Hitter Without Designated Hitter
0 5 4 7   3 6 5 2
1 2 7 6   12 4 0 1
6 4 2 10   6 3 7 8
1 2 7 5   4 0 5 1
8 4 11 0   2 4 6 4

16. A professor wants to know whether there is a difference in comprehension of a lab assignment among students depending on if the instructions are given all in text, or if they are given primarily with visual illustrations. She randomly divides her class into two groups of 15 and gives one group instructions in text and the second group instructions with visual illustrations. The following data summarizes the scores the students received on a test given after the lab. Is there evidence to suggest that a difference? Use the Mann-Whitney test with \(\alpha = 0.05\).

Text Visual Illustrations
57.3 87.3 67.2   59.0 76.7 88.2
45.3 75.2 54.4   57.6 78.2 43.8
87.1 88.2 93.0   72.9 64.4 97.1
61.2 67.5 89.2   83.2 89.0 95.1
43.1 86.2 52.0   64.0 72.9 84.1

17. “Durable press” cotton fabrics are treated to improve their recovery from wrinkles after washing. “Wrinkle recovery angle” measures how well a fabric recovers from wrinkles. Higher is better. Here are data on the wrinkle recovery angle (in degrees) for a random sample of fabric specimens. A manufacturer wants to see if there is a difference in the wrinkle recovery angle for two different fabric treatments, Permafresh and Hylite. Test the claim using a 5% level of significance. Use the Mann-Whitney test.

Permafresh Hylite
144 102 131 118   139 146 139 139 146
136 127 137 148   131 138 138 132 142
117 137 147 129   133 142 138 137 134
133 137 148 135   146 137 138 138 133
124 139 164 142   139 140 141 140 141

18. A researcher is curious what year in college students make use of the gym at a university. They take a random sample of 30 days and count the number of sophomores and seniors who use the gym each day. Is there evidence to suggest that a difference exists in gym usage based on year in college? Use the Mann-Whitney test with \(\alpha = 0.01\).

Sophomores Seniors
189 208 167 154 217   209 199 186 210 221
209 198 143 208 220   204 214 230 170 197
188 197 165 207 231   198 201 165 183 235
201 177 186 193 201   187 199 189 194 197
190 165 180 245 200   192 195 200 211 205
199 155 165 188 187   200 190 218 210 229

19. A movie theater company wants to see if there is a difference in the movie ticket sales in San Diego and Portland per week. They sample 20 sales from San Diego and 20 sales from Portland and count the number of tickets sold over a week. Use the Mann-Whitney test to test the claim using a 5% level of significance.

San Diego Portland
223 243 231 235   233 228 209 214
221 182 217 211   219 212 214 222
206 229 219 239   226 216 223 220
215 214 234 221   226 219 221 223
226 233 239 232   219 211 218 224

20. A new over-the-counter medicine to treat a sore throat is to be tested for effectiveness. The makers of the medicine take two random samples of 25 individuals showing symptoms of a sore throat. Group 1 receives the new medicine and Group 2 receives a placebo. After a few days on the medicine, each group is interviewed and asked how they would rate their comfort level 1-10 (1 being the most uncomfortable and 10 being no discomfort at all). The results are below. Is there sufficient evidence to conclude that there is a difference? Use the Mann-Whitney test and \(\alpha = 0.01\).

Group 1 Group 2
3 5 6 7 5   4 5 8 3 5
3 4 5 7 7   2 7 8 2 4
3 2 5 8 8   1 2 2 3 2
7 7 8 4 8   1 3 5 5 1
4 8 3 9 10   6 4 7 8 1
Answers to Odd-Numbered Exercises

1. \(H_{0}:\) Median \(= 825\); \(H_{1}:\) Median \(\neq 825\); Test Statistic = 4; p-value = 0.5548. Do not reject \(H_{0}\). There is not enough evidence to support the claim that the median rent has changed from last year’s median of $825 per month.

3. \(H_{0}:\) Median \(= 81\); \(H_{1}:\) Median \(> 81\); Test Statistic = 7; p-value = 0.0547. Do not reject \(H_{0}\). There is not enough evidence to support the claim that the median temperature for the month of July in Jacksonville, Florida, is higher than the previous year's of 81˚F.

5. \(H_{0}:\) There is no change in the median assessed property value between 2010 and 2016. \(H_{1}:\) There is a change in the median assessed property value between 2010 and 2016. Test Statistic = 2; p-value = 0.1797. Do not reject \(H_{0}\). There is not enough evidence to support the claim that is a change in the median assessed property value between 2010 and 2016.

7.

Ordered Data Rank
-25 1
-15 2.5
-15 2.5
-8 4
-5 6
-5 6
-5 6
-4 8
-2 9

9.

Ordered Data Rank
0 1
2 2
3 3.5
3 3.5
4 5
5 7
5 7
5 7
6 9.5
6 9.5
7 11
8 12
9 13

11. \(H_{0}:\) The time to complete the task will not decrease when workers are allowed to wear earbuds. \(H_{1}:\) The time to complete the task will decrease when workers are allowed to wear earbuds. \(w_{s} = 27.5; \text{CV} = 43\). Reject \(H_{0}\). There is enough evidence that allowing the workers to wear earbuds significantly decreased the time for workers to complete tasks.

13. \(H_{0}:\) The new online learning module did not increase student’s placement scores. \(H_{1}:\) The new online learning module increased student’s placement scores. \(w_{s} = 74.5; \text{CV} = 53\). Do not reject \(H_{0}\). There is not enough evidence to support the claim that the new online learning module increased students’ placement scores.

15. \(H_{0}:\) An American League team would score the same for games in which the designated hitter was used. \(H_{1}:\) An American League team would score differently for games in which the designated hitter was used. \(U = 181; text{CV} = 127\). Do not reject \(H_{0}\). There is not enough evidence to support the claim that an American League team would score differently for games in which the designated hitter was used.

17. \(H_{0}:\) There is no difference in the wrinkle recovery angle for two different fabric treatments, Permafresh and Hylite. \(H_{1}:\) There is a difference in the wrinkle recovery angle for two different fabric treatments, Permafresh and Hylite. \(z = -1.4048; \text{CV} = \pm 1.96\). Do not reject \(H_{0}\). There is not enough evidence to support the claim that there is a difference in the wrinkle recovery angle for two different fabric treatments, Permafresh and Hylite.

19. \(H_{0}:\) There is no difference in the movie ticket sales in San Diego and Portland per week. \(H_{1}:\) There is a difference in the movie ticket sales in San Diego and Portland per week. \(U = 144.5; \text{CV} = 127\). Do not reject \(H_{0}\). There is not enough evidence to support the claim there is a difference in the movie ticket sales in San Diego and Portland per week.

“Ford didn't comment. He was listening to something. He passed the Guide over to Arthur and pointed at the screen. The active entry read ‘Earth. Mostly harmless.’

…Earth, a world whose entire entry in the Hitchhiker's Guide to the Galaxy comprised the two words ‘Mostly harmless.’”

(Adams, 2002)

From Mostly Harmless Statistics by Rachel L. Webb, adapted from LibreTexts. Licensed CC BY-SA 4.0. XYZ Homework OER web edition, adapted with 7 verified corrections (see errata).