Download presentation
Presentation is loading. Please wait.
Published byElfreda Jacobs Modified over 9 years ago
1
Chap 12-1 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-1 Chapter 12 Chi-Square Tests and Nonparametric Tests Basic Business Statistics 12 th Edition
2
Chap 12-2 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-2 Learning Objectives In this chapter, you learn: How and when to use the chi-square test for contingency tables How to use the Marascuilo procedure for determining pairwise differences when evaluating more than two proportions How and when to use the McNemar test How to use the Chi-Square to test for a variance or standard deviation How and when to use nonparametric tests
3
Chap 12-3 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-3 Contingency Tables Useful in situations comparing multiple population proportions Used to classify sample observations according to two or more characteristics Also called a cross-classification table. DCOVA
4
Chap 12-4 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-4 Contingency Table Example Left-Handed vs. Gender Dominant Hand: Left vs. Right Gender: Male vs. Female 2 categories for each variable, so this is called a 2 x 2 table Suppose we examine a sample of 300 children DCOVA
5
Chap 12-5 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-5 Contingency Table Example Sample results organized in a contingency table: (continued) Gender Hand Preference LeftRight Female12108120 Male24156180 36264300 120 Females, 12 were left handed 180 Males, 24 were left handed sample size = n = 300: DCOVA
6
Chap 12-6 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-6 2 Test for the Difference Between Two Proportions If H 0 is true, then the proportion of left-handed females should be the same as the proportion of left-handed males The two proportions above should be the same as the proportion of left-handed people overall H 0 : π 1 = π 2 (Proportion of females who are left handed is equal to the proportion of males who are left handed) H 1 : π 1 ≠ π 2 (The two proportions are not the same – hand preference is not independent of gender) DCOVA
7
Chap 12-7 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-7 The Chi-Square Test Statistic where: f o = observed frequency in a particular cell f e = expected frequency in a particular cell if H 0 is true (Assumed: each cell in the contingency table has expected frequency of at least 5) The Chi-square test statistic is: DCOVA
8
Chap 12-8 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-8 Decision Rule 2α2α Decision Rule: If, reject H 0, otherwise, do not reject H 0 The test statistic approximately follows a chi- squared distribution with one degree of freedom 0 Reject H 0 Do not reject H 0 DCOVA
9
Chap 12-9 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-9 Computing the Average Proportion Here: 120 Females, 12 were left handed 180 Males, 24 were left handed i.e., based on all 300 children the proportion of left handers is 0.12, that is, 12% The average proportion is: DCOVA
10
Chap 12-10 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-10 Finding Expected Frequencies To obtain the expected frequency for left handed females, multiply the average proportion left handed (p) by the total number of females To obtain the expected frequency for left handed males, multiply the average proportion left handed (p) by the total number of males If the two proportions are equal, then P(Left Handed | Female) = P(Left Handed | Male) =.12 i.e., we would expect (.12)(120) = 14.4 females to be left handed (.12)(180) = 21.6 males to be left handed DCOVA
11
Chap 12-11 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-11 Observed vs. Expected Frequencies Gender Hand Preference LeftRight Female Observed = 12 Expected = 14.4 Observed = 108 Expected = 105.6 120 Male Observed = 24 Expected = 21.6 Observed = 156 Expected = 158.4 180 36264300 DCOVA
12
Chap 12-12 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-12 Gender Hand Preference LeftRight Female Observed = 12 Expected = 14.4 Observed = 108 Expected = 105.6 120 Male Observed = 24 Expected = 21.6 Observed = 156 Expected = 158.4 180 36264300 The Chi-Square Test Statistic The test statistic is: DCOVA
13
Chap 12-13 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-13 Decision Rule Decision Rule: If > 3.841, reject H 0, otherwise, do not reject H 0 Here, =0.7576 < = 3.841, so we do not reject H 0 and conclude that there is not sufficient evidence that the two proportions are different at = 0.05 2 0.05 = 3.841 0 0.05 Reject H 0 Do not reject H 0 DCOVA
14
Chap 12-14 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chi-Square Test In Excel Chap 12-14 Chi-Square Test Observed Frequencies Hand Preference Calculations GenderLeftRightTotalf 0 - f e Female12108120-2.42.4 Male241561802.4-2.4 Total36264300 Expected Frequencies Hand Preference GenderLeftRightTotal(f 0 - f e )^2/f e Female14.4105.61200.400.05 Male21.6158.41800.270.04 Total36264300 Data Level of Significance0.05 Number of Rows2 Number of Columnns2 Degrees of Freedom1=(B19-1)*(B20-1) Results Critical Value3.8415=CHIINV(B18,B21) Chi-Square Test Statistic0.7576=SUM(F13:G14) p-Value0.3841=CHIDIST(B25,B21) Do not reject the null hypothesis=IF(B26<B18,"Reject the null hypothesis", "Do not reject the null hypothesis") Expected Frequency assumption is met.=IF(OR(B13<5,C13<5,B14<5,C14<5), " is violated."," is met.") DCOVA
15
Chap 12-15 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-15 Chi-Square Test In Minitab Tabulated statistics: Gender, Hand (Expected counts are below observed) (Chi-Square cell contribution below expected counts) Rows: Gender Columns: Hand Left Right All Female 12 108 120 14.4 105.6 120.0 0.40000 0.05455 * Male 24 156 180 21.6 158.4 180.0 0.26667 0.03636 * All 36 264 300 36.0 264.0 300.0 * * * Pearson Chi-Square = 0.758, DF = 1, P-Value = 0.384 DCOVA
16
Chap 12-16 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-16 Extend the 2 test to the case with more than two independent populations: 2 Test for Differences Among More Than Two Proportions H 0 : π 1 = π 2 = … = π c H 1 : Not all of the π j are equal (j = 1, 2, …, c) DCOVA
17
Chap 12-17 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-17 The Chi-Square Test Statistic Where: f o = observed frequency in a particular cell of the 2 x c table f e = expected frequency in a particular cell if H 0 is true (Assumed: each cell in the contingency table has expected frequency of at least 1) The Chi-square test statistic is: DCOVA
18
Chap 12-18 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-18 Computing the Overall Proportion The overall proportion is: Expected cell frequencies for the c categories are calculated as in the 2 x 2 case, and the decision rule is the same: Where is from the chi- squared distribution with c – 1 degrees of freedom Decision Rule: If, reject H 0, otherwise, do not reject H 0 DCOVA
19
Chap 12-19 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-19 Example of 2 Test for Differences Among More Than Two Proportions A University is thinking of switching to a trimester academic calendar. A random sample of 100 administrators, 50 students, and 50 faculty members were surveyed Opinion Administrators Students Faculty Favor 63 20 37 Oppose 37 30 13 Totals 100 5050 Using a 1% level of significance, which groups have a different attitude? DCOVA
20
Chap 12-20 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-20 Chi-Square Test Results Chi-Square Test: Administrators, Students, Faculty Admin Students FacultyTotal Favor 632037120 603030 Oppose 373013 80 40 20 20 Total 100 50 50 200 Observed Expected H 0 : π 1 = π 2 = π 3 H 1 : Not all of the π j are equal (j = 1, 2, 3) DCOVA
21
Chap 12-21 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Excel Output For The Example Chap 12-21 DCOVA Chi-Square Test Observed Frequencies Role Calculations OpinionAdminStudentsFacultyTotalfo - fe Favor6320371203.0000-10.00007 Oppose37301380-3.000010.0000-7 Total10050 200 Expected Frequencies Role OpinionAdminStudentsFacultyTotal(fo - fe)^2/fe Favor60.030.0 1200.15003.33331.6333 Oppose40.020.0 800.22505.00002.4500 Total10050 200 Data Level of Significance0.01 Number of Rows2 Number of Columns3 Degrees of Freedom2=($B$19 - 1) * ($B$20 - 1) Results Critical Value9.2103=CHIINV(B18, B21) Chi-Square Test Statistic12.7917=SUM(G13:I14) p-Value0.0017=CHIDIST(B25, B21) Reject the null hypothesis=IF(B26<B18, "Reject the null hypothesis", Do not reject the null hypothesis") Expected frequency assumption is met.=IF(OR(B13<1, C13<1, D13<1, B14<1, C14<1, D14<1), " is violated.", " is met.")
22
Chap 12-22 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Minitab Output For The Example Chap 12-22 DCOVA Tabulated statistics: Position, Role Rows: Position Columns: Role Admin Faculty Students All Favor 63 37 20 120 60 30 30 120 0.150 1.633 3.333 * Oppose 37 13 30 80 40 20 20 80 0.225 2.450 5.000 * All 100 50 50 200 100 50 50 200 * * * * Pearson Chi-Square = 12.792, DF = 2, P-Value = 0.002
23
Chap 12-23 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-23 The Marascuilo Procedure Used when the null hypothesis of equal proportions is rejected Enables you to make comparisons between all pairs Start with the observed differences, p j – p j ’, for all pairs (for j ≠ j ’ ) then compare the absolute difference to a calculated critical range DCOVA
24
Chap 12-24 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-24 The Marascuilo Procedure Critical Range for the Marascuilo Procedure: (Note: the critical range is different for each pairwise comparison) A particular pair of proportions is significantly different if | p j – p j ’ | > critical range for j and j ’ (continued) DCOVA
25
Chap 12-25 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-25 Marascuilo Procedure Example A University is thinking of switching to a trimester academic calendar. A random sample of 100 administrators, 50 students, and 50 faculty members were surveyed Opinion Administrators Students Faculty Favor 63 20 37 Oppose 37 30 13 Totals 100 5050 Using a 1% level of significance, which groups have a different attitude? DCOVA
26
Chap 12-26 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-26 Chi-Square Test Results Chi-Square Test: Administrators, Students, Faculty Admin Students FacultyTotal Favor 632037120 603030 Oppose 373013 80 40 20 20 Total 100 50 50 200 Observed Expected H 0 : π 1 = π 2 = π 3 H 1 : Not all of the π j are equal (j = 1, 2, 3) DCOVA
27
Chap 12-27 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-27 Marascuilo Procedure: Solution Calculations In Excel: compare At 1% level of significance, there is evidence of a difference in attitude between students and faculty DCOVA Minitab does not do the Marascuilo procedure
28
Chap 12-28 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-28 2 Test of Independence Similar to the 2 test for equality of more than two proportions, but extends the concept to contingency tables with r rows and c columns H 0 : The two categorical variables are independent (i.e., there is no relationship between them) H 1 : The two categorical variables are dependent (i.e., there is a relationship between them) DCOVA
29
Chap 12-29 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-29 2 Test of Independence where: f o = observed frequency in a particular cell of the r x c table f e = expected frequency in a particular cell if H 0 is true (Assumed: each cell in the contingency table has expected frequency of at least 1) The Chi-square test statistic is: (continued) DCOVA
30
Chap 12-30 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-30 Expected Cell Frequencies Expected cell frequencies: Where: row total = sum of all frequencies in the row column total = sum of all frequencies in the column n = overall sample size DCOVA
31
Chap 12-31 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-31 Decision Rule The decision rule is Where is from the chi-squared distribution with (r – 1)(c – 1) degrees of freedom If, reject H 0, otherwise, do not reject H 0 DCOVA
32
Chap 12-32 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-32 Example The meal plan selected by 200 students is shown below: Class Standing Number of meals per week Total 20/week10/weeknone Fresh.24321470 Soph.22261260 Junior1014630 Senior14161040 Total708842200 DCOVA
33
Chap 12-33 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-33 Example The hypothesis to be tested is: (continued) H 0 : Meal plan and class standing are independent (i.e., there is no relationship between them) H 1 : Meal plan and class standing are dependent (i.e., there is a relationship between them) DCOVA
34
Chap 12-34 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-34 Class Standing Number of meals per week Total 20/wk10/wknone Fresh.24321470 Soph.22261260 Junior1014630 Senior14161040 Total708842200 Class Standing Number of meals per week Total 20/wk10/wknone Fresh.24.530.814.770 Soph.21.026.412.660 Junior10.513.2 6.330 Senior14.017.6 8.440 Total708842200 Observed: Expected cell frequencies if H 0 is true: Example for one cell: Example: Expected Cell Frequencies (continued) DCOVA
35
Chap 12-35 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-35 Example: The Test Statistic The test statistic value is: (continued) = 12.592 from the chi-squared distribution with (4 – 1)(3 – 1) = 6 degrees of freedom DCOVA
36
Chap 12-36 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-36 Example: Decision and Interpretation (continued) Decision Rule: If > 12.592, reject H 0, otherwise, do not reject H 0 Here, = 0.709 < = 12.592, so do not reject H 0 Conclusion: there is not sufficient evidence that meal plan and class standing are related at = 0.05 2 0.05 =12.592 0 0.05 Reject H 0 Do not reject H 0 DCOVA
37
Chap 12-37 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Excel Output Of Example Chap 12-37 DCOVA Chi-Square Test of Independence Observed Frequencies Meals Per Week Calculations Class Standing20/wk10/wkNoneTotalfo - fe Fresh.24321470-0.50001.2000-0.7000 Soph.222612601.0000-0.4000-0.6000 Junior1014630-0.50000.8000-0.3000 Senior141610400.0000-1.60001.6000 Total708842200 Expected Frequencies Meals Per Week Class Standing20/wk10/wkNoneTotal(fo - fe)^2/fe Fresh.24.500030.800014.7000700.01020.04680.0333 Soph.21.000026.400012.6000600.04760.00610.0286 Junior10.500013.20006.3000300.02380.04850.0143 Senior14.000017.60008.4000400.00000.14550.3048 Total708842200 Data Level of Significance0.05 Number of Rows4 Number of Columns3 Degrees of Freedom6=($B$23 - 1) * ($B$24 - 1) Results Critical Value12.5916=CHIINV(B22, B25) Chi-Square Test Statistic0.7093=SUM($G$15:$I$18) p-Value0.9943=CHIDIST(B29, B25) Do not reject the null hypothesis=IF(B30<B22, "Reject the null hypothesis", Do not reject the null hypothesis) Expected frequency assumption is met.=IF(OR(B15<1, C15<1, D15<1, B16<1, C16<1, D16<1, B17<1, C17<1, D17<1, B18<1, C18<1, D18<1), " is violated.", " is met.")
38
Chap 12-38 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Minitab Output Of Example Chap 12-38 DCOVA Tabulated statistics: Class, Meals Rows: Class Columns: Meals 0 10 20 All Fresh 14 32 24 70 14.70 30.80 24.50 70.00 0.03333 0.04675 0.01020 * Junior 6 14 10 30 6.30 13.20 10.50 30.00 0.01429 0.04848 0.02381 * Senior 10 16 14 40 8.40 17.60 14.00 40.00 0.30476 0.14545 0.00000 * Soph 12 26 22 60 12.60 26.40 21.00 60.00 0.02857 0.00606 0.04762 * All 42 88 70 200 42.00 88.00 70.00 200. * * * * Pearson Chi-Square = 0.709, DF = 6, P-Value = 0.994
39
Chap 12-39 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-39 McNemar Test (Related Samples) Used to determine if there is a difference between proportions of two related samples Uses a test statistic the follows the normal distribution DCOVA
40
Chap 12-40 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-40 McNemar Test (Related Samples) Consider a 2 X 2 contingency table: (continued) Condition 2 Condition 1YesNoTotals YesABA+B NoCDC+D TotalsA+CB+Dn DCOVA
41
Chap 12-41 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-41 McNemar Test (Related Samples) The sample proportions of interest are Test H 0 : π 1 = π 2 (the two population proportions are equal) H 1 : π 1 ≠ π 2 (the two population proportions are not equal) (continued) DCOVA
42
Chap 12-42 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-42 McNemar Test (Related Samples) The test statistic for the McNemar test: where the test statistic Z is approximately normally distributed (continued) DCOVA
43
Chap 12-43 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-43 McNemar Test Example Suppose you survey 300 homeowners and ask them if they are interested in refinancing their home. In an effort to generate business, a mortgage company improved their loan terms and reduced closing costs. The same homeowners were again surveyed. Determine if change in loan terms was effective in generating business for the mortgage company. The data are summarized as follows:
44
Chap 12-44 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-44 McNemar Test Example Survey response before change Survey response after change YesNoTotals Yes1182120 No22158180 Totals140160300 Test the hypothesis (at the 0.05 level of significance): H 0 : π 1 ≥ π 2 : The change in loan terms was ineffective H 1 : π 1 < π 2 : The change in loan terms increased business DCOVA
45
Chap 12-45 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-45 McNemar Test Example Survey response before change Survey response after change YesNoTotals Yes1182120 No22158180 Totals140160300 The critical value (0.05 significance) is Z 0.05 = -1.645 The test statistic is: Since Z STAT = -4.08 < -1.645, you reject H 0 and conclude that the change in loan terms significantly increase business for the mortgage company. DCOVA
46
Chap 12-46 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Excel Output Of McNemar Test Chap 12-46 Minitab does not have a command for the McNemar test McNemar Test Observed Frequencies After Change Before ChangeYesNoTotal Yes1182120 No22158180 Total140160300 Data Level of Significance0.05 Intermediate Calculations Numerator-20=C6-B7 Denominator4.8990=SQRT(C6+B7) Z Test Statistic-4.0825=B14/B15 One-Tail Test Lower Critical Value-1.6449=NORMSINV(B11) p-Value0.0000=NORMSDIST(B16) Reject the null hypothesis=IF(B21<B11,"Reject the null hypothesis", Do not reject the null hypothesis) DCOVA
47
Chap 12-47 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chi-Square Test for a Variance or Standard Deviation A χ 2 test statistic is used to test whether or not the population variance or standard deviation is equal to a specified value: Where n = sample size S 2 = sample variance σ 2 = hypothesized population variance follows a chi-square distribution with d.f. = n - 1 H 0 : σ 2 = σ 0 2 H a : σ 2 ≠ σ 0 2 Reject H 0 if > or if < DCOVA Chap 12-47
48
Chap 12-48 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall DCOVA Chi-Square Test For A Variance: An Example Suppose you have gathered a random sample of size 25 and obtained a sample standard deviation of S = 7 and want to do the following hypothesis test: H 0 : σ 2 = 81 H a : σ 2 ≠ 81 Since < 14.185 < you fail to reject H 0 Chap 12-48
49
Chap 12-49 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Excel Output For Chi-Square Test For A Variance Chap 12-49 DCOVA Chi-Square Test For A Variance Data Null Hypothesis ^2= 81 Level of Significance0.05 Sample Size25 Sample Standard Deviation7 Intermediate Calculations Degrees of Freedom24=B6-1 Half Area0.025=B5/2 Chi-Square Statistic14.5185=B10*B7^2/B4 Two-Tail Test Lower Critical Value12.4012 =CHIINV(1- B11,B10) Upper Critical Value39.3641=CHIINV(B11,B10) p-Value0.9341 =IF((B12-B15)<0,1- CHIDIST(B12,B10),CHIDIST(B12,B10)) Do not reject the null hypothesis =IF(B17<$B$5/2,"Reject the null hypothesis", Do not reject the null hypothesis) Minitab does not have a command for the McNemar test
50
Chap 12-50 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-50 Wilcoxon Rank Sum Test for Differences in 2 Medians Test two independent population medians Populations need not be normally distributed Distribution free procedure Used when only rank data are available Must use normal approximation if either of the sample sizes is larger than 10 DCOVA
51
Chap 12-51 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-51 Wilcoxon Rank Sum Test: Small Samples Can use when both n 1, n 2 ≤ 10 Assign ranks to the combined n 1 + n 2 sample observations If unequal sample sizes, let n 1 refer to smaller-sized sample Smallest value rank = 1, largest value rank = n 1 + n 2 Assign average rank for ties Sum the ranks for each sample: T 1 and T 2 Obtain test statistic, T 1 (from smaller sample) DCOVA
52
Chap 12-52 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-52 Checking the Rankings The sum of the rankings must satisfy the formula below Can use this to verify the sums T 1 and T 2 where n = n 1 + n 2 DCOVA
53
Chap 12-53 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-53 Wilcoxon Rank Sum Test: Hypothesis and Decision Rule H 0 : M 1 = M 2 H 1 : M 1 M 2 H 0 : M 1 M 2 H 1 : M 1 M 2 H 0 : M 1 M 2 H 1 : M 1 M 2 Two-Tail TestLeft-Tail TestRight-Tail Test M 1 = median of population 1; M 2 = median of population 2 Reject T 1L T 1U Reject Do Not Reject Reject T 1L Do Not Reject T 1U Reject Do Not Reject Test statistic = T 1 (Sum of ranks from smaller sample) Reject H 0 if T 1 ≤ T 1L or if T 1 ≥ T 1U Reject H 0 if T 1 ≤ T 1L Reject H 0 if T 1 ≥ T 1U DCOVA
54
Chap 12-54 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-54 Sample data are collected on the capacity rates (% of capacity) for two factories. Are the median operating rates for two factories the same? For factory A, the rates are 71, 82, 77, 94, 88 For factory B, the rates are 85, 82, 92, 97 Test for equality of the population medians at the 0.05 significance level Wilcoxon Rank Sum Test: Small Sample Example DCOVA
55
Chap 12-55 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-55 Wilcoxon Rank Sum Test: Small Sample Example CapacityRank Factory AFactory BFactory AFactory B 711 772 823.5 823.5 855 886 927 948 979 Rank Sums:20.524.5 Tie in 3 rd and 4 th places Ranked Capacity values: (continued) DCOVA
56
Chap 12-56 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-56 Wilcoxon Rank Sum Test: Small Sample Example (continued) Factory B has the smaller sample size, so the test statistic is the sum of the Factory B ranks: T 1 = 24.5 The sample sizes are: n 1 = 4 (factory B) n 2 = 5 (factory A) The level of significance is =.05 DCOVA
57
Chap 12-57 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-57 n2n2 n1n1 One- Tailed Two- Tailed 45 4 5.05.1012, 2819, 36.025.0511, 2917, 38.01.0210, 3016, 39.005.01--, --15, 40 6 Wilcoxon Rank Sum Test: Small Sample Example Lower and Upper Critical Values for T 1 from Appendix table E.8: (continued) T 1L = 11 and T 1U = 29 DCOVA
58
Chap 12-58 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-58 H 0 : M 1 = M 2 H 1 : M 1 M 2 Two-Tail Test Reject T 1L =11T 1U =29 Reject Do Not Reject Reject H 0 if T 1 ≤ T 1L =11 or if T 1 ≥ T 1U =29 =.05 n 1 = 4, n 2 = 5 Test Statistic (Sum of ranks from smaller sample): T 1 = 24.5 Decision: Conclusion: Do not reject at = 0.05 There is not enough evidence to prove that the medians are not equal. Wilcoxon Rank Sum Test: Small Sample Solution (continued) DCOVA
59
Chap 12-59 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-59 Wilcoxon Rank Sum Test (Large Sample) For large samples, the test statistic T 1 is approximately normal with mean and standard deviation : Must use the normal approximation if either n 1 or n 2 > 10 Assign n 1 to be the smaller of the two sample sizes Should not use the normal approximation for small samples DCOVA
60
Chap 12-60 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-60 Wilcoxon Rank Sum Test (Large Sample) The Z test statistic is Where Z STAT approximately follows a standardized normal distribution (continued) DCOVA
61
Chap 12-61 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-61 Wilcoxon Rank Sum Test: Normal Approximation Example Use the setting of the prior example: The sample sizes were: n 1 = 4 (factory B) n 2 = 5 (factory A) The level of significance was α =.05 The test statistic was T 1 = 24.5 DCOVA
62
Chap 12-62 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-62 Wilcoxon Rank Sum Test: Normal Approximation Example The test statistic is (continued) Z = 1.10 is not greater than the critical Z value of 1.96 (for α =.05) so we do not reject H 0 – there is not sufficient evidence that the medians are not equal DCOVA
63
Chap 12-63 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Example Excel Output Chap 12-63 DCOVA Wilcoxon Rank Sum Test Data Level of Significance0.05 Population 1 Sample Sample Size4 Sum of Ranks24.5 Population 2 Sample Sample Size5 Sum of Ranks20.5 Intermediate Calculations Total Sample Size n9=B7+B10 T1 Test Statistic24.5=IF(B7<=B10,B8,B11) T1 Mean20=IF(B7<=B10,B7*(B14+1)/2,B10*(B14+1)/2) Standard Error of T14.0825=SQRT(B7*B10*(B14+1)/12) Z Test Statistic1.1023=(B15-B16)/B17 Two-Tail Test Lower Critical Value-1.9600=NORMSINV(B4/2) Upper Critical Value1.9600=NORMSINV(1-B4/2) p-Value0.2703=2*(1-NORMSDIST(ABS(B18))) Do not reject the null hypothesis =IF(B23<$B$4,"Reject the null hypothesis", Do not reject the null hypothesis)
64
Chap 12-64 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Example Minitab Output Chap 12-64 DCOVA Mann-Whitney Test and CI: Factory B, Factory A N Median Factory B 4 88.50 Factory A 5 82.00 Point estimate for ETA1-ETA2 is 6.50 96.3 Percent CI for ETA1-ETA2 is (-9.00,21.00) W = 24.5 Test of ETA1 = ETA2 vs ETA1 not = ETA2 is significant at 0.3272 The test is significant at 0.3252 (adjusted for ties)
65
Chap 12-65 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-65 Kruskal-Wallis Rank Test Tests the equality of more than 2 population medians Use when the normality assumption for one- way ANOVA is violated Assumptions: The samples are random and independent Variables have a continuous distribution The data can be ranked Populations have the same variability Populations have the same shape DCOVA
66
Chap 12-66 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-66 Kruskal-Wallis Test Procedure Obtain rankings for each value In event of tie, each of the tied values gets the average rank Sum the rankings for data from each of the c groups Compute the H test statistic DCOVA
67
Chap 12-67 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-67 Kruskal-Wallis Test Procedure The Kruskal-Wallis H-test statistic: (with c – 1 degrees of freedom) where: n = sum of sample sizes in all groups c = Number of groups T j = Sum of ranks in the j th group n j = Number of values in the j th group (j = 1, 2, …, c) (continued) DCOVA
68
Chap 12-68 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-68 Decision rule Reject H 0 if test statistic H > 2 α Otherwise do not reject H 0 (continued) Kruskal-Wallis Test Procedure Complete the test by comparing the calculated H value to a critical 2 value from the chi-square distribution with c – 1 degrees of freedom 2α2α 0 Reject H 0 Do not reject H 0 DCOVA
69
Chap 12-69 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-69 Do different departments have different class sizes? Kruskal-Wallis Example Class size (Math, M) Class size (English, E) Class size (Biology, B) 23 45 54 78 66 55 60 72 45 70 30 40 18 34 44 DCOVA
70
Chap 12-70 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-70 Do different departments have different class sizes? Kruskal-Wallis Example Class size (Math, M) Ranking Class size (English, E) Ranking Class size (Biology, B) Ranking 23 41 54 78 66 2 6 9 15 12 55 60 72 45 70 10 11 14 8 13 30 40 18 34 44 3514735147 = 44 = 56 = 20 (continued) DCOVA
71
Chap 12-71 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-71 The H statistic is (continued) Kruskal-Wallis Example DCOVA
72
Chap 12-72 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-72 Since H = 7.12 >, reject H 0 (continued) Kruskal-Wallis Example Compare H = 7.12 to the critical value from the chi-square distribution for 3 – 1 = 2 degrees of freedom and = 0.05: There is sufficient evidence to reject that the population medians are all equal DCOVA
73
Chap 12-73 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Example Excel Output Chap 12-73 DCOVA Kruskal-Wallis Rank Test Calculations GroupSample SizeSum of RanksMean Ranks DataSupplier 15448.8 Level of Significance0.05Supplier 255611.2 Supplier 35204 Intermediate Calculations Sum of Squared Ranks/Sample Size1094.4=(G5*F5)+(G6*F6)+(G7*F7) Sum of Sample Sizes15=SUM(E5:E7) Number of Groups3 Test Result H Test Statistic6.7200=(12/(B10*(B10+1)))*B9-(3*(B10+1)) Critical Value5.9915=CHIINV(B6,B11-1) p-Value0.0347=CHIDIST(B14,B11-1) Reject the null hypothesis =IF(B16<B6,"Reject the null hypothesis", "Do not reject the null hypothesis")
74
Chap 12-74 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Example Minitab Output Chap 12-74 DCOVA Kruskal-Wallis Test: Class Size versus Class Type Kruskal-Wallis Test on Class Size Class Type N Median Ave Rank Z B 5 34.00 3.8 -2.57 E 5 60.00 11.1 1.90 M 5 54.00 9.1 0.67 Overall 15 8.0 H = 7.11 DF = 2 P = 0.029 H = 7.13 DF = 2 P = 0.028 (adjusted for ties)
75
Chap 12-75 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-75 Chapter Summary Developed and applied the 2 test for the difference between two proportions Developed and applied the 2 test for differences in more than two proportions Applied the Marascuilo procedure for comparing all pairs of proportions after rejecting a 2 test Examined the 2 test for independence Applied the McNemar test for proportions from two related samples
76
Chap 12-76 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Chap 12-76 Chapter Summary Examined how to use the Chi-Square to test for a variance or standard deviation Used the Wilcoxon rank sum test for two population medians Applied the Kruskal-Wallis rank H-test for multiple population medians (continued)
77
Chap 12-77 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall On Line Topic Wilcoxon Signed Ranks Test Basic Business Statistics 12 th Edition
78
Chap 12-78 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Learning Objectives In this topic, you learn: How to use the Wilcoxon signed ranks test for comparing paired samples
79
Chap 12-79 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Wilcoxon Signed Ranks Test A nonparametric test for two related populations Steps: 1. For each of n sample items, compute the difference, D i, between two measurements 2. Ignore + and – signs and find the absolute values, |D i | 3. Omit zero differences, so sample size is n ’ 4. Assign ranks R i from 1 to n ’ (give average rank to ties) 5. Reassign + and – signs to the ranks R i 6. Compute the Wilcoxon test statistic W as the sum of the positive ranks
80
Chap 12-80 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Wilcoxon Signed Ranks Test Statistic The Wilcoxon signed ranks test statistic is the sum of the positive ranks: For small samples (n ’ < 20), use Table E.9 for the critical value of W
81
Chap 12-81 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Wilcoxon Signed Ranks Test Statistic For samples of n ’ > 20, W is approximately normally distributed with
82
Chap 12-82 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Wilcoxon Signed Ranks Test The large sample Wilcoxon signed ranks Z test statistic is To test for no median difference in the paired values: H 0 : M D = 0 H 1 : M D ≠ 0
83
Chap 12-83 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Topic Summary Used the Wilcoxon signed ranks test for comparing paired samples
84
Chap 12-84 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall On Line Topic Friedman Rank Test Basic Business Statistics 12 th Edition
85
Chap 12-85 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Learning Objectives In this topic, you learn: How to use the Friedman rank test for comparing multiple population medians in a randomized block design
86
Chap 12-86 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Friedman Rank Test Use the Friedman rank test to determine whether c groups (i.e., treatment levels) have been selected from populations having equal medians H 0 : M.1 = M.2 =... = M.c H 1 : Not all M.j are equal (j = 1, 2, …, c)
87
Chap 12-87 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Friedman Rank Test Friedman rank test for differences among c medians: where = the square of the total ranks for group j r = the number of blocks c = the number of groups (continued)
88
Chap 12-88 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Friedman Rank Test The Friedman rank test statistic is approximated by a chi-square distribution with c – 1 d.f. Reject H 0 if Otherwise do not reject H 0 (continued)
89
Chap 12-89 Copyright ©2012 Pearson Education, Inc. publishing as Prentice Hall Topic Summary Applied the Friedman rank test for comparing multiple population medians in a randomized block design
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.