Presentation is loading. Please wait.

Presentation is loading. Please wait.

Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for.

Similar presentations


Presentation on theme: "Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for."— Presentation transcript:

1 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for Managers Using Microsoft ® Excel 4 th Edition

2 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-2 Chapter Goals After completing this chapter, you should be able to:  Perform a  2 test for the difference between two proportions  Use a  2 test for differences in more than two proportions  Perform a  2 test of independence  Apply and interpret the Wilcoxon rank sum test for the difference between two medians  Perform nonparametric analysis of variance using the Kruskal-Wallis rank test for one-way ANOVA

3 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-3 Contingency Tables Useful in situations involving multiple population proportions Used to classify sample observations according to two or more characteristics Also called a cross-classification table.

4 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-4 Contingency Table Example Left-Handed vs. Gender Dominant Hand: Left vs. Right Gender: Male vs. Female  2 categories for each variable, so called a 2 x 2 table  Suppose we examine a sample of size 300

5 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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:

6 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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 : p 1 = p 2 (Proportion of females who are left handed is equal to the proportion of males who are left handed) H 1 : p 1 ≠ p 2 (The two proportions are not the same – Hand preference is not independent of gender)

7 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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  2 for the 2 x 2 case has 1 degree of freedom (Assumed: each cell in the contingency table has expected frequency of at least 5) The Chi-square test statistic is:

8 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-8 Decision Rule  2U2U Decision Rule: If  2 >  2 U, reject H 0, otherwise, do not reject H 0 The  2 test statistic approximately follows a chi- squared distribution with one degree of freedom 0  Reject H 0 Do not reject H 0

9 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-9 Computing the Average Proportion Here: 120 Females, 12 were left handed 180 Males, 24 were left handed i.e., the proportion of left handers overall is 12% The average proportion is:

10 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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

11 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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

12 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-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:

13 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-13 Decision Rule Decision Rule: If  2 > 3.841, reject H 0, otherwise, do not reject H 0 Here,  2 = 0.6848 <  2 U = 3.841, so we do not reject H 0 and conclude that there is not sufficient evidence that the two proportions are different at  =.05   2 U =3.841 0  Reject H 0 Do not reject H 0

14 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-14 Extend the  2 test to the case with more than two independent populations:  2 Test for the Differences in More Than Two Proportions H 0 : p 1 = p 2 = … = p c H 1 : Not all of the p j are equal (j = 1, 2, …, c)

15 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-15 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  2 for the 2 x c case has (2-1)(c-1) = c - 1 degrees of freedom (Assumed: each cell in the contingency table has expected frequency of at least 1) The Chi-square test statistic is:

16 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-16 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: Decision Rule: If  2 >  2 U, reject H 0, otherwise, do not reject H 0 Where  2 U is from the chi-squared distribution with c – 1 degrees of freedom

17 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-17  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)

18 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-18  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  2 for the r x c case has (r-1)(c-1) degrees of freedom (Assumed: each cell in the contingency table has expected frequency of at least 1) The Chi-square test statistic is: (continued)

19 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-19 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

20 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-20 Decision Rule The decision rule is If  2 >  2 U, reject H 0, otherwise, do not reject H 0 Where  2 U is from the chi-squared distribution with (r – 1)(c – 1) degrees of freedom

21 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-21 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

22 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-22 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)

23 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-23 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.26.330 Senior14.017.68.440 Total708842200 Observed: Expected cell frequencies if H 0 is true: Example for one cell: Example: Expected Cell Frequencies (continued)

24 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-24 Example: The Test Statistic The test statistic value is: (continued)  2 U = 12.592 for α =.05 from the chi-squared distribution with (4 – 1)(3 – 1) = 6 degrees of freedom

25 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-25 Example: Decision and Interpretation (continued) Decision Rule: If  2 > 12.592, reject H 0, otherwise, do not reject H 0 Here,  2 = 0.709 <  2 U = 12.592, so do not reject H 0 Conclusion: there is not sufficient evidence that meal plan and class standing are related at  =.05   2 U =12.592 0  Reject H 0 Do not reject H 0

26 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-26 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

27 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-27 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)

28 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-28 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

29 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-29 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

30 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-30 Sample data is 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 sample medians at the 0.05 significance level Wilcoxon Rank-Sum Test: Small Sample Example

31 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-31 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)

32 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-32 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

33 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-33 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

34 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-34 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)

35 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-35 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 Can use the normal approximation for small samples

36 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-36 Wilcoxon Rank-Sum Test (Large Sample) The Z test statistic is Where Z approximately follows a standardized normal distribution (continued)

37 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-37 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

38 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-38 Wilcoxon Rank-Sum Test: Normal Approximation Example The test statistic is (continued) Z = 1.64 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

39 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-39 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

40 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-40 Kruskal-Wallis Test Procedure Obtain relative 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

41 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-41 Kruskal-Wallis Test Procedure The Kruskal-Wallis H test statistic: (with c – 1 degrees of freedom) where: n = sum of sample sizes in all samples c = Number of samples T j = Sum of ranks in the j th sample n j = Size of the j th sample (continued)

42 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-42 Decision rule Reject H 0 if test statistic H >  2 U 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  2U2U 0  Reject H 0 Do not reject H 0

43 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-43 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

44 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-44 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

45 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-45 The H statistic is (continued) Kruskal-Wallis Example

46 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-46 Since H = 6.72 < do not reject H 0 (continued) Kruskal-Wallis Example Compare H = 6.72 to the critical value from the chi-square distribution for 5 – 1 = 4 degrees of freedom and  =.05: There is not sufficient evidence to reject that the population medians are all equal

47 Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-47 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 Examined the  2 test for independence Used the Wilcoxon rank sum test for two population medians Small Samples Large sample Z approximation Applied the Kruskal-Wallis H-test for multiple population medians


Download ppt "Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for."

Similar presentations


Ads by Google