Copyright © 2012 Pearson Education. All rights reserved. 15-1 Copyright © 2012 Pearson Education. All rights reserved. Chapter 15 Inference for Counts:

Slides:



Advertisements
Similar presentations
Statistical Methods Lecture 25
Advertisements

Statistical Methods Lecture 26
Chapter 11 Other Chi-Squared Tests
CHAPTER 23: Two Categorical Variables: The Chi-Square Test
Inference about the Difference Between the
Chapter 14 Comparing two groups Dr Richard Bußmann.
Chapter 11 Inference for Distributions of Categorical Data
Chapter 13: Inference for Distributions of Categorical Data
Copyright ©2011 Brooks/Cole, Cengage Learning More about Inference for Categorical Variables Chapter 15 1.
Copyright ©2006 Brooks/Cole, a division of Thomson Learning, Inc. More About Categorical Variables Chapter 15.
© 2010 Pearson Prentice Hall. All rights reserved The Chi-Square Test of Independence.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 25, Slide 1 Chapter 25 Comparing Counts.
Chapter 26: Comparing Counts
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
 Involves testing a hypothesis.  There is no single parameter to estimate.  Considers all categories to give an overall idea of whether the observed.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 26 Comparing Counts.
Chapter 26: Comparing Counts AP Statistics. Comparing Counts In this chapter, we will be performing hypothesis tests on categorical data In previous chapters,
Copyright © 2010 Pearson Education, Inc. Warm Up- Good Morning! If all the values of a data set are the same, all of the following must equal zero except.
Copyright © 2013, 2010 and 2007 Pearson Education, Inc. Chapter Inference on Categorical Data 12.
Copyright © 2009 Pearson Education, Inc LEARNING GOAL Interpret and carry out hypothesis tests for independence of variables with data organized.
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 18 Inference for Counts.
The Practice of Statistics, 5th Edition Starnes, Tabor, Yates, Moore Bedford Freeman Worth Publishers CHAPTER 11 Inference for Distributions of Categorical.
1 In this case, each element of a population is assigned to one and only one of several classes or categories. Chapter 11 – Test of Independence - Hypothesis.
Chi-Square Procedures Chi-Square Test for Goodness of Fit, Independence of Variables, and Homogeneity of Proportions.
1-1 Copyright © 2015, 2010, 2007 Pearson Education, Inc. Chapter 25, Slide 1 Chapter 26 Comparing Counts.
Slide 26-1 Copyright © 2004 Pearson Education, Inc.
Chapter 22: Comparing Two Proportions. Yet Another Standard Deviation (YASD) Standard deviation of the sampling distribution The variance of the sum or.
Copyright © 2010 Pearson Education, Inc. Slide Beware: Lots of hidden slides!
BPS - 5th Ed. Chapter 221 Two Categorical Variables: The Chi-Square Test.
Learning Objectives Copyright © 2002 South-Western/Thomson Learning Statistical Testing of Differences CHAPTER fifteen.
Copyright © 2010 Pearson Education, Inc. Slide
Comparing Counts.  A test of whether the distribution of counts in one categorical variable matches the distribution predicted by a model is called a.
1 1 Slide © 2009 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Chapter 13 Inference for Counts: Chi-Square Tests © 2011 Pearson Education, Inc. 1 Business Statistics: A First Course.
Chapter Outline Goodness of Fit test Test of Independence.
Copyright © 2010 Pearson Education, Inc. Warm Up- Good Morning! If all the values of a data set are the same, all of the following must equal zero except.
Section 12.2: Tests for Homogeneity and Independence in a Two-Way Table.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Comparing Counts Chapter 26. Goodness-of-Fit A test of whether the distribution of counts in one categorical variable matches the distribution predicted.
+ Section 11.1 Chi-Square Goodness-of-Fit Tests. + Introduction In the previous chapter, we discussed inference procedures for comparing the proportion.
Jump to first page Inferring Sample Findings to the Population and Testing for Differences.
The Practice of Statistics, 5th Edition Starnes, Tabor, Yates, Moore Bedford Freeman Worth Publishers CHAPTER 11 Inference for Distributions of Categorical.
Chi-Squared Test of Homogeneity Are different populations the same across some characteristic?
Statistics 26 Comparing Counts. Goodness-of-Fit A test of whether the distribution of counts in one categorical variable matches the distribution predicted.
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 &
Copyright © 2009 Pearson Education, Inc t LEARNING GOAL Understand when it is appropriate to use the Student t distribution rather than the normal.
Comparing Observed Distributions A test comparing the distribution of counts for two or more groups on the same categorical variable is called a chi-square.
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.
Copyright © 2009 Pearson Education, Inc LEARNING GOAL Interpret and carry out hypothesis tests for independence of variables with data organized.
Goodness-of-Fit A test of whether the distribution of counts in one categorical variable matches the distribution predicted by a model is called a goodness-of-fit.
Comparing Counts Chi Square Tests Independence.
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 25 Comparing Counts.
Chapter 11: Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
15.1 Goodness-of-Fit Tests
CHAPTER 11 Inference for Distributions of Categorical Data
Paired Samples and Blocks
Chapter 26 Comparing Counts.
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 26 Comparing Counts Copyright © 2009 Pearson Education, Inc.
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Chapter 26 Comparing Counts.
CHAPTER 11 Inference for Distributions of Categorical Data
CHAPTER 11 Inference for Distributions of Categorical Data
Presentation transcript:

Copyright © 2012 Pearson Education. All rights reserved Copyright © 2012 Pearson Education. All rights reserved. Chapter 15 Inference for Counts: Chi-Square Tests

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Given the following… 1) Counts of items in each of several categories 2) A model that predicts the distribution of the relative frequencies …this question naturally arises: “Does the actual distribution differ from the model because of random error, or do the differences mean that the model does not fit the data?” In other words, “How good is the fit?”

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Example: Stock Market “Up” Days Sample of 1000 “up” days Population of Stock Market Days “Up” days appear to be more common than expected on certain days, especially on Fridays. Null Hypothesis: The distribution of “up” days is no different from the population distribution. Test the hypothesis with a chi-square goodness-of-fit test.

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Assumptions and Condition Counted Data Condition – The data must be counts for the categories of a categorical variable. Independence Assumption Independence Assumption – The counts should be independent of each other. Think about whether this is reasonable. Randomization Condition – The counted individuals should be a random sample of the population. Guard against auto-correlated samples.

Copyright © 2012 Pearson Education. All rights reserved Sample Size Assumption Sample Size Assumption -- There must be enough data so check the following condition. Expected Cell Frequency Condition – Expect at least 5 individuals per cell Goodness-of-Fit Tests

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Chi-Square Model To decide if the null model is plausible, look at the differences between the observed values and the values expected if the model were true. Note that “accumulates” the relative squared deviation of each cell from its expected value. So, gets “big” when i) the data set is large and/or ii) the model is a poor fit.

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests The Chi-Square Calculation

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Example : Credit Cards At a major credit card bank, the percentages of people who historically apply for the Silver, Gold, and Platinum cards are 60%, 30%, and 10% respectively. In a recent sample of customers, 110 applied for Silver, 55 for Gold, and 35 for Platinum. Is there evidence to suggest the percentages have changed? What type of test do you conduct? What are the expected values? Find the test statistic and p-value. State conclusions.

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Example : Credit Cards At a major credit card bank, the percentages of people who historically apply for the Silver, Gold, and Platinum cards are 60%, 30%, and 10% respectively. In a recent sample of customers, 110 applied for Silver, 55 for Gold, and 35 for Platinum. Is there evidence to suggest the percentages have changed? What type of test do you conduct? This is a goodness-of-fit test comparing a single sample to previous information (the null model). What are the expected values? SilverGoldPlatinum Observed Expected

Copyright © 2012 Pearson Education. All rights reserved Goodness-of-Fit Tests Example : Credit Cards At a major credit card bank, the percentages of people who historically apply for the Silver, Gold, and Platinum cards are 60%, 30%, and 10% respectively. In a recent sample of customers, 110 applied for Silver, 55 for Gold, and 35 for Platinum. Is there evidence to suggest the percentages have changed? Find the test statistic and p-value. Using df = 2, the p-value < State conclusions. Reject the null hypothesis. There is sufficient evidence customers are not applying for cards in the traditional proportions.

Copyright © 2012 Pearson Education. All rights reserved Interpreting Chi-Square Values The Chi-Square Distribution The distribution is right-skewed and becomes broader with increasing degrees of freedom: The test is a one-sided test.

Copyright © 2012 Pearson Education. All rights reserved Interpreting Chi-Square Values The Chi-Square Calculation: Stock Market “Up” Days Using a chi-square table at a significance level of 0.05 and with 4 degrees of freedom: Do not reject the null hypothesis. (The fit is “good”.)

Copyright © 2012 Pearson Education. All rights reserved When we reject a null hypothesis, we can examine the residuals in each cell to discover which values are extraordinary. Because we might compare residuals for cells with very different counts, we should examine standardized residuals: 15.3 Examining the Residuals Note that standardized residuals from goodness-of-fit tests are actually z -scores (which we already know how to interpret and analyze).

Copyright © 2012 Pearson Education. All rights reserved Standardized residuals for the trading days data: 15.3 Examining the Residuals None of these values is remarkable. The largest, Friday, at 1.292, is not impressive when viewed as a z -score. The deviations are in the direction of a “weekend effect”, but they aren’t quite large enough for us to conclude they are real.

Copyright © 2012 Pearson Education. All rights reserved Below are responses to the question, “How important is it to seek your utmost attractive appearance?” 15.4 The Chi-Square Test for Homogeneity

Copyright © 2012 Pearson Education. All rights reserved Convert the results to “column percentages”: 15.4 The Chi-Square Test for Homogeneity Response patterns are beginning to become apparent.

Copyright © 2012 Pearson Education. All rights reserved The stacked barchart shows the patterns even more vividly: 15.4 The Chi-Square Test for Homogeneity It seems that India stands out from the others.

Copyright © 2012 Pearson Education. All rights reserved But, are the differences real or just natural sampling variation? 15.4 The Chi-Square Test for Homogeneity Our null hypothesis is that the relative frequency distributions are the same (homogeneous) for each country. Test the hypothesis with a chi-square test for homogeneity.

Copyright © 2012 Pearson Education. All rights reserved Use the Row % column to determine the expected counts for each table column (each country): 15.4 The Chi-Square Test for Homogeneity

Copyright © 2012 Pearson Education. All rights reserved Assumptions and Conditions 15.4 The Chi-Square Test for Homogeneity Counted Data Condition – Data must be counts Independence Assumption – Counts need to be independent from each other. Check for randomization Randomization Condition – Random sample needed Sample Size Assumption – There must be enough data so check the following condition. Expected Cell Frequency Condition – Expect at least 5 individuals per cell.

Copyright © 2012 Pearson Education. All rights reserved Following the pattern of the goodness-of-fit test, compute the component for each cell: 15.4 The Chi-Square Test for Homogeneity Then, sum the components: The degrees of freedom are (The for the appearance survey indicates that the differences between countries are not due to random chance.)

Copyright © 2012 Pearson Education. All rights reserved Example: More Credit Cards A market researcher for the credit card bank wants to know if the distribution of applications by card is the same for the past 3 mailings. She takes a random sample of 200 from each mailing and counts the number of applications for each type of card. What type of test do you conduct? What are the expected values? Find the test statistic and p-value. State conclusions The Chi-Square Test for Homogeneity

Copyright © 2012 Pearson Education. All rights reserved Example : More Credit Cards A market researcher for the credit card bank wants to know if the distribution of applications by card is the same for the past 3 mailings. She takes a random sample of 200 from each mailing and counts the number of applications for each type of card. What type of test do you conduct? A chi-square test of homogeneity What are the expected values? 15.4 The Chi-Square Test for Homogeneity

Copyright © 2012 Pearson Education. All rights reserved Example : More Credit Cards A market researcher for the credit card bank wants to know if the distribution of applications by card is the same for the past 3 mailings. She takes a random sample of 200 from each mailing and counts the number of applications for each type of card. Find the test statistic. Given p-value > 0.10,state conclusions. Fail to reject the null. There is insufficient evidence to suggest that the distributions are different for the three mailings The Chi-Square Test for Homogeneity

Copyright © 2012 Pearson Education. All rights reserved Comparing Two Proportions Sample of 25, year-olds: Men: 84.9% diploma rate Women: 88.1% diploma rate Are women more likely to graduate high school than men, or are the differences due to random variation? Overall, of the sample had diplomas. Use this proportion to compute the expected values.

Copyright © 2012 Pearson Education. All rights reserved Comparing Two Proportions Observed Counts: Expected Values:

Copyright © 2012 Pearson Education. All rights reserved Comparing Two Proportions

Copyright © 2012 Pearson Education. All rights reserved Comparing Two Proportions Sample of 25, year-olds: For high school graduation, a 95% confidence interval for the true difference between women’s and men’s rates is: We can be 95% confident that women’s rates of having a HS diploma by 2000 were 2.36% to 4.04% higher than men’s.

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence The table below shows the importance of personal appearance for several age groups. Are Age and Appearance independent, or is there a relationship?

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence A stacked barchart suggests a relationship: Test for independence using a chi-square test of independence.

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence The test is mechanically equivalent to the test for homogeneity, but with some differences in how we think about the data and the results: Homogeneity Test: one variable ( Appearance ) measured on two or more populations (countries). Independence Test: Two variables ( Appearance and Age ) measured on a single population. We ask the question “Are the variables independent?” rather than “Are the groups homogeneous?” This subtle distinction is important when drawing conclusions.

Copyright © 2012 Pearson Education. All rights reserved Assumptions and Conditions 15.6 Chi-Square Test of Independence Counted Data Condition – Data must be counts Independence Assumption – Counts need to be independent from each other. Check for randomization Randomization Condition – Random sample needed Sample Size Assumption – There must be enough data so check the following condition. Expected Cell Frequency Condition – Expect at least 5 individuals per cell.

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence Example : Automobile Manufacturers Consumer Reports uses surveys to measure reliability in automobiles. Annually they release survey results about problems that consumers have had with vehicles in the past 12 months and the origin of manufacturer. Is consumer satisfaction related to country of origin? State the hypotheses. Find the test statistic. Given p-value = 0.231, state your conclusion.

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence Example : Automobile Manufacturers Consumer Reports uses surveys to measure reliability in automobiles. Annually they release survey results about problems that consumers have had with vehicles in the past 12 months and the origin of manufacturer. Is consumer satisfaction related to country of origin? State the hypotheses. Find the test statistic. Given p-value = 0.231, state your conclusion. There is not enough evidence to conclude there is an association between vehicle problems and origin of vehicle.

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence For the Appearance and Age example, we reject the null hypothesis that the variables are independent. So, it may be of interest to know how differently two age groups (teens and 30-something adults) select the “very important” category ( Appearance response 6 or 7). Construct a confidence interval for the true difference in proportions…

Copyright © 2012 Pearson Education. All rights reserved Chi-Square Test of Independence From the data table, the percentage responses for Appearance = 6 or 7 are as follows: Teens: 45.17% 30-39: 39.91% The 95% confidence interval is found below:

Copyright © 2012 Pearson Education. All rights reserved  Don’t use chi-square methods unless you have counts.  Beware large samples! With a sufficiently large sample size, a chi-square test can always reject the null hypothesis.  Don’t say that one variable “depends” on the other just because they’re not independent.

Copyright © 2012 Pearson Education. All rights reserved What Have We Learned? Recognize when a chi-square test of goodness of fit, homogeneity, or independence is appropriate. For each test, find the expected cell frequencies. For each test, check the assumptions and corresponding conditions and know how to complete the test. Counted data condition. Independence assumption; randomization makes independence more plausible. Sample size assumption with the expected cell frequency condition; expect at least 5 observations in each cell.

Copyright © 2012 Pearson Education. All rights reserved What Have We Learned? Interpret a chi-square test. Even though we might believe the model, we cannot prove that the data fit the model with a chi-square test because that would mean confirming the null hypothesis. Examine the standardized residuals to understand what cells were responsible for rejecting a null hypothesis.

Copyright © 2012 Pearson Education. All rights reserved What Have We Learned? Compare two proportions. State the null hypothesis for a test of independence and understand how that is different from the null hypothesis for a test of homogeneity. Both are computed the same way. You may not find both offered by your technology. You can use either one as long as you interpret your result correctly.