© the mcgraw-hill companies, inc., 2000 12-1 chapter 12 chi-square and analysis of variance (anova)

44
© The McGraw-Hill Companies, Inc., 2000 12-1 12-1 Chapter 12 Chapter 12 Chi-Square and Chi-Square and Analysis of Analysis of Variance (ANOVA) Variance (ANOVA)

Upload: elias-siner

Post on 31-Mar-2015

225 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-112-1

Chapter 12Chapter 12

Chi-Square and Chi-Square and Analysis of Variance Analysis of Variance

(ANOVA)(ANOVA)

Page 2: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-212-2 OutlineOutline

12-1 Introduction

12-2 Test for Goodness of Fit

12-3 Tests Using Contingency

Tables

12-4 Analysis of Variance (ANOVA)

Page 3: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-312-3 ObjectivesObjectives

Test a distribution for goodness of fit using chi-square.

Test two variables for independence using chi-square.

Test proportions for homogeneity using chi-square.

Use ANOVA technique to determine a difference among three or more means.

Page 4: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-412-4 12-2 Test for Goodness of Fit12-2 Test for Goodness of Fit

When one is testing to see whether a frequency distribution fits a specific pattern, the chi-square chi-square goodness-of-fit testgoodness-of-fit test is used.

Page 5: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-512-5

Suppose a market analyst wished to see whether consumers have any preference among five flavors of a new fruit soda. A sample of 100 people provided the following data:

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Cherry Straw-berry

Orange Lime Grape

32 28 16 14 10

Page 6: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-612-6

If there were no preference, one would expect that each flavor would be selected with equal frequency.

In this case, the equal frequency is 100/5 = 20.

That is, approximately 20 people would select each flavor.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 7: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-712-7

The frequencies obtained from the sample are called observed observed frequenciesfrequencies.

The frequencies obtained from calculations are called expected expected frequenciesfrequencies.

Table for the test is shown next.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 8: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-812-812-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit -

Example

Freq. Cherry Straw-berry

Orange Lime Grape

Observed 32 28 16 14 10

Expected 20 20 20 20 20

Page 9: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-912-9

The observed frequencies will almost always differ from the expected frequencies due to sampling error.

Question: Are these differences significant, or are they due to chance?

The chi-square goodness-of-fit test will enable one to answer this question.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 10: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1012-10

The appropriate hypotheses for this example are:

H0: Consumers show no preference for flavors of the fruit soda.

H1: Consumers show a preference. The d. f. for this test is equal to the

number of categories minus 1.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 11: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1112-1112-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit -

Formula

2

2

1

O E

E

d f number of categories

O observed frequency

E frequency

. .

expected

Page 12: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1212-12

Is there enough evidence to reject the claim that there is no preference in the selection of fruit soda flavors? Let = 0.05.

Step 1:Step 1: State the hypotheses and identify the claim.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 13: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1312-13

H0: Consumers show no preference for flavors (claim).

H1: Consumers show a preference. Step 2:Step 2: Find the critical value. The d. f.

are 5 – 1 = 4 and = 0.05. Hence, the critical value = 9.488.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 14: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1412-14

Step 3:Step 3: Compute the test value. = (32 – 20)2/20 + (28 is – 20)2/20 + … + (10 – 20)2/20 = 18.0.

Step 4:Step 4:Make the decision. The decision is to reject the null hypothesis, since 18.0 > 9.488.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 15: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1512-15

Step 5:Step 5: Summarize the results. There is enough evidence to reject the claim that consumers show no preference for the flavors.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 16: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1612-1612-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit -

Example

9.488

Page 17: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1712-17

The advisor of an ecology club at a large 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 advisor’s conjecture.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 18: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1812-18

Step 1:Step 1: State the hypotheses and identify the claim.

H0: The club consists of 10% freshmen, 20% sophomores, 40% juniors,

and 30% seniors (claim) H1: The distribution is not the same as

stated in the null hypothesis.

12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

Page 19: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-1912-19

Step 2:Step 2: Find the critical value. The d. f. are 4 – 1 = 3 and = 0.10. Hence, the critical value = 6.251.

Step 3:Step 3: Compute the test value. = (14 – 10)2/10 + (19 – 20)2/20 + … + (16 – 30)2/30 = 11.208.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 20: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2012-20

Step 4:Step 4:Make the decision. The decision is to reject the null hypothesis, since 11.208 > 6.251.

Step 5:Step 5: Summarize the results. There is enough evidence to reject the advisor’s claim.

12-2 Test for Goodness of Fit -12-2 Test for Goodness of Fit - Example

Page 21: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2112-21

When data can be tabulated in table form in terms of frequencies, several types of hypotheses can be tested using the chi-square test.

Two such tests are the independence of independence of variablesvariables test and the homogeneity of homogeneity of proportionsproportions test.

12-3 Tests Using Contingency Tables12-3 Tests Using Contingency Tables

Page 22: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2212-22

The test of independence of variablestest of independence of variables is used to determine whether two variables are independent when a single sample is selected.

The test of homogeneity of proportionstest of homogeneity of proportions is used to determine whether the proportions for a variable are equal when several samples are selected from different populations.

12-3 Tests Using Contingency Tables12-3 Tests Using Contingency Tables

Page 23: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2312-23

Suppose a new postoperative procedure is administered to a number of patients in a large hospital.

Question:Question: Do the doctors feel differently about this procedure from the nurses, or do they feel basically the same way?

Data is on the next slide.

12-3 Test for Independence - 12-3 Test for Independence - Example

Page 24: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2412-2412-3 Test for Independence -12-3 Test for Independence -

Example

Group Prefernew

procedure

Preferold

procedure

Nopreference

Nurses 100 80 20

Doctors 50 120 30

Group Prefernew

procedure

Preferold

procedure

Nopreference

Nurses 100 80 20

Doctors 50 120 30

Page 25: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2512-25

The null and the alternative hypotheses are as follows:

H0: The opinion about the procedure is independentindependent of the profession.

H1: The opinion about the procedure is dependentdependent on the profession.

12-3 Test for Independence - 12-3 Test for Independence - Example

Page 26: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2612-26

If the null hypothesis is not rejected, the test means that both professions feel basically the same way about the procedure, and the differences are due to chance.

If the null hypothesis is rejected, the test means that one group feels differently about the procedure from the other.

12-3 Test for Independence -12-3 Test for Independence - Example

Page 27: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2712-27

Note: The rejection of the null hypothesis does not mean that one group favors the procedure and the other does not.

The test value is the 2 value (same as the goodness-of-fit test value).

The expected values are computed from: (row sum)(column sum)/(grand total).

12-3 Test for Independence - 12-3 Test for Independence - Example

Page 28: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2812-2812-3 Test for Independence - 12-3 Test for Independence -

Example

Page 29: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-2912-29

From the MINITAB output, the P-value = 0. Hence, the null hypothesis will be rejected.

If the critical value approach is used, the degrees of freedom for the chi-square critical value will be (number of columns –1)(number of rows – 1).

d.f. = (3 –1)(2 – 1) = 2.

12-3 Test for Independence -12-3 Test for Independence - Example

Page 30: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3012-30

Here, samples are selected from several different populations and one is interested in determining whether the proportions of elements that have a common characteristic are the same for each population.

12-3 Test for Homogeneity of 12-3 Test for Homogeneity of Proportions Proportions

Page 31: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3112-31

The sample sizes are specified in advance, making either the row totals or column totals in the contingency table known before the samples are selected.

The hypotheses will be: H0: p1 = p2 = … = pk H1: At least one proportion is different from the others.

12-3 Test for Homogeneity of 12-3 Test for Homogeneity of Proportions Proportions

Page 32: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3212-32

The computations for this test are the same as that for the test of independence.

12-3 Test for Homogeneity of 12-3 Test for Homogeneity of Proportions Proportions

Page 33: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3312-3312-4 Analysis of Variance (ANOVA)12-4 Analysis of Variance (ANOVA)

When an F test is used to test a hypothesis concerning the means of three or more populations, the technique is called analysis of variance analysis of variance (ANOVA)(ANOVA).

Page 34: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3412-3412-4 Assumptions for the 12-4 Assumptions for the FF Test for Test for Comparing Three or More MeansComparing Three or More Means

The populations from which the samples were obtained must be normally or approximately normally distributed.

The samples must be independent of each other.

The variances of the populations must be equal.

Page 35: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3512-35

Although means are being compared in this F test, variances are used in the test instead of the means.

Two different estimates of the population variance are made.

12-4 Analysis of Variance12-4 Analysis of Variance

Page 36: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3612-36

Between-group varianceBetween-group variance - this involves computing the variance by using the means of the groups or between the groups.

Within-group varianceWithin-group variance - this involves computing the variance by using all the data and is not affected by differences in the means.

12-4 Analysis of Variance12-4 Analysis of Variance

Page 37: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3712-37

The following hypotheses should be used when testing for the difference between three or more means.

H0: = = … = k

H1: At least one mean is different from the others.

12-4 Analysis of Variance12-4 Analysis of Variance

Page 38: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3812-38

d.f.N. = k – 1, where k is the number of groups.

d.f.D. = N – k, where N is the sum of the sample sizes of the groups.

Note: The formulas for this test are tedious to work through, so examples will be done in MINITAB. See text for formulas.

12-4 Analysis of Variance12-4 Analysis of Variance

Page 39: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-3912-39

A marketing specialist wishes to see whether there is a difference in the average time a customer has to wait in a checkout line in three large self-service department stores. The times (in minutes) are shown on the next slide.

Is there a significant difference in the mean waiting times of customers for each store using = 0.05?

12-4 Analysis of Variance12-4 Analysis of Variance --Example

Page 40: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-4012-40

Store A Store B Store C

3 5 1

2 8 3

5 9 4

6 6 2

3 2 7

1 5 3

Store A Store B Store C

3 5 1

2 8 3

5 9 4

6 6 2

3 2 7

1 5 3

12-4 Analysis of Variance12-4 Analysis of Variance --Example

Page 41: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-4112-41

Step 1:Step 1: State the hypotheses and identify the claim.

H0: = H1: At least one mean is different from the others (claim).

12-4 Analysis of Variance12-4 Analysis of Variance --Example

Page 42: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-4212-42

Step 2:Step 2: Find the critical value. Since k = 3, N = 18, and = 0.05, d.f.N. = k – 1 = 3 – 1= 2, d.f.D. = N – k = 18 – 3 = 15. The critical value is 3.68.

Step 3:Step 3: Compute the test value. From the MINITAB output, F = 2.70. (See your text for computations).

12-4 Analysis of Variance12-4 Analysis of Variance --Example

Page 43: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-4312-43

Step 4:Step 4: Make a decision. Since 2.70 < 3.68, the decision is not to reject the null hypothesis.

Step 5:Step 5: Summarize the results. There is not enough evidence to support the claim that there is a difference among the means. The ANOVA summary table is given on the next slide.

12-4 Analysis of Variance12-4 Analysis of Variance --Example

Page 44: © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square and Analysis of Variance (ANOVA)

© The McGraw-Hill Companies, Inc., 2000

12-4412-44 12-4 Analysis of Variance12-4 Analysis of Variance --Example