Statistics For Managers Using Microsoft® Excel 5th Edition: Chi Square Tests and Nonparametric Tests

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

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. Chap 12-1
Contingency Table Example

Hand Preference vs. Gender


Dominant Hand: Left vs. Right
Gender: Male vs. Female

 2 categories for each variable, so the


table is called a 2 x 2 table

 Suppose we examine a sample of


300 college students
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-2
Contingency Table Example

Sample results organized in a contingency table:

sample size = n = 300: Gender


Hand
120 Females, 12 were Female Male
Preference
left handed
Left 12 24 36
180 Males, 24 were
left handed Right 108 156 264

120 180 300

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-3
Contingency Table Example
H0: π1 = π2 (Proportion of females who are left
handed is equal to the proportion of
males who are left handed)
H1: π1 ≠ π2 (The two proportions are not the same –
Hand preference is not independent
of gender)
 If H0 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.

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-4
The Chi-Square Test Statistic
The Chi-square test statistic is:

(f  f ) 2
χ2   o e
all cells fe
where:
fo = observed frequency in a particular cell
fe = expected frequency in a particular cell if H0 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
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-5
The Chi-Square Test Statistic

The 2 test statistic approximately follows a chi-square


distribution with one degree of freedom

Decision Rule:
If 2 > 2U, reject H0,
otherwise, do not reject 
H0
0
Do not Reject H0 2
reject H0
2U

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-6
Computing the
Average Proportion
The average X1  X 2 X
p 
proportion is: n1  n2 n

120 Females, 12 were  Here:


left handed 12  24 36
p   0.12
180 Males, 24 were 120  180 300
left handed
108  156 264
p   0.88
120  180 300
The proportion of left handers overall is 0.12, that is, 12%

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-7
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

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-8
Observed vs. Expected
Frequencies
Gender
Hand
Preference Female Male

Observed = 12 Observed = 24
Left 36
Expected = 14.4 Expected = 21.6

Observed = 108 Observed = 156


Right 264
Expected = 105.6 Expected = 158.4

120 180 300

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-9
The Chi-Square Test Statistic
Gender
Hand
Female Male
Preference
Observed = 12 Observed = 24
Left 36
Expected = 14.4 Expected = 21.6
Observed = 108 Observed = 156
Right 264
Expected = 105.6 Expected = 158.4
120 180 300
The test statistic is:

( fo  fe )2
  
2

all cells fe
(12  14.4) 2 (108  105.6) 2 (24  21.6) 2 (156  158.4) 2
     0.7576
14.4 105.6 21.6 158.4
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-10
The Chi-Square Test Statistic
The test statistic is  2  0.7576 , U2 with 1 d.f.  3.841

Decision Rule:
If 2 > 3.841, reject H0, otherwise, do
not reject H0

Here,
=.05 2 = 0..7576 < 2U = 3.841,
so you do not reject H0 and
0 conclude that there is
Do not Reject H0 2
reject H0 insufficient evidence that the
2U=3.841 two proportions are not
different.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-11
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. Chap 12-12
The Chi-Square Test Statistic
The Chi-square test statistic is:
( f  f ) 2
2   o e
all cells fe
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 1
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-13
Computing the
Overall Proportion
The overall X 1  X 2  ...  X c X
p 
proportion is: n1  n2  ...  nc n

 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: Where 2U is from the
If 2 > 2U, reject H0, chi-square distribution
otherwise, do not with c – 1 degrees of
reject H0 freedom
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-14
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. Chap 12-15
2 Test with More Than Two
Proportions: Example

Organization
Object to
Insurance Pharmacies Medical
Record
Companies Researchers
Sharing
Yes 410 295 335

No 90 205 165

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-16
2 Test with More Than Two
Proportions: Example
The overall X 1  X 2  ...  X c 410  295  335
p   0.6933
proportion is: n1  n2  ...  nc 500  500  500

Organization
Object to
Insurance Pharmacies Medical
Record
Companies Researchers
Sharing
Yes fo = 410 fo = 295 fo = 335
fe = 346.667 fe = 346.667 fe = 346.667
No fo = 90 fo = 205 fo = 165
fe = 153.333 fe = 153.333 fe = 153.333

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-17
2 Test with More Than Two
Proportions: Example
Organization
Object Insurance Pharmacies Medical
to Companies Researchers
Record
Sharing
Yes  f o  f e 2  11.571  f o  f e 2  f o  f e 2
 7.700  0.3926
fe fe fe

No  f o  f e 2  f o  f e 2  17.409
 f o  f e 2  0.888
 26.159
fe fe fe

( f  f ) 2
The Chi-square test statistic is:  2   o e  64.1196
all cells fe
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-18
2 Test with More Than Two
Proportions: Example
H0: π1 = π2 = π3
H1: Not all of the πj are equal (j = 1, 2, 3)

Decision Rule: 2U = 5.991 is from the chi-


If 2 > 2U, reject H0, square distribution with 2
otherwise, do not reject H0 degrees of freedom.

Conclusion: Since 64.1196 > 5.991, you reject H0 and you


conclude that at least one proportion of respondents who object to
their records being shared is different across the three
organizations
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-19
The Marascuilo Procedure

The Marascuilo procedure enables you to


make comparisons between all pairs of
groups.
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. Chap 12-20
The Marascuilo Procedure

 Critical Range for the Marascuilo Procedure:

p j (1  p j ) p j / (1  p j / )
Critical Range   2
U 
nj n j/

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-21
The Marascuilo Procedure

 Compute a different critical range for each


pair-wise comparison of sample proportions.
 Compare each of the c(c - 1)/2 pairs of
sample proportions against its corresponding
critical range.
 Declare a specific pair significantly different
if the absolute difference in the sample
proportions |pj – pj’| is greater than its critical
range.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-22
The Marascuilo Procedure
Example
Organization
Object to
Record Insurance Pharmacies Medical
Sharing Companies Researchers

Yes 410 295 335


P1 = 0.82 P2 = 0.59 P3 = 0.67

No 90 205 165

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-23
The Marascuilo Procedure
Example
MARASCUILO TABLE
Absolute
Proportions Differences Critical Range
| Group 1 - Group 2 | 0.23 0.06831808
| Group 1 - Group 3 | 0.15 0.0664689
| Group 2 - Group 3 | 0.08 0.074485617

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. Chap 12-24
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. Chap 12-25
2 Test of Independence
The Chi-square test statistic is:

( f  f ) 2
2   o e
all cells fe
 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. Chap 12-26
Expected Cell Frequencies
 Expected cell frequencies:

row total  column total


fe 
n
Where:
row total = sum of all frequencies in the row
column total = sum of all frequencies in the column
n = overall sample size

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-27
Decision Rule

 The decision rule is

If 2 > 2U, reject H0,


otherwise, do not reject H0

Where 2U is from the chi-square distribution with


(r – 1)(c – 1) degrees of freedom

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-28
Example: Test of Independence
 The meal plan selected by 200 students is shown below:

Number of meals per week


Class
Standing 20/week 10/week none Total
Fresh. 24 32 14 70
Soph. 22 26 12 60
Junior 10 14 6 30
Senior 14 16 10 40
Total 70 88 42 200

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-29
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. Chap 12-30
Example: Test of Independence
Expected cell frequencies
if H0 is true:
Number of meals
Example for one cell: per week
Class
row total x column total Standing 20/wk 10/wk none Total
fe  Fresh. 24.5 30.8 14.7 70
n
30  70 Soph. 21.0 26.4 12.6 60
  10.5
200 Junior 10.5 13.2 6.3 30
Senior 14.0 17.6 8.4 40
Total 70 88 42 200

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-31
Example: Test of Independence

 The test statistic value is:


( fo  fe )2
  
2

all cells fe
(24  24.5) 2 (32  30.8) 2 (10  8.4) 2
    0.709
24.5 30.8 8.4

2U = 12.592 for α = .05 from the chi-square


distribution with (4 – 1)(3 – 1) = 6 degrees of
freedom

Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-32
Example: Test of
Independence
The test statistic is 2  0.709 , U2 with 6 d.f.  12.592
Decision Rule:
If 2 > 12.592, reject H0, otherwise,
do not reject H0

Here,
=0.05 2 = 0.709 < 2U = 12.592,
so do not reject H0
0 Conclusion: there is
Do not Reject H0 2 insufficient evidence that meal
reject H0
2U=12.592 plan and class standing are
related.
Statistics for Managers Using Microsoft Excel, 5e © 2008 Prentice-Hall, Inc. Chap 12-33

You might also like