Presentation is loading. Please wait.

Presentation is loading. Please wait.

11.1 Chi-Square Tests for Goodness of Fit Objectives SWBAT: STATE appropriate hypotheses and COMPUTE expected counts for a chi- square test for goodness.

Similar presentations


Presentation on theme: "11.1 Chi-Square Tests for Goodness of Fit Objectives SWBAT: STATE appropriate hypotheses and COMPUTE expected counts for a chi- square test for goodness."— Presentation transcript:

1 11.1 Chi-Square Tests for Goodness of Fit Objectives SWBAT: STATE appropriate hypotheses and COMPUTE expected counts for a chi- square test for goodness of fit. CALCULATE the chi-square statistic, degrees of freedom, and P-value for a chi-square test for goodness of fit. PERFORM a chi-square test for goodness of fit. CONDUCT a follow-up analysis when the results of a chi-square test are statistically significant.

2 What is a one-way table? What is a chi-square test for goodness-of-fit? A one-way table is a table used to display the distribution of a single categorical variable. For example, this one-way table summarizes the data from a sample bag of M&M’S ® Milk Chocolate Candies: Let’s say we were interested in the distribution of all colors. In 2009 M&M’s website claimed the following color distribution for bags of M&M’s: Blue: 24%Orange: 20%Green: 16%Yellow: 14%Red: 13%Brown: 13% Let’s say we wanted to test each of these proportions to see if the company is telling the truth. For example, if wanted to test the proportion of blue M&M’s, we would test the following hypotheses using a one-proportion z test: H 0 : p = 0.24 H a : p ≠ 0.24 where p is the true population proportion of blue M&M’s. Performing a one-sample z test for each proportion would be pretty inefficient and would lead to the problem of multiple comparisons.

3 Performing one-sample z tests for each color wouldn’t tell us how likely it is to get a random sample of 60 candies with a color distribution that differs as much from the one claimed by the company as this bag does (taking all the colors into consideration at one time). For that, we need a new kind of significance test, called a chi-square goodness- of-fit test. A chi-square goodness-of-fit test compares an observed distribution to a hypothesized one. The test determines whether a categorical variable has a specified distribution in the population of interest, expressed as the proportion of individuals falling into each possible category. It is not about a parameter! Chi-square tests are for categorical data!

4 What are the null and alternative hypotheses for a chi-square goodness-of-fit test? The null hypothesis in a chi-square goodness-of-fit test should state a claim about the distribution of a single categorical variable in the population of interest. H 0 : The company’s stated color distribution for M&M’S ® Milk Chocolate Candies is correct. The null hypothesis in a chi-square goodness-of-fit test should state a claim about the distribution of a single categorical variable in the population of interest. H 0 : The company’s stated color distribution for M&M’S ® Milk Chocolate Candies is correct. The alternative hypothesis in a chi-square goodness-of-fit test is that the categorical variable does not have the specified distribution. H a : The company’s stated color distribution for M&M’S ® Milk Chocolate Candies is not correct. The alternative hypothesis in a chi-square goodness-of-fit test is that the categorical variable does not have the specified distribution. H a : The company’s stated color distribution for M&M’S ® Milk Chocolate Candies is not correct. If one proportion is wrong, then at least one other proportion is also wrong. The alternative hypothesis is always two-sided. The hypotheses are always written in terms of the population (just remember we do not include parameters). We can also write the hypotheses in symbols as H 0 : p blue = 0.24, p orange = 0.20, p green = 0.16, p yellow = 0.14, p red = 0.13, p brown = 0.13, H a : At least two of the p i ’s is incorrect where p color = the true population proportion of M&M’S ® Milk Chocolate Candies of that color.

5 How do you calculate the expected counts for a chi-square goodness-of-fit test? Should you round these to the nearest integer? The expected counts are the numbers you would expect if the null hypothesis were true. So to find them, multiply the sample size by the proportion in each category, according to the null hypothesis. For example, the candy example says the proportion of green is 0.16. Therefore, if the sample size is 100, your expected count for green would be 16. Do NOT round the expected counts. These represent the average number in each category in repeated samples.

6 What is the chi-square test statistic? Is it on the formula sheet? What does it measure? The idea of the chi-square goodness-of-fit test is this: we compare the observed counts from our sample with the counts that would be expected if H 0 is true. The more the observed counts differ from the expected counts, the more evidence we have against the null hypothesis. The chi-square statistic is a measure of how far the observed counts are from the expected counts. The formula for the statistic is where the sum is over all possible values of the categorical variable. The chi-square statistic is a measure of how far the observed counts are from the expected counts. The formula for the statistic is where the sum is over all possible values of the categorical variable. Yes, formula sheet!!! We must use counts, not proportions! Again, the statistic is measuring how much different the observed distribution is from the hypothesized distribution.

7 Let’s calculate the test statistic for the M&M’s example.

8 In a goodness-of-fit test, when does the chi-square test statistic follow a chi- square distribution? How do you calculate the degrees of freedom for a chi- square goodness-of-fit test? The statistic follows a chi-square distribution when all of the expected counts are at least 5. The degrees of freedom = the number of categories – 1 For example, the M&M’s problem had 6 colors, so there are 6 – 1 = 5 df. The degrees of freedom do not depend on the sample size, only the number of categories.

9 Describe the shape, center, and spread of the chi-square distributions. The Chi-Square Distributions The chi-square distributions are a family of distributions that take only positive values and are skewed to the right. A particular chi- square distribution is specified by giving its degrees of freedom. Chi-square distributions are all skewed right. Their mean = df The peak of the distribution = df – 2

10 How do you calculate p-values using chi-square distributions? You can use the chi-square table or the calculator. Let’s go back to the M&M example. P df.15.10.05 46.747.789.49 58.129.2411.07 69.4510.6412.59 Go to the row for df = 5. Move to the right until you find where the test statistic would be between. 10.18 is between 9.24 and 11.07. Follow these numbers up. The p-value is between 0.05 and 0.10.

11 On the calculator: We need to enter a lower bound, an upper bound, and our df. This is perfectly in line with the p-value we attained from the table.

12 Alternate example: A fair die? Jenny made a six-sided die in her ceramics class and rolled it 60 times to test if each side was equally likely to show up on top. a) State the hypotheses Jenny is interested in testing.

13 Alternate example: A fair die? Jenny made a six-sided die in her ceramics class and rolled it 60 times to test if each side was equally likely to show up on top. b) Assuming that her die is fair, calculate the expected counts for each possible outcome. c) Here are the results of 60 rolls of Jenny’s ceramic die. Calculate the chi-square statistic.

14 Alternate example: A fair die? Jenny made a six-sided die in her ceramics class and rolled it 60 times to test if each side was equally likely to show up on top. d) Find the p-value. e) Make an appropriate conclusion. Because the p-value of 0.6386 is greater than the significance level of 0.05, we fail to reject the null. We do not have convincing evidence that her die is unfair.

15 On the calculator: First, enter the observed counts into L1 and the expected counts into L2. Observed: L1 Expected: L2 df: 5

16 What are the conditions for conducting a chi-square goodness-of-fit test? Conditions for Performing a Chi-Square Test for Goodness of Fit Random: The data come a well-designed random sample or from a randomized experiment. o 10%: When sampling without replacement, check that n ≤ (1/10)N. Large Counts: All expected counts are greater than 5 You must show the observed counts!

17 Example: Landline Surveys According to the 2000 census, of all U.S. residents aged 20 and older, 19.1% are in their 20s, 21.5% are in their 30s, 21.1% are in their 40s, 15.5% are in their 50s, and 22.8% are 60 and older. The table below shows the age distribution for a sample of U.S. residents aged 20 and older. Members of the sample were chosen by randomly dialing landline telephone numbers. Do these data provide convincing evidence that the age distribution of people who answer landline telephone surveys is not the same as the age distribution of all U.S. residents?

18 Example: Landline Surveys According to the 2000 census, of all U.S. residents aged 20 and older, 19.1% are in their 20s, 21.5% are in their 30s, 21.1% are in their 40s, 15.5% are in their 50s, and 22.8% are 60 and older. The table below shows the age distribution for a sample of U.S. residents aged 20 and older. Members of the sample were chosen by randomly dialing landline telephone numbers. Do these data provide convincing evidence that the age distribution of people who answer landline telephone surveys is not the same as the age distribution of all U.S. residents? Plan: If the conditions are met, we will perform a chi-square test for goodness-of-fit Random: The data came from a random sample of U.S. residents who answer landline telephone surveys. 10%: 1048 is less than 10% of all U.S. residents aged 20 and older Large Counts: The expected counts are 1048(0.191) = 200.2, 1048(0.215) = 225.3, 1048(0.211) = 221.1, 1048(0.155) = 162.4, 1048(0.228) = 238.9. All expected counts are at least 5.

19 Example: Landline Surveys According to the 2000 census, of all U.S. residents aged 20 and older, 19.1% are in their 20s, 21.5% are in their 30s, 21.1% are in their 40s, 15.5% are in their 50s, and 22.8% are 60 and older. The table below shows the age distribution for a sample of U.S. residents aged 20 and older. Members of the sample were chosen by randomly dialing landline telephone numbers. Do these data provide convincing evidence that the age distribution of people who answer landline telephone surveys is not the same as the age distribution of all U.S. residents? Df = 4 On the calculator:

20 Example: Landline Surveys According to the 2000 census, of all U.S. residents aged 20 and older, 19.1% are in their 20s, 21.5% are in their 30s, 21.1% are in their 40s, 15.5% are in their 50s, and 22.8% are 60 and older. The table below shows the age distribution for a sample of U.S. residents aged 20 and older. Members of the sample were chosen by randomly dialing landline telephone numbers. Do these data provide convincing evidence that the age distribution of people who answer landline telephone surveys is not the same as the age distribution of all U.S. residents? Follow-up analysis: The two age groups that contributed the most to the chi-square statistic were the 20- to 29-year-olds (59.2 fewer than expected) and the 50- to 59-year-olds (48.6 more than expected).

21 Can you use your calculator to conduct a chi-square goodness-of-fit test? We already know the answer! When should you do a follow-up analysis? How do you do a follow–up analysis? In general, you conduct a follow-up analysis whenever the results are statistically significant. However, on the AP exam, you only do a follow-up analysis when asked! To do the analysis, look at the chi-square components, and their direction.


Download ppt "11.1 Chi-Square Tests for Goodness of Fit Objectives SWBAT: STATE appropriate hypotheses and COMPUTE expected counts for a chi- square test for goodness."

Similar presentations


Ads by Google