1 chapter 15: nonparametric statistics section 15.1 how can we compare two groups by ranking?

80
1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

Upload: kelly-booker

Post on 26-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

1

Chapter 15: Nonparametric Statistics

Section 15.1How Can We Compare Two Groups by

Ranking?

Page 2: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 3: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 4: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 5: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 6: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 7: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

7

Learning Objective 1:Example: How to Get A Better Tan

Page 8: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 9: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 10: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 11: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 12: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

12

Learning Objective 1:Example: How to Get A Better Tan

Page 13: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

13

Graph of the Sampling Distribution:

Learning Objective 1:Example: How to Get A Better Tan

Page 14: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 15: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

15

She wanted to test the null hypothesis: H0: The treatments are identical in tanning

quality.

Against Ha: Better tanning quality results with the

tanning studio.

Learning Objective 1:Example: How to Get A Better Tan

Page 16: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

16

This alternative hypothesis is one-sided.

If Ha were true, we would expect the ranks to be smaller (better) for the tanning studio.

Thus, if Ha 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

Page 17: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 18: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

18

Learning Objective 2:Wilcoxon Nonparametric Test for Comparing Two Groups

1. Assumptions: Independent random samples from two groups.

Page 19: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

19

Learning Objective 2:Wilcoxon Nonparametric Test for Comparing Two Groups

2. Hypotheses: H0: Identical population distributions for the

two groups (this implies equal expected values for the sample mean ranks).

Ha: Different expected values for the sample mean ranks (two-sided), or

Ha: Higher expected value for the sample mean rank for a specified group (one-sided).

Page 20: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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).

Page 21: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

21

Learning Objective 2:Wilcoxon Nonparametric Test for Comparing Two Groups4. P-value: One-tail or two-tail probability,

depending on Ha, 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 H0 if the P-value ≤ significance level such as 0.05.

Page 22: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 23: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 24: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 25: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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 Ha 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?

Page 26: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 27: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 28: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 29: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 30: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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: H0: The treatments are identical in tanning

quality. Ha: The treatments are different in tanning

quality.

Page 31: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

31

Learning Objective 3:Example: Is there a treatment difference between the UV Tanning Studio and the Tanning Lotion?

Page 32: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 33: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 34: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 35: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 36: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

36

Boxplots of the data:

Learning Objective 4:Example: Do Drivers Using Cell Phones Have Slower Reaction Times?

Page 37: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 38: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 39: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

39

The next page shows the output for the hypothesis test:

H0: The distribution of reaction times is identical for the two groups.

Ha: The distribution of reaction times differs for the two groups.

Learning Objective 4:Example: Do Drivers Using Cell Phones Have Slower Reaction Times?

Page 40: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

40

Learning Objective 4:Example: Do Drivers Using Cell Phones Have Slower Reaction Times?

Page 41: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 42: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 43: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 44: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 45: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 46: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 47: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 48: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

48

Chapter 15: Nonparametric Statistics

Section 15.2Nonparametric Methods for Several Groups

and for Matched Pairs

Page 49: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 50: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 51: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 52: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 53: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

53

Learning Objective 3:Summary: Kruskal-Wallis Test

1. Assumptions: Independent random samples from several (g) groups.

2. Hypotheses: H0: Identical population distributions for the g

groups

Ha: Population distributions not all identical.

Page 54: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 55: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Page 56: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 57: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

57

Dot plots of the GPA data for the 3 dating groups:

Learning Objective 3:Example: Does Heavy Dating Affect College GPA?

Page 58: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 59: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

59

The hypotheses for the Kruskal-Wallis test:H0: Identical population distributions for the three

dating groups

Ha: Population distributions for the three dating groups are not all identical.

Learning Objective 3:Example: Does Heavy Dating Affect College GPA?

Page 60: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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?

Page 61: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

61

MINITAB output for the Kruskal-Wallis test:

Learning Objective 3:Example: Does Heavy Dating Affect College GPA?

Page 62: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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 H0.

It is plausible that GPA is independent of dating group.

Learning Objective 3:Example: Does Heavy Dating Affect College GPA?

Page 63: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 64: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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)

Page 65: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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: H0: Population proportion p=0.50 who make

better response for a particular group

Ha: p≠0.5 (two-sided) or

Ha: p>0.5 or Ha: p<0.5 (one-sided)

Page 66: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

z ˆ p 0.5 se

with se (0.5)(0.5) n

Page 67: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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 GAStudent Internet TV

1 60 120

2 20 120

3 60 90

Page 68: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

H0: p=0.5

Ha: p≠0.5

Page 69: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

se (0.5)(0.5) 54 0.068

ˆ p 35 54 0.648

Page 70: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 71: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 72: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

72

Learning Objective 5:Example: The Sign Test for Small n

H0: p=0.5

Ha: 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.

P(4) 5!

4!(5 4)!(0.5)4 (0.5)1 0.156

Page 73: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 74: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 75: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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:H0: population median of difference scores is 0

The test statistic is the sum of the ranks for the positive differences

Page 76: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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.

Subject Weight before

Weight after

Difference Absolute value

Rank

1 172 160 12 12 2

2 210 195 15 15 3

3 168 170 -2 2 1

Page 77: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 78: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 79: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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

Page 80: 1 Chapter 15: Nonparametric Statistics Section 15.1 How Can We Compare Two Groups by Ranking?

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