You are on page 1of 29

Contingency Tables:

Independence and Homogeneity

1
Definition
 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.)

2
Definition
 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.
3
Definition
 Test of Independence
tests the null hypothesis that the row
variable and column variable in a
contingency table are not related.

(The null hypothesis is the


statement that the row and
column variables are independent.)

4
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 the statement that the row and
column variables are dependent.

3. For every cell in the contingency table, the


expected frequency E is at least 5. (There is
no requirement that every observed
frequency must be at least 5.)
5
Test of Independence
Test Statistic

X =Σ
2 (O - E)2
E

Critical Values
1. Found in Table A-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 right-tailed.

6
(row total) (column total)
E= (grand total)

Total number of all observed frequencies


in the table

7
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 cause-and-effect link between variables in
question.

Dependence means only there is a relationship


between the two variables.

8
Expected Frequency for
Contingency Tables

9
Expected Frequency for
Contingency Tables

grand total row total column total


E= • grand total
• grand total

10
Expected Frequency for
Contingency Tables

grand total row total column total


E= • grand total
• grand total

n • p
(probability of a cell)

11
Expected Frequency for
Contingency Tables

grand total row total column total


E= • grand total
• grand total

n • p
(probability of a cell)

12
Expected Frequency for
Contingency Tables

grand total row total column total


E= • grand total
• grand total

n • p
(probability of a cell)

(row total) (column total)


E=
(grand total)

13
Is the type of crime independent of whether the
criminal is a stranger?
Homicide Robbery Assault
12 379 727
Stranger

Acquaintance 39 106 642


or Relative

14
Is the type of crime independent of whether the
criminal is a stranger?
Homicide Robbery Assault Row Total
12 379 727 1118
Stranger

Acquaintance 39 106 642 787


or Relative

Column Total 51 485 1369 1905

15
Is the type of crime independent of whether the
criminal is a stranger?
Homicide Robbery Assault Row Total
12 379 727 1118
Stranger

Acquaintance 39 106 642 787


or Relative

Column Total 51 485 1369 1905

(row total) (column total)


E=
(grand total)

16
Is the type of crime independent of whether the
criminal is a stranger?
Homicide Robbery Assault Row Total
12 379 727 1118
Stranger
(29.93)
Acquaintance 39 106 642 787
or Relative

Column Total 51 485 1369 1905

(row total) (column total)


E=
(grand total)

(1118)(51)
E= 1905
= 29.93

17
Is the type of crime independent of whether the
criminal is a stranger?
Homicide Robbery Assault Row Total
12 379 727 1118
Stranger
(29.93) (284.64) (803.43)
Acquaintance 39 106 642 787
or Relative (21.07) (200.36) (565.57)

Column Total 51 485 1369 1905

(row total) (column total)


E=
(grand total)

(1118)(51) (1118)(485)
E= = 29.93 E= 1905
= 284.64
1905
etc.
18
Is the type of crime independent of whether the
criminal is a stranger?

X =Σ
2 (O - E )2
E

Homicide Robbery Forgery


(E)
12 379 727
(29.93) (284.64) (803.43) (O - E )2
Stranger
[10.741] E
39 106 642
Acquaintance (21.07) (200.36) (565.57
or Relative

(O -E )2 (12 -29.93)2
Upper left cell: = = 10.741
E 29.93

19
Is the type of crime independent of whether the
criminal is a stranger?

X =Σ
2 (O - E )2
E

Homicide Robbery Forgery


(E)
12 379 727
(29.93) (284.64) (803.43) (O - E )2
Stranger [31.281] [7.271]
[10.741] E
39 106 642
Acquaintance (21.07) (200.36) (565.57)
or Relative [15.258] [44.439] [10.329]

(O -E )2 (12 -29.93)2
Upper left cell: = = 10.741
E 29.93

20
Is the type of crime independent of whether the
criminal is a stranger?

X =Σ
2 (O - E )2
E

Homicide Robbery Forgery


(E)
12 379 727
(29.93) (284.64) (803.43) (O - E )2
Stranger [31.281] [7.271]
[10.741] E
39 106 642
Acquaintance (21.07) (200.36) (565.57)
or Relative [15.258] [44.439] [10.329]

Test Statistic X2 = 10.741 + 31.281 + ... + 10.329 =


119.319
21
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 A-4)

22
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 A-4)

Fail to Reject Reject


Independence Independence

α = 0.05
0 X2 = 5.991
Sample data: X2 =119.319

23
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 A-4)

Fail to Reject Reject


Independence Independence

α = 0.05
0
Reject independence
X2 = 5.991
Sample data: X2 =119.319

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 A-4)

Fail to Reject Reject


Independence Independence

α = 0.05
0
Reject independence
X2 = 5.991
Sample data: X2 =119.319

Claim: The type of crime and knowledge of criminal are independent


Ho : The type of crime and knowledge of criminal are independent
H1 : The type of crime and knowledge of criminal are dependent

25
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 A-4)

Fail to Reject Reject


Independence Independence

α = 0.05
0
Reject independence
X2 = 5.991
Sample data: X2 =119.319

It appears that the type of crime and


knowledge of the criminal are related.
26
Relationships Among Components in X2 Test
of Independence

Figure 10-8

27
Definition
 Test of Homogeneity
test the claim that different populations
have the same proportions of some
characteristics

28
How to distinguish between a
test of homogeneity and a
test for independence:

Were predetermined sample sizes


used for different populations (test of
homogeneity), or was one big sample
drawn so both row and column totals
were determined randomly (test of
independence)?
29

You might also like