Download presentation
1
Statistics for Managers Using Microsoft® Excel 5th Edition
Chapter 12 Chi Square Tests and Nonparametric Tests Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
2
Learning Objectives After completing this chapter, you should be able to: Understand the 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 and interpret the nonparametric Kruskal-Wallis rank test for the difference between three or more medians Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
3
2 Test for the Difference Between Two Proportions
The Chi-square test statistic is: H0: π1 = π 2 H1: π1 π2 The 2 test produces the same results as the Z test for the difference in two proportions. The 2 test can not be used for upper and lower tail tests only two-tail tests. Therefore use the Z test for the difference in two proportions as it is a more complete test. Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
4
2 Test for The Difference Between More Than Two Proportions
Compares observed frequencies to expected frequencies if null hypothesis is true The closer the observed frequencies are to the expected frequencies, the more likely the H0 is true Tests for equality (=) of proportions only One variable with several groups or levels Uses a contingency table Assumptions: Independent random samples “Large” sample size All expected frequencies 5 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
5
2 Test for The Differences Among More Than Two Proportions
Extend the 2 test to the case with more than two independent populations: H0: π1 = π2 = … = πc H1: Not all of the πj are equal (j = 1, 2, …, c) Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
6
The Chi-Square Test Statistic
The Chi-square test statistic is: where: fo = observed frequency in a particular cell of the 2 x c table fe = expected frequency in a particular cell if H0 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 5 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
7
2 Test with More Than Two Proportions: Example
The sharing of patient records is a controversial issue in health care. A survey of 500 respondents asked whether they objected to their records being shared by insurance companies, by pharmacies, and by medical researchers. The results are summarized on the following table: Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
8
2 Test with More Than Two Proportions: Example
Object to Record Sharing Organization Insurance Companies Pharmacies Medical Researchers Yes 410 295 335 No 90 205 165 1040 460 500 500 500 1500 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
9
More Than Two Proportions: Example: Expected Frequencies
Object to Record Sharing Organization Insurance Companies Pharmacies Medical Researchers Yes 295 335 No 205 165 1040 460 1500 500 500 500 Row Total /Grand Total x Column Total > 1040/1500x500 = Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
10
2 Test with More Than Two Proportions: Example
Object to Record Sharing Organization Insurance Companies Pharmacies Medical Researchers Yes fo = 410 fe = fo = 295 fo = 335 No fo = 90 fe = fo = 205 fo = 165 All Expected Frequencies are > 5 The sample size is ‘Large’ Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
11
2 Test for c Proportions: Example
(continued) Compute Test Statistic: f0 fe (f0 - fe)2 / fe Test Statistic 2 = Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
12
2 Test with More Than Two Proportions: Example
H1: Not all of the πj are equal (j = 1, 2, 3) 2 (64.120) = 1.19E-14 is from the chi-square distribution with 2 degrees of freedom. p-value = 1.19E-14 Conclusion: Since 1.19E-14 < .05, you reject H0 and you conclude that at least one proportion of respondents who object to their records being shared is different from the other organizations Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
13
The Marascuilo Procedure
The Marascuilo procedure enables you to make comparisons between all pairs of groups (similar to Tukey-Kramer). First, compute the observed differences pj - pj’ among all c(c-1)/2 pairs. Second, compute the corresponding critical range for the Marascuilo procedure. Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
14
The Marascuilo Procedure
Critical Range for the Marascuilo Procedure: Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
15
The Marascuilo Procedure Example
Object to Record Sharing Organization Insurance Companies Pharmacies Medical Researchers Yes 410 295 335 Proportion 410/500 P1 = 0.82 295/500 P2 = 0.59 335/500 P3 = 0.67 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
16
The Marascuilo Procedure Example
MARASCUILO TABLE Proportions Differences Absolute Differences | p Insurance – p Pharmacies | = .23 0.23 | p Insurance – p Research | = .15 0.15 | p Pharmacies – p Research | = -.08 0.08 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
17
The Marascuilo Procedure
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
18
The Marascuilo Procedure Example
MARASCUILO TABLE Proportions Absolute Differences Critical Range | p Insurance – p Pharmacies | 0.23 0.0683 | p Insurance – p Research | 0.15 0.0665 | p Research – p Insurance | 0.08 0.0745 Conclusion: Since each absolute difference is greater than the critical range, you conclude that each proportion is significantly different that the other two. Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
19
2 Test for more than two Proportions in PhStat
PhStat | Multiple-Sample Tests | Chi-Square Test … Be sure to check the Marascuilo Procedure box to calculate which proportions are different (similar to the Tukey-Kramer Test) Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
20
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 H0: The two categorical variables are independent (i.e., there is no relationship between them) H1: The two categorical variables are dependent (i.e., there is a relationship between them) Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
21
2 Test of Independence The Chi-square test statistic is: where:
fo = observed frequency in a particular cell of the r x c table fe = expected frequency in a particular cell if H0 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) Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
22
Example: Test of Independence
The meal plan selected by 200 students is shown below: Class Standing Number of meals per week Total 20/week 10/week none Fresh. 24 32 14 70 Soph. 22 26 12 60 Junior 10 6 30 Senior 16 40 88 42 200 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
23
Example: Test of Independence
The hypothesis to be tested is: H0: Meal plan and class standing are independent (i.e., there is no relationship between them) H1: Meal plan and class standing are dependent (i.e., there is a relationship between them) Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
24
Example: Expected Cell Frequencies
(continued) Observed: Class Standing Number of meals per week Total 20/wk 10/wk none Fresh. 24 32 14 70 Soph. 22 26 12 60 Junior 10 6 30 Senior 16 40 88 42 200 Expected cell frequencies if H0 is true: Class Standing Number of meals per week Total 20/wk 10/wk none Fresh. 24.5 30.8 14.7 70 Soph. 21.0 26.4 12.6 60 Junior 10.5 13.2 6.3 30 Senior 14.0 17.6 8.4 40 88 42 200 Example for one cell: Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
25
Example: The Test Statistic
(continued) The test statistic value is: p-value=.9943 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
26
Example: Decision and Interpretation
(continued) Decision Rule: If the p-value is < , reject H0, otherwise, do not reject H0 Here, p=value not < so do not reject H0 Conclusion: There is not sufficient evidence that meal plan and class standing are related at = .05 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
27
2 Test of Independence in PHStat
PHStat | Multiple-Sample Tests | Chi-Square Test … Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
28
McNemar Test Used to test for the difference between two proportions of related samples (not independent) You need to use a test statistic that follows the normal distribution Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
29
McNemar Test Condition 1 Condition 2 Yes No Totals A B A+B C D C+D A+C
B+D A+B+C+D Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
30
McNemar Test Paired Data Test Statistic
To test the hypothesis: H0: π1 = π2 H0: π1 π H0: π1 π2 H1: π1 ≠ π H1: π1 > π H1: π1 < π2 Use the test statistic: Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
31
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: Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
32
McNemar Test Example Survey response before change Survey response after change Yes No Totals 118 2 120 22 158 180 140 160 300 Test the hypothesis (at the 0.05 level of significance): H0: π1 ≥ π2: The change in loan terms was ineffective H1: π1 < π2: The change in loan terms increased business Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
33
McNemar Test Example The test statistic is: p-value = 2.23E-05
Survey response before change Survey response after change Yes No Totals 118 2 120 22 158 180 140 160 300 p-value = 2.23E-05 Since 2.23E-05 < .05, you reject H0 and conclude that the change in loan terms significantly increase business for the mortgage company. Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
34
Wilcoxon Rank-Sum Test for Differences in Two Medians
Test two independent population medians Populations need not be normally distributed Distribution free procedure Used when only rank data are available Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
35
Wilcoxon Rank-Sum Test Using Normal Approximation
For large samples, the test statistic T1 is approximately normal with mean and standard deviation: Must use the normal approximation if either n1 or n2 > 10 Assign n1 to be the smaller of the two sample sizes Can also use the normal approximation for small samples n1 and n2 <10 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
36
Wilcoxon Rank-Sum Test
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 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
37
Wilcoxon Rank-Sum Test Example with Small Samples
Capacity Rank Factory A Factory B 71 1 77 2 82 3.5 85 5 88 6 92 7 94 8 97 9 Rank Sums: 20.5 24.5 Ranked Capacity values: Tie in 3rd and 4th places Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
38
Wilcoxon Rank-Sum Test Example with Small Samples
Factory B has the smaller sample size, so the test statistic is the sum of the Factory B ranks: T = 24.5 The sample sizes are: n1 = 4 (factory B) n2 = 5 (factory A) The level of significance is α = .05 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
39
Wilcoxon Rank-Sum Test Using Normal Approximation
The Z test statistic is Where Z approximately follows a standardized normal distribution Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
40
Wilcoxon Rank-Sum Test Using Normal Approximation
Use the setting of the prior example: The sample sizes were: n1 = 4 (factory B) n2 = 5 (factory A) The level of significance was α = .05 The test statistic was T1 = 24.5 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
41
Wilcoxon Rank-Sum Test Using Normal Approximation
The test statistic is p-value =.2703 is not less than α = .05 so you do not reject H0 – there is not sufficient evidence that the medians are different Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
42
Wilcoxon Rank-Sum Test for Differences in 2 Medians Using the Normal Approximation
PHStat | Two-Sample Tests | Wilcoxon Rank Sum Test … Use for both small samples <10 and large samples >10 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
43
Kruskal-Wallis Rank Test for more than Two Population Medians
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 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
44
Kruskal-Wallis Rank Test
The Kruskal-Wallis H test statistic: (with c – 1 degrees of freedom) where: n = total number of values over the combined samples c = Number of groups Tj = Sum of ranks in the jth sample nj = Size of the jth sample Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
45
Kruskal-Wallis Rank Test Example
Do different branch offices have a different number of employees? Office size (Chicago, C) Office size (Denver, D) Office size (Houston, H) 23 41 54 78 66 55 60 72 45 70 30 40 18 34 44 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
46
Kruskal-Wallis Rank Test Example
Do different branch offices have a different number of employees? Office size (Chicago, C) Ranking Office size (Denver, D) Office size (Houston, H) 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 3 5 1 4 7 = 44 = 56 = 20 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
47
Kruskal-Wallis Rank Test Example
The H statistic is Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
48
Kruskal-Wallis Test Example Solution
H0: Med1 = Med2 = Med3 H1: Not all medians equal = .05 Test Statistic: H = 6.72 p-value = .0347 Decision: Reject at = .05 Conclusion: There is sufficient evidence that the population median office sizes are not all equal by city. Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
49
Kruskal-Wallis Rank Test in PHStat
PHStat | Multiple-Sample Tests | Kruskal-Wallis Rank Test … Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
50
Chapter Summary In this chapter, we have
Examined 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 McNemar test for differences in two related proportions 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 Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.