# © The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square.

## Presentation on theme: "© The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square."— Presentation transcript:

© The McGraw-Hill Companies, Inc., 2000 12-1 Chapter 12 Chi-Square

© The McGraw-Hill Companies, Inc., 2000 12-2 Outline 12-1 Introduction 12-2 Test for Goodness of Fit 12-3 Tests Using Contingency Tables

© The McGraw-Hill Companies, Inc., 2000 12-3 Objectives Test a distribution for goodness of fit using chi-square. Test two variables for independence using chi-square.

© The McGraw-Hill Companies, Inc., 2000 12-4 12-2 Test for Goodness of Fit chi-square goodness-of-fit test When one is testing to see whether a frequency distribution fits a specific pattern, the chi-square goodness-of-fit test is used.

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-7 observed frequencies The frequencies obtained from the sample are called observed frequencies. expected frequencies The frequencies obtained from calculations are called expected frequencies. Table for the test is shown next. 12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

© The McGraw-Hill Companies, Inc., 2000 12-8 12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-10 The appropriate hypotheses for this example are: H 0 : Consumers show no preference for flavors of the fruit soda. H 1 : 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

© The McGraw-Hill Companies, Inc., 2000 12-11 12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Formula    2 2 1       OE E dfnumberofcategories Oobservedfrequency E.. expected

© The McGraw-Hill Companies, Inc., 2000 12-12 Is there enough evidence to reject the claim that there is no preference in the selection of fruit soda flavours? 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

© The McGraw-Hill Companies, Inc., 2000 12-13 H 0 : Consumers show no preference for flavours (claim). H 1 : 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

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-15 Step 5: Step 5: Summarize the results. There is enough evidence to reject the claim that consumers show no preference for the flavours. 12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example

© The McGraw-Hill Companies, Inc., 2000 12-16 12-2 Test for Goodness of Fit - 12-2 Test for Goodness of Fit - Example 9.488 

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-18 Step 1: Step 1: State the hypotheses and identify the claim. H 0 : The club consists of 10% freshmen, 20% sophomores, 40% juniors, and 30% seniors (claim) H 1 : 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

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-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. independence of variableshomogeneity of proportions Two such tests are the independence of variables test and the homogeneity of proportions test. 12-3 Tests Using Contingency Tables

© The McGraw-Hill Companies, Inc., 2000 12-22 test of independence of variables The test of independence of variables is used to determine whether two variables are independent when a single sample is selected. 12-3 Tests Using Contingency Tables

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-24 12-3 Test for Independence - 12-3 Test for Independence - Example

© The McGraw-Hill Companies, Inc., 2000 12-25 The null and the alternative hypotheses are as follows: independent H 0 : The opinion about the procedure is independent of the profession. dependent H 1 : The opinion about the procedure is dependent on the profession. 12-3 Test for Independence - 12-3 Test for Independence - Example

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-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

© The McGraw-Hill Companies, Inc., 2000 12-28 12-3 Test for Independence - 12-3 Test for Independence - Example

© The McGraw-Hill Companies, Inc., 2000 12-29 From the MINITAB output, the P-value = 0.000. Hence, the null hypothesis will be rejected (P<0.0005). 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