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

Outline

Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Chapter 13 - Lecture 1
Two-way contingency Tables

Andreas Artemiou

April 26th, 2010

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Introduction
Review

Test for independence of two categorical variables


Hypothesis testing

Test for homogeneity of proportions

Exercises

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables Review
Test for homogeneity of proportions
Exercises

Review

I In Chapter 9 we have seen how to make tests for one


population mean and one population proportion.
I In Chapter 10 we have seen how to make tests for two
population means and two population proportions.
I In Chapter 11 we have seen how to make tests for many
population means
I In Chapter 12 we have seen how to test for the relationship
between two continuous variables
I What comes next?

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables Hypothesis testing
Test for homogeneity of proportions
Exercises

Notation

I I the number of categories of variable 1, and J the number of


categories of variable 2
I k = IJ is the number of cells on the Table
I Oi the number of observed counts in the i th cell, Ei the
number of expected counts in the i th
I Note: The Ei for each cell is calculated using
rowtotal columntotal
grandtotal

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables Hypothesis testing
Test for homogeneity of proportions
Exercises

Hypothesis test
I Null Hypothesis: H0 : Variable 1 and Variable 2 are
independent
I Alternative Hypothesis: HA : not H0
k
X (Oi Ei )2
I Test statistic: 2 =
Ei
i=1
I Rejection Region: 2 2,(I 1)(J1)
I The conditions so that the test is valid, is to ensure that in
every cell Ei 5.
I If this is not true then we can merge cells together.
I To calculate the test statistic you need to construct two
Tables. The Table of observed counts and the Table of
Expected counts
Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables
Outline
Introduction
Test for independence of two categorical variables Hypothesis testing
Test for homogeneity of proportions
Exercises

Construction of test for independence through an example

I We are interested to see if a students success in Stat 200


depends on the college year they take Stat 200. I asked 300
students that have taken Stat 200 to tell me when they took
Stat 200 and if they passed or failed the class. 60 of them
took it in their freshman year and 40 passed it. 120 of them
took it as sophomores and 90 passed it. 90 took it as juniors
and 70 passed it and finally out of those who took it as seniors
only 10 passed it. Make the test at significance level 0.05.

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Test for Homogeneity of proportions

I Suppose that we have I populations that are divided to J


categories.
I We are interested to see if every category is homegeneously
represented among all the populations, that is, the proportion
of individuals in category j is the same for each population,
and that is true for every category.
I For example we ask the students in PSU what color they like
the most among the three: black, yellow, green. The students
are divided into 5 populations. Freshmen, Sophomores,
Juniors, Seniors, Graduates. The test for homogeneity implies
what?

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Hypothesis test

I Null Hypothesis: H0 : p1j = p2j = . . . = pIj, j = 1, 2, . . . , J


I Alternative Hypothesis: HA : not H0
k
X (Oi Ei )2
I Test statistic: 2 =
Ei
i=1
I Rejection Region: 2
2,(I 1)(J1)
I The conditions so that the test is valid, is to ensure that in
every cell Ei 5.
I If this is not true then we can merge cells together.
I To calculate the test statistic you need to construct two
Tables. The Table of observed counts and the Table of
Expected counts
Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables
Outline
Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Construction of test for homogeneity using an example

I We ask 1000 students in PSU what color they like the most
among the three: black, yellow, green. The students are
divided into 5 populations. Freshmen, Sophomores, Juniors,
Seniors, Graduates. Freshem answered 150, 80, 20.
Sophomores answered 130, 60, 60. Juniors answered 100, 70,
30. Seniors answered 100, 40, 60 and Graduates answered,
30, 40, 30. Are the 5 populations Homogeneous in terms of
color preference at significance level 0.01?

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables


Outline
Introduction
Test for independence of two categorical variables
Test for homogeneity of proportions
Exercises

Exercises

I Section 13.3 page 737


I Exercises 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 35.

Andreas Artemiou Chapter 13 - Lecture 1 Two-way contingency Tables

You might also like