Top Banner
GOODNESS OF FIT TEST & CONTINGENCY TABLE CHAPTER 6 BCT2053
24

GOODNESS OF FIT TEST & CONTINGENCY TABLE

Feb 23, 2016

Download

Documents

deiter

CHAPTER 6 BCT2053. GOODNESS OF FIT TEST & CONTINGENCY TABLE. 6.1 Introduction 6.2 Goodness of Fit Test 6.3 Contingency Table. Contents. Define the main situations when a chi-square distribution and significance test is used. 6.1 Introduction. Lesson outcomes: - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

GOODNESS OF FIT TEST &

CONTINGENCY TABLE

CHAPTER 6BCT2053

Page 2: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

6.1 Introduction

6.2 Goodness of Fit Test

6.3 Contingency Table

Contents

Page 3: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Define the main situations when a chi-square distribution and significance test is used.

Lesson outcomes:By the end of this topic you should be able to:

6.1 Introduction

Page 4: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

When to use Chi-Square Distribution 1. Find confidence Interval for a variance or

standard deviation

2. Test a hypothesis about a single variance or standard deviation

3. Tests concerning frequency distributions (Goodness of Fit)

4. Test the Independence of two variables (Contingency Table)

5. Test the homogeneity of proportions (Contingency Table)

Page 5: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Test a distribution for goodness of fit using Chi-square

Lesson outcomes:By the end of this topic you should be able to:

6.2 Goodness of Fit Test

Page 6: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

When to use Chi-Square Goodness of fit test

When you have some practical data and you want to know how well a particular statistical distribution, such as binomial or normal, models the data.

Example:To meet customer demands, a manufacturer of running shoes may wish to see whether buyers show a preference for a specific style. If there were no preference, one would expect each style to be selected with equal frequency.

Page 7: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Hypothesis Null and Alternative1. H0 : There is No difference or no

change Example: Buyers show no preference

for a specific style.

2. H1 : There is a difference or change Example: Buyers show a preference for

a specific style.

Page 8: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Formula and Assumptions

Formula

Where O = observed frequency E = expected frequency (equal

frequency = 1/category) With degree of freedom equal to the number of

categories minus 1

Assumptions1. The data are obtained from a random sample2. The expected frequency for each category must be

5 or more

22test

O EE

Page 9: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Procedure

1. State the hypothesis and identify the claim,

2. Compute the test value.

3. Find the critical value. The test is always right-tailed since O – E are square and always positive.

4. Make the decision – reject Ho if

5. Summarize the result.

2 2, 1test Category

22test

O EE

Page 10: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Why this test is called goodness of fit

If the graph between observed values and expected values is fitted, one can see whether the values are close together or far apart.

When observed values and expected values are close together: the chi-square test value will be small. Decision must be not reject Ho (accept Ho). Hence there is a “good fit”.

When observed values and expected values are far apart: the chi-square test value will be large. Decision must be reject Ho (accept H1). Hence there is a “not a good fit”.

Page 11: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 1 : goodness of fit test A market analyst whished to see whether

consumers have any preference among five flavors of a new fruit soda. A sample of 100 people provided these data.

Is there enough evidence to reject the claim that there is no preference in the selection of fruit soda flavors at 0.05 significance level?

Cherry

Strawberry

Orange

Lime Grape

32 28 16 14 10

Page 12: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Another Applications

1. H0 is that the particular distributions does provide a model for the data.

Example: state the claim distribution

2. H1 is that it does not. Example: The distribution is not same

as stated in the null hypothesisExpected value (E) = given percentage × sample size

Page 13: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 2 : goodness of fit test The adviser of an ecology club at a college

believes that the group consists of 10% freshmen, 20% sophomores, 40% juniors, and 30% seniors.

The membership for the club this year consisted of 14 freshmen, 19 sophomores, 51 juniors, and 16 seniors.

At α = 0. 10, test the adviser’s conjecture.

Page 14: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 3 : goodness of fit test According to a particular genetic theory,

the colour of strains (pink, white and blue) in a certain flower should appear in the ratio 3:2:5.

In 200 randomly chosen plants, the corresponding numbers of each colour were 48, 28 and 124.

Test at the 1% significance level, whether the theory is true.

Page 15: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

EXCEL application Insert – functions - CHITEST

P-value

Reject H0 if P-value ≤ α

Page 16: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Test two variables for independence using Chi-squareTest proportions for homogeneity using Chi-square

Lesson outcomes:By the end of this topic you should be able to:

6.3 Contingency Table

Page 17: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

The Chi-Square Independence Test To test the independence of two tests H0 : The tests are independent (x has no relationship with y) H1 : The tests are not independent (x has relationship with y) Reject H0 if

where and

2 2,( 1)( 1)test I J

22 ij ijtest

ij

n E

E

. .

..

i jij

n nE

n

I = ROW (x)J =COLUMN (y)

Row sum

Column sum

Observed values Expected values

Grand total

Page 18: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 4: Chi-Square Independence Test The data below shows the number of insomnia

patient according to their smoking habit in Malaysia.

At α = 0.01, Can we say that insomnia is independent with smoking habit?

Habit

Smoking Not smoking

Insomnia 20 40

Not insomnia 10 80

Page 19: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 5: Chi-Square Independence Test

A researcher wishes to see if the way of people obtain information is not related with their educational background. A survey of 400 high school and college graduates yielded the following information.

At α = 0.05, can the researcher conclude that the way people obtain information is not related with their educational background?

Television Newspaper Other sources

High School 159 90 51

College 27 42 31

Page 20: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 6 : Chi-Square Independence Test

A sociologist wishes to see whether the number of years of college a person has completed is related to his or her place of residence. A sample of 88 people is selected and classified as shown. At 0.05 significance level, can the sociologist conclude that the years of college education are dependent on the person’s location?Location No

college4 year degree

Advanced degree

Urban 15 12 8Suburban 8 15 9Rural 6 8 7

Page 21: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Test for Homogeneity of Proportions Samples are selected from several different

populations and the researcher is interested in determining whether the proportions of elements that have a common characteristics are the same for each population.

H0 : H1 : At least one proportion is different from the

others

Reject H0 if

where and

2 2,( 1)( 1)test I J

22 ij ijtest

ij

n E

E

. .

..

i jij

n nE

n

1 2p p

Page 22: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

Example 7 : Homogeneity Test for Proportions

A researcher selected a sample of 50 seniors from each of three area high schools and asked each senior, “ Do you drive to school in a car owned by either you or your parent?”. The data are shown in the table.

At 0.05 , test the claim that the proportion of students who drive their own or their parents’ car is the same at all three schools.

SCHOOL 1 SCHOOL 2 SCHOOL 3Yes 18 22 16No 32 28 34

Page 23: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

SUMMARY Three uses of the Chi-Square distribution

were explained in this chapter:1. Test a distribution for goodness of fit

using Chi-square2. Test two variables for independence

using Chi-square3. Test proportions for homogeneity using

Chi-square

The test is always a right tailed test:

Page 24: GOODNESS OF FIT TEST  & CONTINGENCY TABLE

THE END