Download presentation
Presentation is loading. Please wait.
Published byKelly Booker Modified over 9 years ago
1
1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?
2
2 Learning Objectives 1. Nonparametric Statistical Methods 2. Wilcoxon Test 3. The Wilcoxon Rank Sum 4. Using the Wilcoxon Test with a Quantitative Response 5. Nonparametric Estimation Comparing Groups
3
3 Learning Objective 1: Nonparametric Statistical Methods Nonparametric methods are especially useful: When the data are ranks for the subjects, rather than quantitative measurements. When it’s inappropriate to assume normality.
4
4 Learning Objective 1: Example: How to Get A Better Tan Experiment: A student wanted to compare ways of getting a tan without exposure to the sun. She decided to investigate which of two treatments would give a better tan: An “instant bronze sunless tanner” lotion A tanning studio
5
5 Subjects: Five female students participated in the experiment. Three of the students were randomly selected to use the tanning lotion. The other two students used the tanning studio. Learning Objective 1: Example: How to Get A Better Tan
6
6 Results: The girls’ tans were ranked from 1 to 5, with 1 representing the best tan. Possible Outcomes: Consider all possible rankings of the girls’ tans. A table of possibilities is displayed on the next page. Learning Objective 1: Example: How to Get A Better Tan
7
7
8
8 For each possible outcome, a mean rank is calculated for the ‘lotion’ group and for the ‘studio’ group. The difference in the mean ranks is then calculated for each outcome. Learning Objective 1: Example: How to Get A Better Tan
9
9 For this experiment, the samples were independent random samples – the responses for the girls using the tanning lotion were independent of the responses for the girls using the tanning studio. Learning Objective 1: Example: How to Get A Better Tan
10
10 Suppose that the two treatments have identical effects. A girl’s tan would be the same regardless of which treatment she uses. Then, each of the ten possible outcomes is equally likely. So, each outcome has probability of 1/10. Learning Objective 1: Example: How to Get A Better Tan
11
11 Using the ten possible outcomes, we can construct a sampling distribution for the difference between the sample mean ranks. The distribution is displayed on the next page. Learning Objective 1: Example: How to Get A Better Tan
12
12 Learning Objective 1: Example: How to Get A Better Tan
13
13 Graph of the Sampling Distribution: Learning Objective 1: Example: How to Get A Better Tan
14
14 The student who planned the experiment hypothesized that the tanning studio would give a better tan than the tanning lotion. Learning Objective 1: Example: How to Get A Better Tan
15
15 She wanted to test the null hypothesis: H 0 : The treatments are identical in tanning quality. Against H a : Better tanning quality results with the tanning studio. Learning Objective 1: Example: How to Get A Better Tan
16
16 This alternative hypothesis is one-sided. If H a were true, we would expect the ranks to be smaller (better) for the tanning studio. Thus, if H a were true, we would expect the differences between the sample mean rank for the tanning lotion and the sample mean rank for the tanning studio to be positive. Learning Objective 1: Example: How to Get A Better Tan
17
17 Learning Objective 2: Wilcoxon Test The test comparing two groups based on the sampling distribution of the difference between the sample mean ranks is called the Wilcoxon test.
18
18 Learning Objective 2: Wilcoxon Nonparametric Test for Comparing Two Groups 1. Assumptions: Independent random samples from two groups.
19
19 Learning Objective 2: Wilcoxon Nonparametric Test for Comparing Two Groups 2. Hypotheses: H 0 : Identical population distributions for the two groups (this implies equal expected values for the sample mean ranks). H a : Different expected values for the sample mean ranks (two-sided), or H a : Higher expected value for the sample mean rank for a specified group (one-sided).
20
20 Learning Objective 2: Wilcoxon Nonparametric Test for Comparing Two Groups 3. Test Statistic: Difference between sample mean ranks for the two groups (Equivalently, can use sum of ranks for one sample).
21
21 Learning Objective 2: Wilcoxon Nonparametric Test for Comparing Two Groups 4. P-value: One-tail or two-tail probability, depending on H a, that the difference between the sample mean ranks is as extreme or more extreme than observed. 5. Conclusion: Report the P-value and interpret it. If a decision is needed, reject H 0 if the P-value ≤ significance level such as 0.05.
22
22 Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion? For the actual experiment: the ranks were (2,4,5) for the girls using the tanning lotion the ranks were (1,3) for the girls using the tanning studio.
23
23 The mean rank for the tanning lotion is: (2+4+5)/3 = 3.7 The mean rank for the tanning studio is: (1+3)/2=2 Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
24
24 The test statistic is the difference between the sample mean ranks: 3.7 – 2 = 1.7 Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
25
25 The one-sided alternative hypothesis states that the tanning studio gives a better tan. This means that the expected mean rank would be larger for the tanning lotion than for the tanning studio, if H a is true. And, the difference between the mean ranks would be positive. Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
26
26 The test statistic we obtained from the data was: Difference between the sample mean ranks = 1.7. P-value = P(difference between sample mean ranks at least as large as 1.7) Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
27
27 The P-value can be obtained from the graph of the sampling distribution (as seen on a previous slide and displayed again here): Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
28
28 P-value = 0.20. This is not a very small P-value. The evidence does not strongly support the claim that the tanning studio gives a better tan. Learning Objective 2: Example: Does the UV Tanning Studio Give a Better Tan than the Tanning Lotion?
29
29 Learning Objective 3: The Wilcoxon Rank Sum The Wilcoxon test can, equivalently, use as the test statistic the sum of the ranks in just one of the samples. This statistic will have the same probabilities as the differences between the sample mean ranks. Some software reports the sum of ranks as the Wilcoxon rank sum statistic.
30
30 Learning Objective 3: Example: Is there a treatment difference between the UV Tanning Studio and the Tanning Lotion? Suppose the experiment was designed with a two-sided alternative hypothesis: H 0 : The treatments are identical in tanning quality. H a : The treatments are different in tanning quality.
31
31 Learning Objective 3: Example: Is there a treatment difference between the UV Tanning Studio and the Tanning Lotion?
32
32 Learning Objective 3: The Wilcoxon Rank Sum Often, ties occur when we rank the observations In this case, we average the ranks in assigning them to those subjects Example: suppose a girl using the tanning studio got the best tans, two girls using the tanning lotion got the two worst tans, but the other two girls had equally good tans Tanning studio ranks: 1, 2.5 Tanning lotion ranks: 2.5, 4, 5
33
33 Learning Objective 4: Using the Wilcoxon Test with a Quantitative Response When the response variable is quantitative, the Wilcoxon test is applied by converting the observations to ranks. For the combined sample, the observations are ordered from smallest to largest, the smallest observations gets rank 1, the second smallest gets rank 2, and so forth. The test compares the mean ranks for the two samples.
34
34 Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times? Experiment: A sample of 64 college students were randomly assigned to a cell phone group or a control group, 32 to each. On a machine that simulated driving situations, participants were instructed to press a “brake button” when they detected a red light.
35
35 Experiment: The control group listened to the radio while they performed the simulated driving. The cell phone group carried out a conversation on a cell phone. Each subject’s response time to the red lights is recorded and averaged over all of his/her trials. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
36
36 Boxplots of the data: Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
37
37 The box plots do not show any substantial skew, but there is an extreme outlier for the cell phone group. The t inferences that we have used previously assume normal population distributions. The Wilcoxon Test does not assume normality. This test can be used in place of the t test if the normality assumption is in question. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
38
38 To use the Wilcoxon test, we need to rank the data (response times) from 1 (smallest reaction time) to 64 (largest reaction time). The test statistic is then calculated from the ranks. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
39
39 The next page shows the output for the hypothesis test: H 0: The distribution of reaction times is identical for the two groups. H a: The distribution of reaction times differs for the two groups. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
40
40 Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
41
41 The small P-value (.019) shows strong evidence against the null hypothesis. The sample mean ranks suggest that reaction times tend to be slower for those using cell phones. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
42
42 Insight: The Wilcoxon test is not affected by outliers. No matter how far the largest observation falls from the next largest, it still gets the same rank. Learning Objective 4: Example: Do Drivers Using Cell Phones Have Slower Reaction Times?
43
43 Learning Objective 5: Nonparametric Estimation Comparing Groups When the response variable is quantitative, we can compare a measure of center for the two groups. One way to do this is by comparing means. This method requires the assumption of normal population distributions.
44
44 Learning Objective 5: Nonparametric Estimation Comparing Groups When the response distribution is highly skewed, nonparametric methods are preferred. For highly skewed distributions, a better measure of the center is the median. We can then estimate the difference between the population medians for the two groups.
45
45 Learning Objective 5: Nonparametric Estimation Comparing Groups Most software for the Wilcoxon test reports point and interval estimates comparing medians. Some software refers to the equivalent Mann- Whitney test.
46
46 Learning Objective 5: Nonparametric Estimation Comparing Groups The Wilcoxon test (and the Mann-Whitney test) does not require a normal population assumption. It does require an extra assumption: the population distributions for the two groups are symmetric and have the same shape.
47
47 Learning Objective 5: Example: Nonparametric Estimation Comparing Groups The point estimate for the difference in medians is given by 44.5 (note that this is not the same as the difference between the two sample medians) A 95.1% CI for the difference is (8.99, 79.01) Since 0 is not included in the interval, we conclude that the median reaction times are not the same for the cell phone and control groups
48
48 Chapter 15: Nonparametric Statistics Section 15.2 Nonparametric Methods for Several Groups and for Matched Pairs
49
49 Learning Objectives 1. Comparing Mean Ranks of Several Groups 2. ANOVA test vs. Kruskal-Wallis test 3. Summary: Kruskal-Wallis Test 4. Comparing Matched Pairs: The Sign Test 5. The Sign Test for Small Samples 6. The Wilcoxon Signed-Ranks Test
50
50 Learning Objective 1: Comparing Mean Ranks of Several Groups The Wilcoxon test for comparing mean ranks of two groups extends to a comparison of mean ranks for several groups. This test is called the Kruskal-Wallis test.
51
51 Learning Objective 2: ANOVA test vs. Kruskal-Wallis test Both tests are used to compare many groups. The ANOVA F test assumes normal population distributions. The Kruskal-Wallis test does not make this assumption. The Kruskal-Wallis test is a “safer” method to use with small samples when not much information is available about the shape of the distributions.
52
52 Learning Objective 2: ANOVA test vs. Kruskal-Wallis test The Kruskal-Wallis test is also useful when the data are merely ranks and we don’t have a quantitative measurement of the response variable.
53
53 Learning Objective 3: Summary: Kruskal-Wallis Test 1. Assumptions: Independent random samples from several (g) groups. 2. Hypotheses: H 0 : Identical population distributions for the g groups H a : Population distributions not all identical.
54
54 Learning Objective 3: Summary: Kruskal-Wallis Test 3. Test statistic: Uses between-groups variability of sample mean ranks. Software easily calculates this. 4. P-value: Right-tail probability above observed test statistic value from chi-squared distribution with df=g-1 5. Conclusion: Report the P-value and interpret in context.
55
55 Learning Objective 3: Example: Does Heavy Dating Affect College GPA? Experiment: A student in a statistics class (Tim) decided to study whether dating was associated with college GPA. He wondered whether students who data a lot tend to have poorer GPAs.
56
56 Experiment: He asked 17 students in the class to anonymously fill out a short questionnaire in which they were asked to give their college GPA and to indicate whether, during their college careers, they had dated regularly, occasionally, or rarely. Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
57
57 Dot plots of the GPA data for the 3 dating groups: Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
58
58 Since the dot plots showed evidence of severe skew to the left and since the sample size was small in each group, Tim felt safer analyzing the data with the Kruskal-Wallis test than with the ordinary ANOVA F test. Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
59
59 The hypotheses for the Kruskal-Wallis test: H 0 : Identical population distributions for the three dating groups H a : Population distributions for the three dating groups are not all identical. Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
60
60 This table shows the data with the GPA values ordered from smallest to largest for each dating group. Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
61
61 MINITAB output for the Kruskal-Wallis test: Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
62
62 The test statistic reported in the output is H = 0.72. The corresponding P-value reported in the output is 0.696. This large P-value does not give any evidence against H 0. It is plausible that GPA is independent of dating group. Learning Objective 3: Example: Does Heavy Dating Affect College GPA?
63
63 Learning Objective 4: Comparing Matched Pairs: The Sign Test When the samples are dependent, different methods must be used: Tanning example: suppose that a crossover design was used - the same subjects get a tan using one treatment and when it wears off, they get a tan using the other treatment. The order of using the two treatments is random. For each subject, we observe which treatment gives the better tan
64
64 Learning Objective 4: Comparing Matched Pairs: The Sign Test For such a matched pairs experiment, let p denote the population proportion of cases for which a particular treatment does better than the other treatment Under the null hypothesis of identical treatment effects, p=0.50, i.e., each treatment should have the better response outcome about half the time (we ignore cases in which each treatment gives the same response)
65
65 Learning Objective 4: Comparing Matched Pairs: The Sign Test The Sign Test for Matched Pairs Assumptions: random sample of matched pairs for which we can evaluate which observation in a pair has the better response Hypotheses: H 0 : Population proportion p=0.50 who make better response for a particular group H a : p≠0.5 (two-sided) or H a : p>0.5 or H a : p<0.5 (one-sided)
66
66 Learning Objective 4: Comparing Matched Pairs: The Sign Test Test Statistic: P-value: For large samples (n≥30), use tail probabilities from standard normal. For smaller n, use binomial distribution Conclusion: Report the P-value and interpret in context
67
67 Learning Objective 4: Example: Comparing Matched Pairs: The Sign Test Which do most students spend more time doing - browsing the Internet or watching TV? Survey results of first 3 students from University of GA StudentInternetTV 160120 220120 36090
68
68 Learning Objective 4: Example: Comparing Matched Pairs: The Sign Test Let p denote the population proportion who spent more time watching TV For the entire sample, 35 students spent more time watching TV and 19 students spent more time browsing the Internet. H 0 : p=0.5 H a : p≠0.5
69
69 Learning Objective 4: Example: Comparing Matched Pairs: The Sign Test Test statistic: n=35+19=54 z=(0.648-0.5)/0.068=2.18 From the normal table, the two-sided P-value is 0.03. This provides considerable evidence that most students spend more time watching TV than browsing the Internet
70
70 Learning Objective 4: Example: Comparing Matched Pairs: The Sign Test Note: the sign test uses merely the information about which response is higher and how many responses are higher, not the quantitative information about how much higher
71
71 Learning Objective 5: Example: The Sign Test for Small n For small n, we can conduct the sign test using the binomial distribution Example: Another tanning experiment was run in which the same 5 girls received each treatment (lotion and studio). The tanning studio gave a better tan than the lotion for four of the five girls
72
72 Learning Objective 5: Example: The Sign Test for Small n H 0 : p=0.5 H a : p>0.5 If p=0.5, the binomial probability that x=4 of the n=5 girls would get better tans with the tanning studio is The more extreme result that all five girls would get better tans with the tanning studio has probability P(5)=(0.5) 5 =0.031.
73
73 Learning Objective 5: Example: The Sign Test for Small n P-value =P(4)+P(5)=0.19 The evidence is not strong that more girls get a better tan from the tanning studio than the tanning lotion
74
74 Learning Objective 6: Ranking Matched Pairs: The Wilcoxon Signed- Ranks Test With matched pairs data, for each pair the sign test merely observes which treatment does better, but not how much better The Wilcoxon signed-ranks test is a nonparametric test designed for cases in which comparisons of the paired observations can themselves be ranked
75
75 Learning Objective 6: Ranking Matched Pairs: The Wilcoxon Signed- Ranks Test For each matched pair of responses, the Wilcoxon signed-ranks test measures the difference between the responses. It tests the hypothesis: H 0 : population median of difference scores is 0 The test statistic is the sum of the ranks for the positive differences
76
76 Learning Objective 6: Example: The Wilcoxon Signed-Ranks Test A diet for which a person is not allowed to drink soft drinks and other similar drinks claims to promote weight loss. SubjectWeight before Weight after DifferenceAbsolute value Rank 117216012 2 221019515 3 3168170-221
77
77 Learning Objective 6: Example: The Wilcoxon Signed-Ranks Test We first calculate the differences weight before - weight after. The absolute value of the differences are then ranked from smallest to largest We sum the ranks for the differences that are positive (namely 12 and 15): 2+3=5
78
78 Learning Objective 6: Example: The Wilcoxon Signed-Ranks Test The table gives all possible samples with absolute difference values of 12, 15 and 2 Our sample is sample 2
79
79 Learning Objective 6: Example: The Wilcoxon Signed-Ranks Test If the diet had no effect, the eight possible samples in the table are equally likely, each with probability 1/8 The P-value is the probability that the sum of ranks is at least as large as observed. This occurs for two of the eight samples so the P- value is 0.25
80
80 Learning Objective 6: The Wilcoxon Signed-Ranks Test Wilcoxon Signed-Ranks test Advantage is that it can take into account the sizes of the differences and not merely their sign Disadvantage is that it requires an additional assumption: the population distribution of the difference scores must be symmetric
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.