© 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha:...

17
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS St. Edward’s University 2 Slide © 2005 Thomson/South-Western Chapter 19 Nonparametric Methods Sign Test Wilcoxon Signed-Rank Test Mann-Whitney-Wilcoxon Test Kruskal-Wallis Test Rank Correlation 3 Slide © 2005 Thomson/South-Western Nonparametric Methods Most of the statistical methods referred to as parametric require the use of interval - or ratio-scaled data . Nonparametric methods are often the only way to analyze nominal or ordinal data and draw statistical conclusions. Nonparametric methods require no assumptions about the population probability distributions. Nonparametric methods are often called distribution- free methods .

Transcript of © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha:...

Page 1: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

1

1Slide© 2005 Thomson/South-Western

Slides Prepared byJOHN S. LOUCKS

St. Edward’s University

2Slide© 2005 Thomson/South-Western

Chapter 19Nonparametric Methods

Sign TestWilcoxon Signed-Rank TestMann-Whitney-Wilcoxon TestKruskal-Wallis TestRank Correlation

3Slide© 2005 Thomson/South-Western

Nonparametric Methods

Most of the statistical methods referred to as parametric require the use of interval- or ratio-scaled data.Nonparametric methods are often the only way to analyze nominal or ordinal data and draw statistical conclusions.Nonparametric methods require no assumptions about the population probability distributions.Nonparametric methods are often called distribution-free methods.

Page 2: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

2

4Slide© 2005 Thomson/South-Western

Nonparametric Methods

In general, for a statistical method to be classified as nonparametric, it must satisfy at least one of the following conditions.• The method can be used with nominal data.• The method can be used with ordinal data.• The method can be used with interval or ratio data

when no assumption can be made about the population probability distribution.

5Slide© 2005 Thomson/South-Western

Sign Test

A common application of the sign test involves using a sample of n potential customers to identify a preference for one of two brands of a product.The objective is to determine whether there is a difference in preference between the two items being compared.To record the preference data, we use a plus sign if the individual prefers one brand and a minus sign if the individual prefers the other brand.Because the data are recorded as plus and minus signs, this test is called the sign test.

6Slide© 2005 Thomson/South-Western

Sign Test: Small-Sample Case

The small-sample case for the sign test should be used whenever n < 20.The hypotheses are

a : .50H p ≠a : .50H p ≠

0 : .50H p =0 : .50H p =

A preference for one brandover the other exists.

No preference for one brandover the other exists.

The number of plus signs is our test statistic.Assuming H0 is true, the sampling distribution for the test statistic is a binomial distribution with p = .5.H0 is rejected if the p-value < level of significance, α.

Page 3: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

3

7Slide© 2005 Thomson/South-Western

Sign Test: Large-Sample Case

Using H0: p = .5 and n > 20, the sampling distribution for the number of plus signs can be approximated by a normal distribution.When no preference is stated (H0: p = .5), the sampling distribution will have:

The test statistic is:

H0 is rejected if the p-value < level of significance, α.

Mean: µ = .50nStandard Deviation: .25nσ = .25nσ =

xz µσ−

=xz µσ−

= (x is the numberof plus signs)

8Slide© 2005 Thomson/South-Western

Example: Ketchup Taste Test

Sign Test: Large-Sample Case

A B

As part of a market research study, asample of 36 consumers were asked to tastetwo brands of ketchup and indicate a preference. Do the data shown on the nextslide indicate a significant difference in theconsumer preferences for the two brands?

9Slide© 2005 Thomson/South-Western

18 preferred Brand A Ketchup(+ sign recorded)

12 preferred Brand B Ketchup(_ sign recorded)

6 had no preference

Sign Test: Large-Sample Case

Example: Ketchup Taste Test

A BThe analysis will be based ona sample size of 18 + 12 = 30.

Page 4: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

4

10Slide© 2005 Thomson/South-Western

Hypotheses

a : .50H p ≠a : .50H p ≠

A B

Sign Test: Large-Sample Case

0 : .50H p =0 : .50H p =

A preference for one brand over the other exists

No preference for one brand over the other exists

11Slide© 2005 Thomson/South-Western

Sampling Distribution for Number of Plus Signs

µ = .5(30) = 15

A B

Sign Test: Large-Sample Case

.25 .25(30) 2.74nσ = = =.25 .25(30) 2.74nσ = = =

12Slide© 2005 Thomson/South-Western

Rejection Rule A B

Sign Test: Large-Sample Case

p-Value = 2(.5000 - .3643) = .2714p-Value

z = (x – µ)/σ = (18 - 15)/2.74 = 3/2.74 = 1.10Test Statistic

Using .05 level of significance:Reject H0 if p-value < .05

Page 5: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

5

13Slide© 2005 Thomson/South-Western

A B

Sign Test: Large-Sample Case

ConclusionBecause the p-value > α, we cannot reject H0.

There is insufficient evidence in the sample to conclude that a difference in preference exists for the two brands of ketchup.

14Slide© 2005 Thomson/South-Western

Hypothesis Test About a Median

We can apply the sign test by:• Using a plus sign whenever the data in the sample

are above the hypothesized value of the median• Using a minus sign whenever the data in the

sample are below the hypothesized value of the median

• Discarding any data exactly equal to the hypothesized median

15Slide© 2005 Thomson/South-Western

Hypothesis Test About a Median

34 years= 34 years=H0: Median Age34 years≠ 34 years≠Ha: Median Age

Example: Trim Fitness CenterA hypothesis test is being conducted

about the median age of female membersof the Trim Fitness Center.

In a sample of 40 female members, 25 are olderthan 34, 14 are younger than 34, and 1 is 34. Is theresufficient evidence to reject H0? Assume α = .05.

Page 6: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

6

16Slide© 2005 Thomson/South-Western

p-Value = 2(.5000 − .4608) = .0784

µ = .5(39) = 19.5

.25 .25(39) 3.12nσ = = =.25 .25(39) 3.12nσ = = =

Hypothesis Test About a Median

p-Value

z = (x – µ)/σ = (25 – 19.5)/3.12 = 1.76Test Statistic

Mean and Standard Deviation

17Slide© 2005 Thomson/South-Western

Hypothesis Test About a Median

Rejection Rule

ConclusionDo not reject H0. The p-value for this two-tail

test is .0784. There is insufficient evidence in the sample to conclude that the median age is not 34 for female members of Trim Fitness Center.

Using .05 level of significance:Reject H0 if p-value < .05

18Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

This test is the nonparametric alternative to the parametric matched-sample test presented in Chapter 10.The methodology of the parametric matched-sample analysis requires:• interval data, and• the assumption that the population of differences

between the pairs of observations is normally distributed.

If the assumption of normally distributed differences is not appropriate, the Wilcoxon signed-rank test can be used.

Page 7: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

7

19Slide© 2005 Thomson/South-Western

Example: Express Deliveries

Wilcoxon Signed-Rank Test

A firm has decided to select oneof two express delivery services toprovide next-day deliveries to itsdistrict offices.

To test the delivery times of the two services, thefirm sends two reports to a sample of 10 district offices, with one report carried by one service and theother report carried by the second service. Do the dataon the next slide indicate a difference in the twoservices?

20Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

SeattleLos AngelesBostonClevelandNew YorkHoustonAtlantaSt. LouisMilwaukeeDenver

32 hrs.301916151814107

16

25 hrs.24151513151589

11

District Office OverNight NiteFlite

21Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

Preliminary Steps of the Test• Compute the differences between the paired

observations.• Discard any differences of zero.• Rank the absolute value of the differences from

lowest to highest. Tied differences are assigned the average ranking of their positions.

• Give the ranks the sign of the original difference in the data.

• Sum the signed ranks.. . . next we will determine whether the

sum is significantly different from zero.

Page 8: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

8

22Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

SeattleLos AngelesBostonClevelandNew YorkHoustonAtlantaSt. LouisMilwaukeeDenver

764123−1

2−2

5

District Office Differ. |Diff.| Rank Sign. Rank1097

1.546

1.5448

+10+9+7

+1.5+4+6−1.5+4−4+8

+44

23Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

HypothesesH0: The delivery times of the two services are the

same; neither offers faster service than the other.Ha: Delivery times differ between the two services;

recommend the one with the smaller times.

24Slide© 2005 Thomson/South-Western

Sampling Distribution of T for Identical Populations

µT = 0

( 1)(2 1) 10(11)(21) 19.626 6T

n n nσ + += = =

( 1)(2 1) 10(11)(21) 19.626 6T

n n nσ + += = =

Wilcoxon Signed-Rank Test

T

Page 9: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

9

25Slide© 2005 Thomson/South-Western

Wilcoxon Signed-Rank Test

Rejection RuleUsing .05 level of significance,

Reject H0 if p-value < .05Test Statistic

p-Valuez = (T - µT )/σT = (44 - 0)/19.62 = 2.24

p-Value = 2(.5000 - .4875) = .025

26Slide© 2005 Thomson/South-Western

ConclusionReject H0. The p-value for this two-tail test is

.025. There is sufficient evidence in the sample to conclude that a difference exists in the delivery times provided by the two services.

Wilcoxon Signed-Rank Test

27Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

This test is another nonparametric method for determining whether there is a difference between two populations.This test, unlike the Wilcoxon signed-rank test, is notbased on a matched sample.This test does not require interval data or the assumption that both populations are normally distributed.The only requirement is that the measurement scale for the data is at least ordinal.

Page 10: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

10

28Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

Ha: The two populations are not identicalH0: The two populations are identical

Instead of testing for the difference between the means of two populations, this method tests to determine whether the two populations are identical.

The hypotheses are:

29Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

Example: Westin FreezersManufacturer labels indicate the

annual energy cost associated withoperating home appliances such asfreezers.

The energy costs for a sample of10 Westin freezers and a sample of 10Easton Freezers are shown on the next slide. Do thedata indicate, using α = .05, that a difference exists inthe annual energy costs for the two brands of freezers?

30Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

$55.10 54.5053.2053.0055.5054.9055.8054.0054.2055.20

$56.10 54.7054.4055.4054.1056.0055.5055.0054.3057.00

Westin Freezers Easton Freezers

Page 11: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

11

31Slide© 2005 Thomson/South-Western

Hypotheses

Mann-Whitney-Wilcoxon Test

Ha: Annual energy costs differ for the twobrands of freezers.

H0: Annual energy costs for Westin freezersand Easton freezers are the same.

32Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test:Large-Sample Case

First, rank the combined data from the lowest to the highest values, with tied values being assigned the average of the tied rankings.Then, compute T, the sum of the ranks for the first sample.Then, compare the observed value of T to the sampling distribution of T for identical populations. The value of the standardized test statistic z will provide the basis for deciding whether to reject H0.

33Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test:Large-Sample Case

1 2 1 21 ( 1)12T n n n nσ = + +1 2 1 21 ( 1)12T n n n nσ = + +

Approximately normal, providedn1 > 10 and n2 > 10

µT = n1(n1 + n2 + 1)

Sampling Distribution of T for Identical Populations• Mean

• Standard Deviation

• Distribution Form

Page 12: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

12

34Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

$55.10 54.5053.2053.0055.5054.9055.8054.0054.2055.20

$56.10 54.7054.4055.4054.1056.0055.5055.0054.3057.00

Westin Freezers Easton Freezers

Sum of Ranks Sum of Ranks

Rank Rank

86.5 123.5

12

128

15.5101735

13

1997

144

1815.5116

20

35Slide© 2005 Thomson/South-Western

Sampling Distribution of T for Identical Populations

µT = ½(10)(21) = 105

Mann-Whitney-Wilcoxon Test

1 2 1 21 ( 1)121 (10)(10)(21)12

13.23

T n n n nσ = + +

=

=

1 2 1 21 ( 1)121 (10)(10)(21)12

13.23

T n n n nσ = + +

=

=

T

36Slide© 2005 Thomson/South-Western

Rejection RuleUsing .05 level of significance,

Reject H0 if p-value < .05Test Statistic

p-Valuez = (T - µT )/σT = (86.5 − 105)/13.23 = -1.40

p-Value = 2(.5000 - .4192) = .1616

Mann-Whitney-Wilcoxon Test

Page 13: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

13

37Slide© 2005 Thomson/South-Western

Mann-Whitney-Wilcoxon Test

ConclusionDo not reject H0. The p-value > α. There is

insufficient evidence in the sample data to conclude that there is a difference in the annual energy cost associated with the two brands of freezers.

38Slide© 2005 Thomson/South-Western

Kruskal-Wallis Test

The Mann-Whitney-Wilcoxon test has been extended by Kruskal and Wallis for cases of three or more populations.

The Kruskal-Wallis test can be used with ordinal data as well as with interval or ratio data.

Also, the Kruskal-Wallis test does not require the assumption of normally distributed populations.

Ha: Not all populations are identicalH0: All populations are identical

39Slide© 2005 Thomson/South-Western

Test Statistic

Kruskal-Wallis Test

=

⎡ ⎤= − +⎢ ⎥+⎣ ⎦

∑2

1

12 3( 1)( 1)

ki

TiT T i

RW nn n n=

⎡ ⎤= − +⎢ ⎥+⎣ ⎦

∑2

1

12 3( 1)( 1)

ki

TiT T i

RW nn n n

where: k = number of populationsni = number of items in sample i

nT = Σni = total number of items in all samplesRi = sum of the ranks for sample i

Page 14: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

14

40Slide© 2005 Thomson/South-Western

Kruskal-Wallis Test

When the populations are identical, the sampling distribution of the test statistic W can be approximated by a chi-square distribution with k – 1 degrees of freedom.This approximation is acceptable if each of the sample sizes ni is > 5.

The rejection rule is: Reject H0 if p-value < α

41Slide© 2005 Thomson/South-Western

Rank Correlation

The Pearson correlation coefficient, r, is a measure of the linear association between two variables for which interval or ratio data are available.The Spearman rank-correlation coefficient, rs , is a measure of association between two variables when only ordinal data are available.Values of rs can range from –1.0 to +1.0, where• values near 1.0 indicate a strong positive

association between the rankings, and• values near -1.0 indicate a strong negative

association between the rankings.

42Slide© 2005 Thomson/South-Western

Rank Correlation

Spearman Rank-Correlation Coefficient, rs

2

2

61

( 1)i

s

dr

n n= −

−∑ 2

2

61

( 1)i

s

dr

n n= −

−∑

where: n = number of items being rankedxi = rank of item i with respect to one variableyi = rank of item i with respect to a second variabledi = xi - yi

Page 15: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

15

43Slide© 2005 Thomson/South-Western

Test for Significant Rank Correlation

0 : 0sH p =0 : 0sH p =

a : 0sH p ≠a : 0sH p ≠

We may want to use sample results to make an inference about the population rank correlation ps.

To do so, we must test the hypotheses:

(No rank correlation exists)(Rank correlation exists)

44Slide© 2005 Thomson/South-Western

Rank Correlation

0sr

µ = 0sr

µ =

11sr n

σ =−1

1sr nσ =

Approximately normal, provided n > 10

Sampling Distribution of rs when ps = 0• Mean

• Standard Deviation

• Distribution Form

45Slide© 2005 Thomson/South-Western

Rank Correlation

Example: Crennor InvestorsCrennor Investors provides

a portfolio management servicefor its clients. Two of Crennor’sanalysts ranked ten investmentsas shown on the next slide. Userank correlation, with α = .10, tocomment on the agreement of the two analysts’rankings.

Page 16: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

16

46Slide© 2005 Thomson/South-Western

Rank Correlation

Analyst #2 1 5 6 2 9 7 3 10 4 8Analyst #1 1 4 9 8 6 3 5 7 2 10

Investment A B C D E F G H I J

Example: Crennor Investors

0 : 0sH p =0 : 0sH p =

a : 0sH p ≠a : 0sH p ≠(No rank correlation exists)(Rank correlation exists)

• Analysts’ Rankings

• Hypotheses

47Slide© 2005 Thomson/South-Western

Rank Correlation

ABCDEFGHIJ

149863572

10

15629731048

0-136-3-42-3-22

019

369

164944

Sum = 92

InvestmentAnalyst #1Ranking

Analyst #2Ranking Differ. (Differ.)2

48Slide© 2005 Thomson/South-Western

Sampling Distribution of rsAssuming No Rank Correlation

Rank Correlation

1 .33310 1sr

σ = =−

1 .33310 1sr

σ = =−

µr = 0rs

Page 17: © 2005 Thomson/South-Western Slide 1 · 4 © 2005 Thomson/South-Western Slide 10 Hypotheses Ha: .50p ≠ A B Sign Test: Large-Sample Case H0: .50p = A preference for one brand over

17

49Slide© 2005 Thomson/South-Western

Test Statistic2

2

6 6(92)1 1 0.4424( 1) 10(100 1)

is

dr

n n= − = − =

− −∑ 2

2

6 6(92)1 1 0.4424( 1) 10(100 1)

is

dr

n n= − = − =

− −∑

Rank Correlation

z = (rs - µr )/σr = (.4424 - 0)/.3333 = 1.33

Rejection RuleWith .10 level of significance:

Reject H0 if p-value < .10

p-Valuep-Value = 2(.5000 - .4082) = .1836

50Slide© 2005 Thomson/South-Western

Do no reject H0. The p-value > α. There is not a significant rank correlation. The two analysts are not showing agreement in their ranking of the risk associated with the different investments.

Rank Correlation

Conclusion

51Slide© 2005 Thomson/South-Western

End of Chapter 19