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.

Slides:



Advertisements
Similar presentations
CHAPTER 23: Two Categorical Variables: The Chi-Square Test
Advertisements

Chapter 11 Inference for Distributions of Categorical Data
Chapter 13: Inference for Distributions of Categorical Data
Chapter 10 Chi-Square Tests and the F- Distribution 1 Larson/Farber 4th ed.
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 26: Comparing Counts. To analyze categorical data, we construct two-way tables and examine the counts of percents of the explanatory and response.
Chi-Square Test.
Chi-square Goodness of Fit Test
Chapter 11: Inference for Distributions of Categorical Data
Chapter 13: Inference for Tables – Chi-Square Procedures
Analysis of Count Data Chapter 26
Lecture Presentation Slides SEVENTH EDITION STATISTICS Moore / McCabe / Craig Introduction to the Practice of Chapter 9 Analysis of Two-Way Tables.
13.1 Goodness of Fit Test AP Statistics. Chi-Square Distributions The chi-square distributions are a family of distributions that take on only positive.
Section 10.1 Goodness of Fit. Section 10.1 Objectives Use the chi-square distribution to test whether a frequency distribution fits a claimed distribution.
Chapter 11: Inference for Distributions of Categorical Data.
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11 Inference for Tables: Chi-Square Procedures 11.1 Target Goal:I can compute expected counts, conditional distributions, and contributions to.
The Practice of Statistics, 5th Edition Starnes, Tabor, Yates, Moore Bedford Freeman Worth Publishers CHAPTER 11 Inference for Distributions of Categorical.
Chapter 11: Inference for Distributions of Categorical Data Section 11.1 Chi-Square Goodness-of-Fit Tests.
Chi-Square Procedures Chi-Square Test for Goodness of Fit, Independence of Variables, and Homogeneity of Proportions.
Chi-Square Test.
Section 11.1 Chi-Square Goodness-of-Fit Tests
Chapter 10 Chi-Square Tests and the F-Distribution
GOODNESS OF FIT Larson/Farber 4th ed 1 Section 10.1.
Warm up On slide.
+ Chapter 11 Inference for Distributions of Categorical Data 11.1Chi-Square Goodness-of-Fit Tests 11.2Inference for Relationships.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Lecture PowerPoint Slides Basic Practice of Statistics 7 th Edition.
+ Section 11.1 Chi-Square Goodness-of-Fit Tests. + Introduction In the previous chapter, we discussed inference procedures for comparing the proportion.
CHAPTER 11: INFERENCE FOR DISTRIBUTIONS OF CATEGORICAL DATA 11.1 CHI-SQUARE TESTS FOR GOODNESS OF FIT OUTCOME: I WILL STATE APPROPRIATE HYPOTHESES AND.
Chapter 11: Categorical Data n Chi-square goodness of fit test allows us to examine a single distribution of a categorical variable in a population. n.
Class Seven Turn In: Chapter 18: 32, 34, 36 Chapter 19: 26, 34, 44 Quiz 3 For Class Eight: Chapter 20: 18, 20, 24 Chapter 22: 34, 36 Read Chapters 23 &
The Chi-Square Distribution  Chi-square tests for ….. goodness of fit, and independence 1.
AP Stats Check In Where we’ve been… Chapter 7…Chapter 8… Where we are going… Significance Tests!! –Ch 9 Tests about a population proportion –Ch 9Tests.
Section 10.1 Goodness of Fit © 2012 Pearson Education, Inc. All rights reserved. 1 of 91.
Chi Square Test of Homogeneity. Are the different types of M&M’s distributed the same across the different colors? PlainPeanutPeanut Butter Crispy Brown7447.
Check your understanding: p. 684
CHAPTER 11 Inference for Distributions of Categorical Data
Warm up On slide.
CHAPTER 11 Inference for Distributions of Categorical Data
11.1 Chi-Square Tests for Goodness of Fit
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 9 Analysis of Two-Way Tables
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 11 Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Inference for Distributions of Categorical Data
Chapter 11: Inference for Distributions of Categorical Data
Presentation transcript:

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.

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.

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!

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.

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 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.

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.

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

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.

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

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 Go to the row for df = 5. Move to the right until you find where the test statistic would be between is between 9.24 and Follow these numbers up. The p-value is between 0.05 and 0.10.

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.

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.

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.

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 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.

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

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!

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?

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) = All expected counts are at least 5.

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:

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).

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.