Introduction to Chi Square The formula χ 2 = Σ = O = E = Degrees of freedom Chi Square Table P = 0.05 P = 0.01 P = 0.001 1 3.84 6.64 10.83 2 5.99 9.21 13.82 3 7.82 11.35 16.27 4 9.49 13.28 18.47 5 11.07 15.09 20.52 How many degrees of freedom? Tossing a normal coin? Rolling a single die? A red crayon out of a pack of 28? Tongue rolling male crossed with non-roller? Smooth, green pea crossed with wrinkled, yellow?
Sample Problem # 1: 2 If a coin is tossed 10 times, how many times would you expect the coin to land on tails? How many times would you expect the coin to land on heads? Null hypothesis: Heads and tails equal. Alternate hypothesis: Heads and tails not equal. When I tossed my quarter 10 times it landed 8 times on heads and two times on tails. Is there something wrong with my coin? We can use Chi Square to determine whether or not the results are reasonable based on our expectations. Heads Tails Σ heads and tails O-E O-E 2 O-E 2 /E According to the Chi Square Table is the null hypothesis accepted or rejected? Problem # 2: If a die is tossed 10 times, how many times would you expect the coin to land on two? Null Hypothesis: Alternate Hypothesis: Roll a die 10 times and record your results in table. Then calculate the Chi Square value for your results. One Two Three Four Five Six Σ of all sides O-E O-E 2 O-E 2 /E Chi Square Value Acceptable or Unacceptable?
3 Practice Chi Square Problem: In consumer marketing, a common problem that any marketing manager faces is the selection of appropriate colors for package design. Assume that a marketing manager wishes to compare five different colors of package design. He is interested in knowing which of the five is most preferred so that it can be introduced in the market. A random sample of 400 consumers reveals the following: Package Color Preference by Consumers Red 70 Blue 106 Green 80 Pink 70 Orange 74 Total 400 Do the consumer preferences for package colors show any significant difference? Use Chi Square to support your answer. Null Hypothesis: All colors are equally preferred. Alternative Hypothesis: They are not equally preferred. Package Color (O) (E) Red 70 Blue 106 Green 80 Pink 70 Orange 74 Total 400
4 Solution: If you look at the data, you may be tempted to infer that Blue is the most preferred color. Statistically, you have to find out whether this preference could have arisen due to chance. The appropriate test statistic is the χ 2 test of goodness of fit. Null Hypothesis: All colors are equally preferred. Alternative Hypothesis: They are not equally preferred Package Color (O) (E) Red 70 80 100 1.250 Blue 106 80 676 8.450 Green 80 80 0 0.000 Pink 70 80 100 1.250 Orange 74 80 36 0.450 Total 400 400 11.400 Please note that under the null hypothesis of equal preference for all colors being true, the expected frequencies for all the colors will be equal to 80. Applying the formula, we get the computed value of chi-square ( χ 2 ) = 11.400 The critical value of 2 χ at 5% level of significance for 4 degrees of freedom is 9.488. So, the null hypothesis is rejected. The inference is that all colors are not equally preferred by the consumers. In particular, Blue is the most preferred one. The marketing manager can introduce blue color package in the market.. Source of sample: Glimpses into Application of Chi-Square Tests in Marketing By P.K. Viswanathan
Chi Square Modeling Using M & M s Candies 5 Introduction: The Chi Square test (X 2 ) is often used in science to test if data you observe from an experiment is the same as the data that you would predict from the experiment. This investigation will help you to use the Chi Square test by allowing you to practice it with a population of familiar objects, M & M candies. Procedure 1. Place the contents of a 1 lb. Bag of candies in a large dish or finger bowl. Record the different Colors (classes) in Table 1 and in Table 2. 2. Without counting, estimate the number (percentage out of 100%) of the different colors of each color of the candies. Record the estimates in Table 1 under Percentage. Table 1 Color of Candy Number (o) Percentage Number (e) (Total number of all pieces of candy X Percentage ) Total # candies = 3. In the space below, write a null hypothesis, which predicts the percentage of the different colors of candies. 4. Count the number of each color of candy and record the number in Table 1 under Number. 5. Calculate the number of each color expected in Table 1 and record under Number. HINT: You must count all the colors and add the total number of M & M s before you can calculate the number expected of each color. 6. Record the numbers expected, and the numbers observed in Table 2. 7. Complete the calculations and determine the Chi Square value.
6 Table 2 Classes o-e (o-e) 2 (o-e) 2 (Colors) (e) (o) e Degrees of freedom = (number of classes 1) = Analysis Questions: 1. What is the X 2 value for your data? 2. What is the critical value (p = 0.05) for your data? 3. Is your null hypothesis accepted or rejected? Explain why or why not. 4. If the null hypothesis is rejected, propose an alternate and recalculate the X 2 value.
7 Teacher Tips: 1. I buy the small, individual bags of M & M s for each student and then they count their own and add data to a partner s data. You can also add all the numbers for all the groups to get a larger population and more reliable results. 2. Percentages of colors of M & M s may vary from season to season. For instance, you may find more brown and orange around Halloween, or more green and red around Christmas. 3. Example of data: Table 1 Color of Candy Number (o) Percentage Number (e) (Total number of all pieces of candy X Percentage ) Green 40 20% 40 Blue 20 10% 20 Orange 30 20% 40 Brown 40 20% 40 Red 40 20% 40 Yellow 30 10% 20 Total # candies = 200 Table 2 - Example Classes (Colors) (e) (o) o-e (o-e) 2 (o-e) 2 Green 40 40 0 0 0 Blue 20 20 0 0 0 Orange 40 30-10 100 2.5 Brown 40 40 0 0 0 Red 40 40 0 0 0 Yellow 20 30 10 100 5 e Degrees of freedom = 5 = 7.5 (number of classes 1) Lab adapted from lab received at an AP Workshop conducted by Richard Patterson and Ellen Mayo