Chi-square test of independence - cba.edu.k · proportion of left-handed people overall H 0: ......

Post on 16-May-2018

215 views 1 download

Transcript of Chi-square test of independence - cba.edu.k · proportion of left-handed people overall H 0: ......

Business Statistics

Department of Quantitative Methods & Information Systems

Dr. Mohammad Zainal QMIS 220

Chapter 12

Chi-square test of independence

Chapter Goals

After completing this chapter, you should be able

to:

Set up a contingency analysis table and perform a chi-

square test of independence

Contingency Tables

Contingency Tables

Situations involving multiple population

proportions

Used to classify sample observations according

to two or more characteristics

Also called a crosstabulation table.

Male Female

Smoke 150 20 170

Don’t Smoke 70 160 230

220 180 400

Contingency Tables

It can be of any size: 2x3, 3x2, 3x3, or 4x2

The first digit refers to the number of rows, and

the second refers to the number of columns.

In general, R × C table contains R rows and C

columns.

The number of cells in a contingency table is

obtained by multiplying the number of rows by

the number of columns.

Contingency Tables

We may want to know if there is an association

between being a male or female and smoking

or not.

The null hypothesis that the two characteristics

of the elements of a given population are not

related (independent)

Against the alternative hypothesis that the two

characteristics are related (dependent).

Degrees of freedom for the test are:

df = (R-1)(C-1)

Contingency Table Example

H0: Hand preference is independent of gender

HA: Hand preference is not independent of gender

Left-Handed vs. Gender

Dominant Hand: Left vs. Right

Gender: Male vs. Female

Contingency Table Example

Sample results organized in a contingency table:

(continued)

Gender

Hand Preference

Left Right

Female 12 108 120

Male 24 156 180

36 264 300

120 Females, 12

were left handed

180 Males, 24 were

left handed

sample size = n = 300:

Logic of the Test

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

H0: Hand preference is independent of gender

HA: Hand preference is not independent of gender

Finding Expected Frequencies

Overall:

P(Left Handed)

= 36/300 = .12

120 Females, 12

were left handed

180 Males, 24 were

left handed

If independent, then

P(Left Handed | Female) = P(Left Handed | Male) = .12

So we would expect 12% of the 120 females and 12% of the 180

males to be left handed…

i.e., we would expect (120)(.12) = 14.4 females to be left handed

(180)(.12) = 21.6 males to be left handed

Expected Cell Frequencies

Expected cell frequencies:

(continued)

size sample Total

total) Column jtotal)(Row i(e

thth

ij

4.14300

)36)(120(e11

Example:

Observed vs. Expected Frequencies

Observed frequencies vs. expected frequencies:

Gender

Hand Preference

Left Right

Female Observed = 12

Expected = 14.4

Observed = 108

Expected = 105.6 120

Male Observed = 24

Expected = 21.6

Observed = 156

Expected = 158.4 180

36 264 300

The Chi-Square Test Statistic

where:

oij = observed frequency in cell (i, j)

eij = expected frequency in cell (i, j)

r = number of rows

c = number of columns

r

1i

c

1j ij

2

ijij2

e

)eo(

The Chi-square contingency test statistic is:

)1c)(1r(.f.d with

Observed vs. Expected Frequencies

Gender

Hand Preference

Left Right

Female Observed = 12

Expected = 14.4

Observed = 108

Expected = 105.6 120

Male Observed = 24

Expected = 21.6

Observed = 156

Expected = 158.4 180

36 264 300

6848.04.158

)4.158156(

6.21

)6.2124(

6.105

)6.105108(

4.14

)4.1412( 22222

Contingency Analysis

2 2.05 = 3.841

Reject H0

= 0.05

Decision Rule:

If 2 > 3.841, reject H0,

otherwise, do not reject H0

1(1)(1)1)-1)(c-(r d.f. with6848.02

Do not reject H0

Here, 2 = 0.6848

< 3.841, so we

do not reject H0

and conclude that

gender and hand

preference are

independent

Problem

QMIS 220, by Dr. M. Zainal

A random sample of 300 adults was selected, and they were

asked if they favor giving more freedom to schoolteachers to

punish students for violence and lack of discipline. Based on

the results of the survey, the two-way classification of the

responses of these adults is presented in the following table

In Favor

(F)

Against

(A)

No Opinion

(N)

Men (M) 93 70 12

Women (W) 87 32 6

QMIS 220, by Dr. M. Zainal

Step 1. State the null and alternative hypotheses

Step 2. Select the distribution to use.

QMIS 220, by Dr. M. Zainal

Step 3. Determine the rejection and nonrejection regions.

In Favor (F) Against (A) No Opinion(N) Row total

Men (M)

Women (W)

Column Total

QMIS 220, by Dr. M. Zainal

Step 4. Calculate the value of the test statistic.

Step 5. Make a decision.

Chapter Summary

Set up a contingency analysis table and perform

a chi-square test of independence

Problems

QMIS 220, by Dr. M. Zainal

A random sample of 300 adults was selected, and they were

asked if they favor giving more freedom to schoolteachers to

punish students for violence and lack of discipline. Based on

the results of the survey, the two-way classification of the

responses of these adults is presented in the following table

In Favor

(F)

Against

(A)

No Opinion

(N)

Men (M) 93 70 12

Women (W) 87 32 6

QMIS 220, by Dr. M. Zainal

Step 1. State the null and alternative hypotheses

Step 2. Select the distribution to use.

QMIS 220, by Dr. M. Zainal

Step 3. Determine the rejection and nonrejection regions.

In Favor (F) Against (A) No Opinion(N) Row total

Men (M)

Women (W)

Column Total

QMIS 220, by Dr. M. Zainal

Step 4. Calculate the value of the test statistic.

Step 5. Make a decision.

Copyright

The materials of this presentation were mostly

taken from the PowerPoint files accompanied

Business Statistics: A Decision-Making Approach,

7e © 2008 Prentice-Hall, Inc.

QMIS 220, by Dr. M. Zainal Chap 10-26