Download Document

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Transcript
11--3
11
Contingency Tables
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
1
Definition
v Contingency Table (or two -way frequency table)
a table in which frequencies
correspond to two variables.
(One variable is used to categorize rows,
and a second variable is used to
categorize columns.)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
2
Definition
v Contingency Table (or two -way frequency table)
a table in which frequencies
correspond to two variables.
(One variable is used to categorize rows,
and a second variable is used to
categorize columns.)
Contingency tables have at least two
rows and at least two columns.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
3
Contingency Table
Homicide
12
Stranger
Acquaintance
or Relative
39
Robbery
Assault
379
727
106
642
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
4
Definition
v Test of Independence
tests the null hypothesis that there is
no association between the row
variable and the column variable.
(The null hypothesis is the statement
that the row and column variables are
independent.)
independent
.)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
5
Assumptions
1.
The sample data are randomly selected.
2.
The null hypothesis H0 is the statement that
the row and column variables are
independent;; the alternative hypothesis H1 is
independent
the statement that the row and variables are
dependent.
3.
For every cell in the contingency table, the
expected frequency E is at least 5.
5. (There is
no requirement that every observed
frequency must be at least 5.)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
6
Tests of Independence
H0 : The row variable is independent of the
column variable
H1 : The row variable is dependent (related to)
the column variable
This procedure cannot be used to establish a
direct causecause- and
and--effect link between variables in
question.
Dependence means only there is a relationship
between the two variables.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
7
Test of Independence
Test Statistic
X2 = Σ
(O - E) 2
E
Critical Values
1. Found in Table AA- 4 using
degrees of freedom = (r - 1)(c - 1)
r is the number of rows and c is the number of columns
2. Tests of Independence are always rightright- tailed.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
E=
8
(row total) (column total)
(grand total)
Total number of all observed frequencies
in the table
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
9
Contingency Table
Stranger
Acquaintance
or Relative
Robbery
Homicide
12
39
Assault
379
727
106
642
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
10
Expected Frequency for
Contingency Tables
E=
grand total
•
row total
grand total
•
column total
grand total
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
11
Expected Frequency for
Contingency Tables
E=
grand total
n
•
•
row total
grand total
•
column total
grand total
p
(probability of a cell)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
12
Expected Frequency for
Contingency Tables
E=
grand total
n
•
row total
grand total
•
•
column total
grand total
p
(probability of a cell)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
13
Expected Frequency for
Contingency Tables
E=
grand total
n
•
row total
grand total
•
•
column total
grand total
p
(probability of a cell)
E=
(row total) (column total)
(grand total)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
14
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Acquaintance
or Relative
Homicide
12
39
Robbery
Assault
379
727
106
642
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
15
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Acquaintance
or Relative
Homicide
12
39
Robbery
Assault
379
727
106
642
H 0: Type of crime is independent of knowing the criminal
H 1: Type of crime is dependent with knowing the criminal
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
16
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Homicide
12
Assault
Row Total
379
727
1118
787
Robbery
Acquaintance
or Relative
39
106
642
Column Total
51
485
1369
H 0: Type of crime is independent of knowing the criminal
H 1: Type of crime is dependent with knowing the criminal
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
17
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Homicide
12
Assault
Row Total
379
727
1118
Robbery
Acquaintance
or Relative
39
106
642
787
Column Total
51
485
1369
1905
H 0: Type of crime is independent of knowing the criminal
H 1: Type of crime is dependent with knowing the criminal
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
18
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Assault
Row Total
379
727
1118
Robbery
Homicide
12
Acquaintance
or Relative
39
106
642
787
Column Total
51
485
1369
1905
E = (row total) (column total)
(grand total)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
19
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Assault
Row Total
379
727
1118
Robbery
Homicide
12
(29.93)
Acquaintance
or Relative
39
106
642
787
Column Total
51
485
1369
1905
E = (row total) (column total)
(grand total)
E = (1118)(51)
= 29.93
1905
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
20
Is the type of crime independent of whether the criminal is a st ranger?
Stranger
Robbery
Homicide
12
379
(29.93)
Acquaintance
or Relative
Column Total
39
(21.07)
51
Assault
Row Total
727
1118
(284.64)
(803.43)
106
(200.36)
642
(565.57)
485
1369
787
1905
E = (row total) (column total)
(grand total)
E = (1118)(51)
= 29.93
1905
E=
(1118)(485)
1905
= 284.64
etc.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
21
Is the type of crime independent of whether the
criminal is a stranger?
X2 = Σ
(O - E ) 2
E
Homicide
Stranger
Acquaintance
or Relative
Upper left cell:
Robbery
Forgery
12
(29.93)
[ 10.741]
379
(284.64)
727
(803.43)
39
(21.07)
106
(200.36)
642
(565.57)
(O -E )2
=
E
(E)
(O - E ) 2
E
(12 -29.93)2
29.93
= 10.741
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
22
Is the type of crime independent of whether the
criminal is a stranger?
X2 = Σ
(O - E ) 2
E
Homicide
Stranger
Acquaintance
or Relative
Upper left cell:
Robbery
Forgery
12
(29.93)
[ 10.741]
379
(284.64)
[31.281]
727
(803.43)
[7.271]
39
(21.07)
[15.258]
106
(200.36)
[44.439]
642
(565.57)
[10.329]
(O -E )2
=
E
(12 -29.93)2
29.93
(E)
(O - E ) 2
E
= 10.741
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
23
Is the type of crime independent of whether the
criminal is a stranger?
X2 = Σ
(O - E ) 2
E
Homicide
Stranger
Acquaintance
or Relative
Test Statistic
Robbery
Forgery
12
(29.93)
[ 10.741]
379
(284.64)
[31.281]
727
(803.43)
[7.271]
39
(21.07)
[15.258]
106
(200.36)
[44.439]
642
(565.57)
[10.329]
(E)
(O - E ) 2
E
X2 = 10.741 + 31.281 + ... + 10.329 =
119.319
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
24
Test Statistic:
X2 = 119.319
with α = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom
Critical Value: X2 = 5.991 (from Table AA- 4)
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
Test Statistic:
25
X2 = 119.319
with α = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom
Critical Value: X2 = 5.991 (from Table AA- 4)
Fail to Reject
Independence
Reject
Independence
α
0
= 0.05
X2 = 5.991
Sample data: X2 =119.319
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
26
X2 = 119.319
with α = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom
Test Statistic:
Critical Value: X2 = 5.991 (from Table AA- 4)
Fail to Reject
Independence
Reject
Independence
α
0
X2 = 5.991
= 0.05
Reject independence
Sample data: X2 =119.319
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
27
Test Statistic:
X2 = 119.319
with α = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom
Critical Value: X2 = 5.991 (from Table AA- 4)
Fail to Reject
Independence
Reject
Independence
α
0
= 0.05
Reject independence
X2 = 5.991
Sample data: X2 =119.319
Ho : The type of crime and knowing the criminal are independent
H1 : The type of crime and knowing the criminal are dependent
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
Test Statistic:
28
X2 = 119.319
with α = 0.05 and (r -1) (c -1) = (2 -1) (3 -1) = 2 degrees of freedom
Critical Value: X2 = 5.991 (from Table AA- 4)
Fail to Reject
Independence
Reject
Independence
α
0
X2 = 5.991
= 0.05
Reject independence
Sample data: X2 =119.319
It appears that the type of crime and
knowing the criminal are related.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
29
Relationships Among Components in X2 Test
of Independence
Figure 11-8
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
30
Definition
Test of Homogeneity
tests the claim that different populations
have the same proportions of some
characteristics
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
31
Example - Test of Homogeneity
Seat Belt Use in Taxi Cabs
New York Chicago
Taxi has
Yes
usable
No
seat belt?
Pittsburgh
3
42
2
74
87
70
Claim: The 3 cities have the same proportion of taxis with usab le seat belts
H0: The 3 cities have the same proportion of taxis with usable seat
seat belts
H1: The proportion of taxis with usable seat belts is not the same
same in all 3 cities
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
32
Example - Test of Homogeneity
Seat Belt Use in Taxi Cabs
New York Chicago
Taxi has
Yes
usable
No
seat belt?
Pittsburgh
3
42
2
74
87
70
Claim: The 3 cities have the same proportion of taxis with usab le seat belts
H0: The 3 cities have the same proportion of taxis with usable seat
seat belts
H1: The proportion of taxis with usable seat belts is not the same
same in all 3 cities
Reject
homogeneity
Fail to Reject
homogeneity
α
0
= 0.05
X2 = 5.991
Sample data: X2 = 42.004
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
33
Example - Test of Homogeneity
Seat Belt Use in Taxi Cabs
New York Chicago
Taxi has
Yes
usable
No
seat belt?
Pittsburgh
3
42
2
74
87
70
Claim: The 3 cities have the same proportion of taxis with usab le seat belts
H0: The 3 cities have the same proportion of taxis with usable seat
seat belts
H1: The proportion of taxis with usable seat belts is not the same
same in all 3 cities
Reject
homogeneity
Fail to Reject
homogeneity
α
0
= 0.05
X2 = 5.991
Sample data: X2 = 42.004
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
34
Example - Test of Homogeneity
Seat Belt Use in Taxi Cabs
New York Chicago
Taxi has
Yes
usable
No
seat belt?
Pittsburgh
3
42
2
74
87
70
Claim: The 3 cities have the same proportion of taxis with usab le seat belts
H0: The 3 cities have the same proportion of taxis with usable seat
seat belts
H1: The proportion of taxis with usable seat belts is not the same
same in all 3 cities
Reject
homogeneity
Fail to Reject
homogeneity
α
0
= 0.05
There is sufficient evidence to
warrant rejection of the claim
that the 3 cities have the
same proportion of usable
seat belts in taxis; appears
from Table Chicago has a
much higher proportion.
X2 = 5.991
Sample data: X2 = 42.004
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
Triola,, Essentials of Statistics, Third Edition. Copyright 2008. Pearson
Triola
Pearson Education, Inc.
35
36