Download presentation
Presentation is loading. Please wait.
Published byBethany Gaines Modified over 9 years ago
1
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-1 Chapter 12 Chi-Square Tests and Nonparametric Tests Statistics for Managers using Microsoft Excel 6 th Edition
2
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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 and when to use nonparametric tests
3
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-9 Computing the Average Proportion Here: 120 Females, 12 were left handed 180 Males, 24 were left handed i.e., based on all 180 children the proportion of left handers is 0.12, that is, 12% The average proportion is: DCOVA
10
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-14 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
15
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-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 (Assumed: each cell in the contingency table has expected frequency of at least 1) The Chi-square test statistic is: DCOVA
16
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-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: 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
17
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-17 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
18
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-18 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
19
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-19 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
20
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 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
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-21 Marascuilo Procedure: Solution Excel Output: compare At 1% level of significance, there is evidence of a difference in attitude between students and faculty DCOVA
22
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-22 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
23
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-23 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
24
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-24 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
25
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-25 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
26
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-26 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
27
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-27 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
28
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-28 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
29
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-29 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
30
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-30 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
31
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-31 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
32
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-32 McNemar Test (Related Samples) Consider a 2 X 2 contingency table: (continued) Condition 2 Condition 1YesNoTotals YesABA+B NoCDC+D TotalsA+CB+Dn DCOVA
33
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-33 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
34
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-34 McNemar Test (Related Samples) The test statistic for the McNemar test: where the test statistic Z is approximately normally distributed (continued) DCOVA
35
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-35 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:
36
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-36 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
37
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-37 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
38
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-38 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
39
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-39 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
40
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-40 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
41
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-41 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
42
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-42 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
43
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-43 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
44
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-44 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
45
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-45 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
46
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-46 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
47
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-47 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
48
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-48 Wilcoxon Rank-Sum Test (Large Sample) The Z test statistic is Where Z STAT approximately follows a standardized normal distribution (continued) DCOVA
49
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-49 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
50
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-50 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
51
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-51 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
52
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-52 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
53
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-53 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
54
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-54 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
55
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-55 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
56
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-56 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
57
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-57 The H statistic is (continued) Kruskal-Wallis Example DCOVA
58
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-58 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
59
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-59 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
60
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-60 Chapter Summary Used the Wilcoxon rank sum test for two population medians Applied the Kruskal-Wallis H-test for multiple population medians (continued)
61
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-61 On Line Topic Chi-Square Tests for The Variance or Standard Deviation Statistics for Managers using Microsoft Excel 6 th Edition
62
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-62 Learning Objectives In this topic, you learn: How to use the Chi-Square to test for a variance or standard deviation
63
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-63 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
64
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-64 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
65
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-65 Topic Summary Examined how to use the Chi-Square to test for a variance or standard deviation
66
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-66 All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.