Unformatted text preview: BASIC BUSINESS STATISTICS BASIC BUSINESS STATISTICS Eleventh Edition Berenson Levine Krehbiel Slides Modified by Eugene Li Topic 3 Topic 3 Nonparametric Tests
s s s Wilcoxon Rank Sum Test (12.6) Wilcoxon Signed Ranks Test (12.7) (Sign Test) Slide2 Nonparametric Tests
s s s s s Most of the statistical tests discussed do far referred to as parametric tests, which require the use of interval/ratio scaled data and the requirement of normality. Nonparametric tests are often the only way to analyze nominal or ordinal data and draw statistical conclusions, or interval/ratio data depart from normality. Nonparametric tests are not only for comparing two populations, as indicated in the textbook. Nonparametric tests require no requirement about the population probability distributions. Nonparametric tests are often called distributionfree tests. Slide3 Nonparametric Tests Nonparametric Tests
s In general, for a statistical test to be classified as nonparametric, it must satisfy at least one of the following conditions. • The method can be used with nominal data (this isn’t mentioned in textbook!). • The method can be used with ordinal data. • The method can be used with interval/ratio data when no assumption can be made about the population probability distribution, or after checking, it departs from normality. Slide4 Wilcoxon Rank Sum Test Wilcoxon Rank Sum Test
s s s s In general, we test the difference between two distributions of two populations. If we check the distributions of two samples are roughly the same in shape, then we can perform the test on the equality of two population medians. However, especially when we have a very small sample size, e.g. less than 15, even though we check using boxplot/histogram, it is tough for us to make a conclusion of yes or no. Hence we can only “assume” they are roughly the same and proceed the test. Data can be ordinal, interval, or ratio scale. Slide5 Wilcoxon Rank Sum Test Wilcoxon Rank Sum Test
s Steps of the Test • Rank each data value. Average the ranks of the tied observations. (T1 ,T 2) • Sum the ranks of each sample. • Use T1 rank sum as test statistic (Note: Actually you can use either one, but for simplicity, just use T1)
• Use the decision point table to make the decision. Slide6 Wilcoxon Rank Sum Test Wilcoxon Rank Sum Test Example: Western meets Eastern (Small Sample)
Manufacturer labels indicate the annual energy cost associated with operating home appliances such as freezers. The energy costs for a sample of 10 Western freezers and a sample of 10 Eastern Freezers are shown on the next slide. Do the data indicate that a difference exists in the annual energy costs associated with the two brands of freezers? Slide7 Example: Western meets Eastern Example: Western meets Eastern Western Freezers Eastern Freezers $55.10 $56.10 54.50 54.70 53.20 54.40 53.00 55.40 55.50 53.40 54.90 56.00 55.80 55.50 54.00 55.00 54.20 54.30 55.20 56.70
Slide8 Example: Western meets Eastern Example: Western meets Eastern
BoxandWhisker Plot Western Eastern 53 54 55 56 57 Energy Cost ($)
Slide9 Western Freezers Rank Eastern Freezers Rank $55.10 12 $56.10 19 54.50 8 54.70 9 53.20 2 54.40 7 53.00 1 55.40 14 55.50 15.5 53.40 3 54.90 10 56.00 18 55.80 17 55.50 Example: Western meets Eastern Example: Western meets Eastern Slide10 Example: Western meets Eastern Example: Western meets Eastern
s Hypotheses H0: Annual energy costs for Western freezers and Eastern freezers are the same. Ha: Annual energy costs differ for the two brands of freezers. As from the previous boxplots, they are similar, hence we can transform the hypotheses into: H0: The median of energy costs for Western freezers and that of Eastern freezers are the same. (M1 = M2) Ha: The medians of energy costs differ for the two brands of freezers. (M1 ≠ M2)
Slide11 Example: Western meets Eastern Example: Western meets Eastern
s s As both sample sizes are 10, therefore treat it as small sample case. Rejection Rule Using .05 level of significance, from Table E.8 in p.931, Reject H0 if T ≤ 78 or T ≥ 132 Slide12 Example: Western Freezers Example: Western Freezers
s Test Statistic T1 = 87.5 is in between 78 & 132 Conclusion Fail to reject H0, we don’t have enough evidence to conclude that there is a difference of the medians in the annual energy cost associated with the two brands of freezers. s Slide13 Wilcoxon Rank Sum Test Wilcoxon Rank Sum Test Another Example: Western meets Eastern (Large Sample)
Manufacturer labels indicate the annual energy cost associated with operating home appliances such as freezers. The energy costs for a sample of 11 Western freezers and a sample of 12 Eastern Freezers are shown on the next slide. Do the data indicate that a difference exists in the annual energy costs associated with the two brands of freezers? (Note: The data aren’t the same as previous!) Slide14 Another Example: Western meets Eastern Another Example: Western meets Eastern Western Freezers Eastern Freezers $55.10 $56.10 54.50 54.70 53.20 54.40 53.00 55.40 55.50 54.10 54.90 56.00 55.80 55.50 54.00 55.00 54.20 54.30 55.20 57.00 60.00 58.00 58.50
Slide15 Another Example: Western meets Eastern Another Example: Western meets Eastern BoxandWhisker Plot Western Eastern 53 55 57 59 61 Energy Cost ($)
Slide16 Another Example: Western meets Eastern Another Example: Western meets Eastern Western Freezers Rank Eastern Freezers Rank $55.10 12 $56.10 19 9 7 14 4 18 15.5 54.50 53.20 53.00 55.50 54.90 55.80 54.00 8 2 1 15.5 10 17 3 54.70 54.40 55.40 54.10 56.00 55.50 55.00Slide17 Another Example: Western meets Eastern Another Example: Western meets Eastern
s Sampling Distribution σ T1 = Sampling distribution of T1 if populations n1n2 (n + 1) are identical 12 µ T1 = n1 (n + 1) 2 T
(11)(12)(23 + 1) = 16.2481 12 µ T1 = 11(23 + 1) = 132 2 σ T1 = Slide18 Another Example: Western meets Eastern Another Example: Western meets Eastern
s Hypotheses H0: Annual energy costs for Western freezers and Eastern freezers are the same. (This means their locations are the same) Ha: Annual energy costs differ for the two brands of freezers. (This means their locations are different) As from boxplots, we shouldn’t transform into test on equality of medians. Slide19 Another Example: Western meets Eastern Another Example: Western meets Eastern
s Rejection Rule Using .05 level of significance, Reject H0 if z < 1.96 or z > 1.96 Test Statistic z = (T1 µ T1 )/σ T1 = (109.5 132)/16.2481 = 1.3848 Conclusion Fail to reject H0, we don’t have evidence to conclude that there is a difference in the annual energy cost associated with the two brands of freezers. s s Slide20 Wilcoxon Signed Ranks Test
s s We can say this test is the nonparametric version of the match samples test. This test is used when • the problem objective is to compare two related populations, • the data are ordinal, interval/ratio but not normal, the observations are matched pairs. • the differences are approximately symmetrical (Note: Symmetrical isn’t equivalent to normal!) • We test on the median on the differences Slide21 Wilcoxon Signed Ranks Test Wilcoxon Signed Ranks Test
s The test statistic and sampling distribution • W is based on rank sum of the absolute values of positive differences (actually can be the negative differences too, but for simplicity, just focus on the positive) • When n’ <=20, reject H0 if W ≥ Upper critical value or W ≤ Lower critical value (These two critical values can be found in Table E.9, and relate to n). • When n’ > 20, W is approximately normally distributed with mean = and std dev = n' (n'+1)(2n'+1) hence do a Ztest. 24 • Why n’, not just n? Because we discard all the zero differences.
Slide22 n' (n'+1) 4 Wilcoxon Signed Ranks Test Wilcoxon Signed Ranks Test
s 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, with the lowest gets 1. Tied differences are assigned the average ranking of their positions. • Give the ranks the sign of the original difference in the data. • Compute the test statistic W as the sum of the positive ranks. Slide23 Example: Express Deliveries Example: Express Deliveries
sWilcoxon Signed Ranks Test A firm has decided to select one of two express delivery services to provide nextday deliveries to the district offices. To test the delivery times of the two services, the firm sends two very similar reports to a sample of 10 district offices, with one report carried by one service and the other report carried by the second service. Do the data (delivery times in hours) on the next slide indicate a difference of the median delivery time between the two services? Use α = 0.05.
Slide24 Example: Express Deliveries Example: Express Deliveries District Office UPX INTEX St. Johns 9 hrs. 20 hrs. Halifax 11 9 Montreal 18 18 Kingston 29 10 Winnipeg 22 17 Ottawa 12 15 Regina 26 17 Calgary 10 18 Prince George 10 13 Toronto 14 14
Slide25 Example: Express Deliveries Example: Express Deliveries
District Office Differ. Diff. Rank Signed Rank St. Johns 11 7 7 Halifax 2 1 +1 Montreal 0 Kingston 19 8 +8 Winnipeg 5 4 +4 Ottawa 3 2.5 2.5 Regina 9 5 +5 Calgary 8 6 6 Total = 18 = W Total =18 Prince George 3 2.5 2.5 Slide26 Example: Express Deliveries Example: Express Deliveries
BoxandWhisker Plot 11 6 1 4 9 14 19 Difference Normal Probability Plot
99.9 99 95 80 50 20 5 1 0.1 11 6 1 4 9 14 19 percentage Difference Slide27 Example: Express Deliveries
s Hypotheses H0: The medians delivery times of the two services are the same; neither offers faster service than the other. (MD=0) Ha: The medians delivery times differ between the two services (MD≠0) Rejection Rule Using .05 level of significance, and n’ = # of nonzero difference = 8 (in this example) Reject H0 if W ≤ 3 or W ≥ 33 (from Table E.9 in p.932) Slide28 Example: Express Deliveries
s Test Statistic 3 < W = 18 < 33 s Conclusion Fail to reject H0. We don’t have sufficient evidence to conclude that a difference exists in the delivery times provided by the two services. Slide29 s “Perfomance” Example (P. 546, #12.76) Wilcoxon Signed Ranks Test Another Example: Performance • Is there enough evidence that there is a difference in the median performance ratings of workers? • A random sample of 35 workers was selected, and recorded their annual performance ratings along with the ratings attained prior to attending the workshops. • We want to test: •The median performance ratings of before and of after workshops are the same •The median performance ratings of before and of after are different •(Which is Ho and which is Ha?)
Slide30 Wilcoxon Signed Ranks Test “Performance” Example
s Concrete Example – Cont’d • Then the hypotheses are • H0: The median performance ratings of before and of after workshops are the same (MD = 0) • Ha: The median performance ratings of before and of after are different (MD ≠ 0) • What is the test statistic? You must know….a hint….. The rejection region: z > zα/2
Slide31 s s “Perfomance” Example (P. 546, #12.76) Note: This is how the question asked in the textbook, which is about a difference. However, if without the question part, when you read the given information, it is about effectiveness of the workshops, so it should be a onetailed test instead of twotailed! Wilcoxon Signed Ranks Test Another Example: Performance Slide32 Wilcoxon Signed Ranks Test “Performance” Example Wilcoxon Signed Ranks Test “Performance” Example
Worker Before After Difference ABS(Diff.) Ranks 59 72 13 26 1 13 72 74 2 4.5 2 2 89 62 27 34 3 27 67 74 7 17 4 7 81 78 3 7.5 5 3 88 86 2 4.5 6 2 71 81 10 22.5 7 10 67 72 5 12.5 8 5 78 77 1 1.5 9 1 64 85 21 32 10 21 72 80 8 18 11 8 89 80 9 19.5 12 9 87 76 11 25 13 11 69 86 17 28.5 14 17 61 84 23 33 15 23 82 80 2 4.5 16 2 82 87 5 12.5 17 5 65 82 17 28.5 18 17 80 76 4 9.5 19 4 70 80 10 22.5 20 10 There is no zero difference. Hence the n’=35. Ties were broken by assigning the average rank to the tied observationsand Data values the rankings are in Performance.xls Slide33 Wilcoxon Signed Ranks Test Wilcoxon Signed Ranks Test “Performance” Example µ W = n’(n’+1)/4 = 35(36)/4 = 315 σ W = [n’(n’+1)(2n’+1)/24].5 = 61.0533 W is the rank sum of the positive ranks, which is = 156 The test statistic is:
W − µ W 156 − 315 z= = = − 2.6043 σW 61.0533 Slide34 Wilcoxon Signed Ranks Test “Performance” Example The rejection region for α = .05 is z > z.025 = 1.96 Conclusion: Since 2.6043 > 1.96, we have enough evidence to conclude that median performance ratings of before and of after are different. Slide35 Sign Test Sign Test
s s s s s s 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 (i.e. related populations). (Note: This test can be used for testing about one population median and the data can be nominal.) 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. The observations are matched pairs (for related populations). Slide36 Example: Peanut Butter Taste Test Example: Peanut Butter Taste Test
As part of a market research study, a sample of 36 consumers were asked to taste two brands of peanut butter and indicate a preference. Do the data shown below indicate a difference in the consumer preferences for the two brands? 18 preferred Hoppy Peanut Butter (+ sign recorded) 12 preferred Pokey Peanut Butter (_ sign recorded) 6 had no preference The analysis is based on a sample size of 18 + 12 = 30. Slide37 Example: Peanut Butter Taste Test Example: Peanut Butter Taste Test
s Hypotheses H0: No preference for one brand over the other exists (i.e. p = 0.5) Ha: A preference for one brand over the other exists (i.e. p ≠ 0.5) When you see the above hypotheses, how would you proceed? Yes, proceed exactly the same as hypothesis test on population proportion with the hypothesized value = 0.5!!! Nothing new. That means even though we call it as Sign Test, it is actually a test on proportion, and of course need to ensure large sample or small sample case. Slide38 Example: Peanut Butter Taste Test Example: Peanut Butter Taste Test
s Note: Some mathematics….. p−π0 x − x0 z= = π 0 (1 − π 0 ) nπ 0 (1 − π 0 ) n
where x is number of success and x0 is the hypothesized number of success Slide39 Example: Peanut Butter Taste Test Example: Peanut Butter Taste Test
s Rejection Rule Using .05 level of significance, Reject H0 if z < 1.96 or z > 1.96 Test Statistic z = (18 15)/2.74 = 3/2.74 = 1.095 Conclusion Do not reject H0. We don’t have enough evidence to conclude that a difference in preference exists for the two brands of peanut butter. (Fewer than 10 or more than 20 individuals would have to have a preference for a particular brand in order for us to reject H0.)
Slide40 s s The End of Topic 3 The End of Topic 3 Slide41 ...
View
Full
Document
This note was uploaded on 01/17/2010 for the course STATS 2225 taught by Professor Li during the Spring '09 term at Langara.
 Spring '09
 Li
 Statistics

Click to edit the document details