You are on page 1of 27

Chapter

11

Nonparametric Tests

Elementary Statistics Larson Farber

Section 11.1

The Sign Test

Nonparametric Tests A nonparametric test is a hypothesis test that does not require any specific conditions about the shape of the populations or the value of any population parameters. The Sign Test is a nonparametric test that can be used to test a population median against a hypothesized value. k. Hypotheses Left-tailed test: or median <k H0: median k and Ha: Right-tailed or test: H0: median ≤ k and Ha: median > k Two-tailed test: H0: median = k and Ha: median k . Tests are often called “distribution free” tests.

• If the entry is below the median. first compare each entry in the sample to the hypothesized median. the null hypothesis is not likely to be rejected. it is likely that the null hypothesis will be rejected. Compare the number of + and – signs. • If the entry is equal to the median. . assign it a – sign. If they are not approximately equal.) If the number of + signs and the number of – signs are approximately equal. assign it a 0. assign it a + sign.Sign Test To use the sign test. (Ignore 0’s. however. k. • If the entry is above the median.

Sign Test Test Statistic: When n ≤ 25. the test statistic is: For n > 25. When n > 25.50. . the test statistic is the smaller number of + or – signs. you are testing the binomial probability that = 0.

Write the null and alternative hypothesis.01 3. At = 0. State the level of significance. = 0.01. Binomial with p = 0. can you support the meteorologist’s claim? 58 62 55 55 53 52 52 59 55 55 60 56 57 61 58 63 63 55 1. The temperatures (in degrees Fahrenheit) for 18 randomly selected January days are listed below. H0: median = 57º and Ha: median ≠ 57º 2.5 .Application A meteorologist claims that the daily median temperature for the month of January in San Diego is 57º Fahrenheit. Determine the sampling distribution.

this is a two-tail test. .58 62 55 55 53 52 52 59 55 55 60 56 57 61 58 63 63 55 + – + + – – – 0 – + – + – + + + – – There are 8 + signs and 9 – signs. n = 8 + 9 = 17. Since Ha contains the ≠ symbol. So.

Find the test statistic. Find the critical value. . The test statistic is the smaller number of + or – signs. use Table 8 Critical value is 2. With n = 17. Reject H0 if the test statistic is less than or equal to 2. so the test statistic is 8.4. Find the rejection region. 6. 5.

Use the same procedure. . 8. The sign test can also be used with paired data (such as before and after). Interpret your decision. does not fall in the critical region. 8. Fail to reject the null hypothesis. The test statistic. Find the difference between corresponding values and record the sign.7. There is not enough evidence to reject the meteorologist’s claim that the median daily temperature for January in San Diego is 57 . Make your decision.

2 The Wilcoxon Test .Section 11.

•Find the sum of the positive ranks.Wilcoxon Signed-Rank Test The Wilcoxon signed-rank test is a nonparametric test that can be used to determine whether two dependent samples were selected from populations with the same distribution. ws •Find the difference for each pair: Sample 1 value – Sample 2 value •Find the absolute value of the difference. •Select the smaller of the absolute values of the sums. •Find the sum of the negative ranks. •Rank order these differences. . To find the test statistic. •Affix a + or – sign to each of the rankings.

01. = 0.Application The table shows the daily headache hours suffered by 12 patients before and after receiving a new drug for seven weeks.01 . At = 0. State the level of significance. (Claim) 2. is there enough evidence to conclude that the new drug helped to reduce daily headache hours? 1. Ha: The new drug reduces headache hours. Write the null and alternative hypothesis. H0: The headache hours after using the new drug are at least as long as before using the drug.

4 2.8 2.3 0.6 –0.8 2.0 7.0 7.1 3.2 2.0 8.1 1.4 2.4 0.8 1.8 2.1 0.3 –0.9 3.6 1.5 1.0 –1.8 1. Abs Rank Sign Rank 1 2 3 4 5 6 7 8 2.0 1.5 2.0 6.1 1.8 1.0 4.5 3.0 6.6 3.5 3.4 0.1 0.5 1.5 5.5 5.Before After Diff.0 –1.1 1.9 1.4 3.5 2.1 1.0 .8 0.0 4.0 1.0 8.

5 + (–1.The sum of the positive ranks is 5 + 6 + 3 + 8 + 7 + 4 = 33. There are 8 + and – signs.5) = –3. ws = 3. so n = 8. Because ws = 3 is greater than the critical value. The critical value is 2. The sum of the negative ranks is –1. . The test statistic is the smaller of the absolute value of these sums. fail to reject the null hypothesis. There is not enough evidence to conclude the new drug reduces headache hours.

. it does not matter which is n1.Wilcoxon Rank-Sum Test The Wilcoxon rank-sum test is a nonparametric test that can be used to determine whether two independent samples were selected from populations having the same distribution. Then n1 represents the size of the smaller sample and n2 the size of the larger sample. When the samples are the same size. Both samples must be at least 10.

R = the sum of the ranks for the smaller sample. where . Find the z-score for the value of R.Wilcoxon Rank-Sum Test Test statistic: Combine the data from both samples and rank it.

3 The KruskalKruskal-Wallis Test .Section 11.

Then separate the data according to sample and find the sum of the ranks for each sample. Combine the data and rank the values. .The Kruskal-Wallis Test The Kruskal-Wallis test is a nonparametric test that can be used to determine whether three or more independent samples were selected from populations having the same distribution. Ri = the sum of the ranks for sample i. Ha: There is a difference in the population distributions. H0: There is no difference in the population distributions.

Reject the null hypothesis when H is greater than the critical number. (Always use a right-tail test. The sampling distribution is a chi-square distribution with k – 1 degrees of freedom (where k = the number of samples). and Ri is the sum of the ranks of the i th sample. the test statistic H for the Kruskal-Wallis test is: where k represents the number of samples.The Kruskal-Wallis Test Given three or more independent samples. ni is the size of the i th sample.) . N is the sum of the sample sizes.

06 14. can you conclude that the distributions of accountants’ hourly pay rates in these three states are different? MI(1) 14.18 20.01 13.88 20.47 14.Application You want to compare the hourly pay rates of accountants who work in Michigan.020 20. At the .380 14.630 17.26 21.94 16.08 15.06 21.94 NY(2) 21.95 17.94 13.54 14.03 19. New York and Virginia.900 20.48 16.83 19.540 15.800 15.24 14.500 12.89 18.470 15.01 level. To do so.480 18.85 17. you randomly select 10 accountants in each state and record their hourly pay rate as shown below.570 .81 VA(3) 17.

5. State the level of significance. 2. H0 : There is no difference in the hourly pay rate in the 3 states. Write the null and alternative hypothesis.1. Ha : There is a difference in the hourly pay in the 3 states. X2 The sampling distribution is chi-square with d.01 3. Find the critical value.f.210. the critical value is 9. = 0. 4. . Determine the sampling distribution. = 3 – 1 = 2. From Table 6. Find the rejection region.

850 14.480 14.540 18.010 19. 4. 7.880 19. 23.5.180 21. 9.080 13.940 17. 15. 26 The sum is 147.020 17. 13. . 16.570 15.940 16. 29.5.940 21.630 20.Test Statistic Data 12. 5. 19.030 21. 14. 27.380 15. 20. New York salaries are in ranks: 8.830 14. 21. Virginia salaries are in ranks: 1.800 13.500 18.810 State VA MI MI MI MI MI MI NY VA VA VA VA MI NY MI VA MI VA NY VA NY MI NY NY VA VA NY NY NY NY Rank 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17. 28. 6.470 17.480 20.950 20.5.890 14.260 16. 3. 30 The sum is 223.060 14. 11. 12.240 14. 17. 24.5.5 17.5 19 20 21 22 23 24 25 26 27 28 29 30 Michigan salaries are in ranks: 2.540 15. 10.060 20.900 15.470 17. 17. 22 The sum is 94. 25.

76 falls in the rejection region. R3 = 147.5. so reject the null hypothesis. Interpret your Decision There is a difference in the salaries of the 3 states.Find the test statistic. R2 = 223.5 9. n2 = 10 and n3 = 10.76 Make Your Decision The test statistic 10. so N = 30 R1 = 94.210 10. n1 = 10. .

Section 11.4 Rank Correlation .

rs.) . The hypotheses: (There is no correlation between the variables. The formula for the Spearman rank correlation coefficient is where n is the number of paired data entries and d is the difference between the ranks of a paired data entry.Rank Correlation The Spearman rank correlation coefficient. The Spearman rank correlation coefficient is calculated using the ranks of paired sample data entries.) (There is a significant correlation between the variables. is a measure of the strength of the relationship between two variables.

test the claim that there is a significant correlation between the variables. The seven candidates were placed in rank order first by x and then by y.) . Using a .) (There is a significant correlation between the variables.Rank Correlation Seven candidates applied for a nursing position.05 level of significance. x 1 2 3 4 5 6 7 2 4 1 5 7 3 6 y 1 4 3 2 6 1 7 (There is no correlation between the variables. The results of the rankings are listed below.

715 Since the statistic 0. fail to reject H0.643 does not fall in the rejection region. There is not enough evidence to support the claim that there is a significant correlation. .Application x 1 2 3 4 5 6 7 2 4 1 5 7 3 6 y 1 4 3 2 6 1 7 d=x–y 1 0 –2 3 1 2 –1 d2 1 0 4 9 1 4 1 20 Critical Value = 0 .