Test of Goodness of Fit Lecture 43 Section 14.1 – 14.3 Fri, Apr 8, 2005.

Slides:



Advertisements
Similar presentations
Chi-square test Chi-square test or  2 test. Chi-square test countsUsed to test the counts of categorical data ThreeThree types –Goodness of fit (univariate)
Advertisements

Chapter 12 Goodness-of-Fit Tests and Contingency Analysis
Multinomial Experiments Goodness of Fit Tests We have just seen an example of comparing two proportions. For that analysis, we used the normal distribution.
Chi-Squared Hypothesis Testing Using One-Way and Two-Way Frequency Tables of Categorical Variables.
Statistical Inference for Frequency Data Chapter 16.
Chapter 12 Chi-Square Tests and Nonparametric Tests
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 14 Goodness-of-Fit Tests and Categorical Data Analysis.
Goodness of Fit Test for Proportions of Multinomial Population Chi-square distribution Hypotheses test/Goodness of fit test.
1 1 Slide IS 310 – Business Statistics IS 310 Business Statistics CSU Long Beach.
Chapter 13 Chi-Square Tests. The chi-square test for Goodness of Fit allows us to determine whether a specified population distribution seems valid. The.
Testing Hypotheses about a Population Proportion Lecture 29 Sections 9.1 – 9.3 Tue, Oct 23, 2007.
Testing Distributions Section Starter Elite distance runners are thinner than the rest of us. Skinfold thickness, which indirectly measures.
Business Statistics, A First Course (4e) © 2006 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests Business Statistics, A First Course 4 th Edition.
AP STATISTICS LESSON 13 – 1 (DAY 1) CHI-SQUARE PROCEDURES TEST FOR GOODNESS OF FIT.
Chapter 11: Applications of Chi-Square. Count or Frequency Data Many problems for which the data is categorized and the results shown by way of counts.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. 1.. Section 11-2 Goodness of Fit.
Multinomial Experiments Goodness of Fit Tests We have just seen an example of comparing two proportions. For that analysis, we used the normal distribution.
Chapter 26 Chi-Square Testing
Chapter 12: The Analysis of Categorical Data and Goodness- of-Fit Test.
Testing Hypotheses about a Population Proportion Lecture 30 Sections 9.3 Wed, Oct 24, 2007.
Chapter 14: Chi-Square Procedures – Test for Goodness of Fit.
The Practice of Statistics Third Edition Chapter (13.1) 14.1: Chi-square Test for Goodness of Fit Copyright © 2008 by W. H. Freeman & Company Daniel S.
Test of Homogeneity Lecture 45 Section 14.4 Wed, Apr 19, 2006.
Business Statistics: A First Course, 5e © 2009 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests Business Statistics: A First Course Fifth Edition.
© Copyright McGraw-Hill CHAPTER 11 Other Chi-Square Tests.
Making Decisions about a Population Mean with Confidence Lecture 33 Sections 10.1 – 10.2 Fri, Mar 30, 2007.
Test of Independence Lecture 43 Section 14.5 Mon, Apr 23, 2007.
Chapter Outline Goodness of Fit test Test of Independence.
The table shows a random sample of 100 hikers and the area of hiking preferred. Are hiking area preference and gender independent? Hiking Preference Area.
Dan Piett STAT West Virginia University Lecture 12.
Testing Hypotheses about a Population Proportion Lecture 29 Sections 9.1 – 9.3 Fri, Nov 12, 2004.
Testing Hypotheses about a Population Proportion Lecture 29 Sections 9.1 – 9.3 Wed, Nov 1, 2006.
Making Decisions about a Population Mean with Confidence Lecture 35 Sections 10.1 – 10.2 Fri, Mar 31, 2006.
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.
Statistics 300: Elementary Statistics Section 11-2.
Testing Hypotheses about a Population Proportion Lecture 31 Sections 9.1 – 9.3 Wed, Mar 22, 2006.
Chapter 12 The Analysis of Categorical Data and Goodness of Fit Tests.
Test of Homogeneity Lecture 45 Section 14.4 Tue, Apr 12, 2005.
Chapter 13- Inference For Tables: Chi-square Procedures Section Test for goodness of fit Section Inference for Two-Way tables Presented By:
Chapter 14 – 1 Chi-Square Chi-Square as a Statistical Test Statistical Independence Hypothesis Testing with Chi-Square The Assumptions Stating the Research.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Chapter 12 Tests of Goodness of Fit and Independence n Goodness of Fit Test: A Multinomial.
+ Section 11.1 Chi-Square Goodness-of-Fit Tests. + Introduction In the previous chapter, we discussed inference procedures for comparing the proportion.
Statistics 300: Elementary Statistics Section 11-3.
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.
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.
Confidence Interval Estimation for a Population Proportion Lecture 33 Section 9.4 Mon, Nov 7, 2005.
CHI SQUARE DISTRIBUTION. The Chi-Square (  2 ) Distribution The chi-square distribution is the probability distribution of the sum of several independent,
Student’s t Distribution Lecture 32 Section 10.2 Fri, Nov 10, 2006.
Test of Goodness of Fit Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007.
Student’s t Distribution
Testing Hypotheses about a Population Proportion
Chapter 12 Tests with Qualitative Data
Chapter 10 Analyzing the Association Between Categorical Variables
Lecture 36 Section 14.1 – 14.3 Mon, Nov 27, 2006
Lecture 41 Section 14.1 – 14.3 Wed, Nov 14, 2007
Lecture 42 Section 14.4 Wed, Apr 17, 2007
Lecture 37 Section 14.4 Wed, Nov 29, 2006
Analyzing the Association Between Categorical Variables
Lecture 43 Sections 14.4 – 14.5 Mon, Nov 26, 2007
Testing Hypotheses about a Population Proportion
Testing Hypotheses about a Population Proportion
Testing Hypotheses about a Population Proportion
Chapter Outline Goodness of Fit test Test of Independence.
Lecture 42 Section 14.3 Mon, Nov 19, 2007
Testing Hypotheses about a Population Proportion
Lecture 46 Section 14.5 Wed, Apr 13, 2005
Lecture 43 Section 14.1 – 14.3 Mon, Nov 28, 2005
Presentation transcript:

Test of Goodness of Fit Lecture 43 Section 14.1 – 14.3 Fri, Apr 8, 2005

Count Data Count data – Data that counts the number of observations that fall into each of several categories. Count data – Data that counts the number of observations that fall into each of several categories. The data may be univariate or bivariate. The data may be univariate or bivariate. Bivariate example – Observe a student’s final grade and class: A – F and freshman – senior. Bivariate example – Observe a student’s final grade and class: A – F and freshman – senior.

Univariate Example Observe students’ final grade in statistics: A, B, C, D, or F. Observe students’ final grade in statistics: A, B, C, D, or F. ABCDF

Bivariate Example Observe students’ final grade in statistics and year in college. Observe students’ final grade in statistics and year in college. ABCDF Fresh36321 Soph14410 Junior12001 Senior01100

Observed and Expected Counts Observed counts – The counts that were actually observed in the sample. Observed counts – The counts that were actually observed in the sample. Expected counts – The counts that would be expected if the null hypothesis were true. Expected counts – The counts that would be expected if the null hypothesis were true. In this chapter, we will entertain various null hypotheses. In this chapter, we will entertain various null hypotheses.

The Chi-Square Statistic Denote the observed counts by O and the expected counts by E. Denote the observed counts by O and the expected counts by E. Define the chi-square (  2 ) statistic to be Define the chi-square (  2 ) statistic to be Clearly, if the observed counts are close to the expected counts, then  2 will be small. Clearly, if the observed counts are close to the expected counts, then  2 will be small. If even a few observed counts are far from the expected counts, then  2 will be large. If even a few observed counts are far from the expected counts, then  2 will be large.

Think About It Think About It, p Think About It, p. 853.

Chi-Square Degrees of Freedom The chi-square distribution has an associated degrees of freedom, just like the t distribution. The chi-square distribution has an associated degrees of freedom, just like the t distribution. Each chi-square distribution has a slightly different shape, depending on the number of degrees of freedom. Each chi-square distribution has a slightly different shape, depending on the number of degrees of freedom.

Chi-Square Degrees of Freedom  2 (2)  2 (5)  2 (10)

Properties of  2 The chi-square distribution with n degrees of freedom has the following properties. The chi-square distribution with n degrees of freedom has the following properties.  2  0.  2  0. It is unimodal. It is unimodal. It is skewed right. It is skewed right.   2 = n.   2 = n.   2 =  (2n).   2 =  (2n). If n is large, then  2 (n) is approximately N(n,  (2n)). If n is large, then  2 (n) is approximately N(n,  (2n)).

Chi-Square vs. Normal N(30,  60)  2 (30)  2 (32) N(32, 8)

Chi-Square vs. Normal  2 (128) N(128, 16)

The Chi-Square Table See page 949. See page 949. The left column is degrees of freedom: 1, 2, 3, …, 15, 16, 18, 20, 24, 30, 40, 60, 120. The left column is degrees of freedom: 1, 2, 3, …, 15, 16, 18, 20, 24, 30, 40, 60, 120. The column headings represent upper tails: The column headings represent upper tails: 0.005, 0.01, 0.025, 0.05, 0.10, 0.005, 0.01, 0.025, 0.05, 0.10, 0.90, 0.95, 0.975, 0.99, , 0.95, 0.975, 0.99, Of course, the upper tails 0.90, 0.95, 0.975, 0.99, are the same as the lower tails 0.10, 0.05, 0.025, 0.01, Of course, the upper tails 0.90, 0.95, 0.975, 0.99, are the same as the lower tails 0.10, 0.05, 0.025, 0.01,

Example If df = 10, what value of  2 cuts off an upper tail of 0.05? If df = 10, what value of  2 cuts off an upper tail of 0.05? If df = 10, what value of  2 cuts off a lower tail of 0.05? If df = 10, what value of  2 cuts off a lower tail of 0.05?

TI-83 – Chi-Square Probabilities To find a chi-square probability on the TI-83, To find a chi-square probability on the TI-83, Press DISTR. Press DISTR. Select  2 cdf (item #7). Select  2 cdf (item #7). Press ENTER. Press ENTER. Enter the lower endpoint, the upper endpoint, and the degrees of freedom. Enter the lower endpoint, the upper endpoint, and the degrees of freedom. Press ENTER. Press ENTER. The probability appears. The probability appears.

Example If df = 32, what is the probability that  2 will fall between 24 and 40? If df = 32, what is the probability that  2 will fall between 24 and 40? Compute  2 cdf(24, 40, 32). Compute  2 cdf(24, 40, 32). If df = 128, what is the probability that  2 will fall between 96 and 160? If df = 128, what is the probability that  2 will fall between 96 and 160? Compute  2 cdf(96, 160, 128). Compute  2 cdf(96, 160, 128). On the other hand, if df = 8, what is the probability that  2 will fall between 4 and 12? On the other hand, if df = 8, what is the probability that  2 will fall between 4 and 12? Compute  2 cdf(96, 160, 128). Compute  2 cdf(96, 160, 128).

Tests of Goodness of Fit The goodness-of-fit test applies only to univariate data. The goodness-of-fit test applies only to univariate data. The null hypothesis specifies a discrete distribution for the population. The null hypothesis specifies a discrete distribution for the population. We want to determine whether a sample from that population supports this hypothesis. We want to determine whether a sample from that population supports this hypothesis.

Examples If we rolled a die 60 times, we expect 10 of each number. If we rolled a die 60 times, we expect 10 of each number. If we got frequencies 8, 10, 14, 12, 9, 7, does that indicate that the die is not fair? If we got frequencies 8, 10, 14, 12, 9, 7, does that indicate that the die is not fair? If we toss a fair coin, we should get two heads ¼ of the time, two tails ¼ of the time, and one of each ½ of the time. If we toss a fair coin, we should get two heads ¼ of the time, two tails ¼ of the time, and one of each ½ of the time. Suppose we toss a coin 100 times and get two heads 16 times, two tails 36 times, and one of each 48 times. Is the coin fair? Suppose we toss a coin 100 times and get two heads 16 times, two tails 36 times, and one of each 48 times. Is the coin fair?

Examples If we selected 20 people from a group that was 60% male and 40% female, we would expect to get 12 males and 8 females. If we selected 20 people from a group that was 60% male and 40% female, we would expect to get 12 males and 8 females. If we got 15 males and 5 females, would that indicate that our selection procedure was not random (i.e., discriminatory)? If we got 15 males and 5 females, would that indicate that our selection procedure was not random (i.e., discriminatory)?

Null Hypothesis The null hypothesis specifies the probability (or proportion) for each category. The null hypothesis specifies the probability (or proportion) for each category. Each probability is the probability that a random observation would fall into that category. Each probability is the probability that a random observation would fall into that category.

Null Hypothesis To test a die for fairness, the null hypothesis would be To test a die for fairness, the null hypothesis would be H 0 : p 1 = 1/6, p 2 = 1/6, …, p 6 = 1/6. The alternative hypothesis would be The alternative hypothesis would be H 1 : At least one of the probabilities is not 1/6.

Expected Counts To find the expected counts, we apply the hypothetical probabilities to the sample size. To find the expected counts, we apply the hypothetical probabilities to the sample size. For example, if the hypothetical probability is 1/6 and the sample size is 60, then the expected count is For example, if the hypothetical probability is 1/6 and the sample size is 60, then the expected count is (1/6)  60 = 10.

Example We will use the sample data given for 60 rolls of a die to calculate the  2 statistic. We will use the sample data given for 60 rolls of a die to calculate the  2 statistic. Make a chart showing both the observed and expected counts (in parentheses). Make a chart showing both the observed and expected counts (in parentheses) (10) 10 (10) 14 (10) 12 (10) 9 (10) 7 (10)

Example Now calculate  2. Now calculate  2.

Computing the p-value The number of degrees of freedom is 1 less than the number of categories in the table. The number of degrees of freedom is 1 less than the number of categories in the table. In this example, df = 5. In this example, df = 5. To find the p-value, use the TI-83 to calculate the probability that  2 (5) would be at least as large as 3.4. To find the p-value, use the TI-83 to calculate the probability that  2 (5) would be at least as large as 3.4.  2 cdf(3.4, E99, 5) =  2 cdf(3.4, E99, 5) = Therefore, p-value = (accept H 0 ). Therefore, p-value = (accept H 0 ).

TI-83 – Goodness of Fit Test The TI-83 will not automatically do a goodness- of-fit test. The TI-83 will not automatically do a goodness- of-fit test. The following procedure will compute  2. The following procedure will compute  2. Enter the observed counts into list L 1. Enter the observed counts into list L 1. Enter the expected counts into list L 2. Enter the expected counts into list L 2. Evaluate the expression (L 1 – L 2 ) 2 /L 2. Evaluate the expression (L 1 – L 2 ) 2 /L 2. Select LIST > MATH > sum and apply the sum function to the previous result. Select LIST > MATH > sum and apply the sum function to the previous result. The result is the value of  2. The result is the value of  2.

Example To test whether the coin is fair, the null hypothesis would be To test whether the coin is fair, the null hypothesis would be H 0 : p HH = 1/4, p TT = 1/4, p HT = 1/2. The alternative hypothesis would be The alternative hypothesis would be H 1 : At least one of the probabilities is not what H 0 says it is.

Expected Counts To find the expected counts, we apply the hypothetical probabilities to the sample size. To find the expected counts, we apply the hypothetical probabilities to the sample size. Expected HH = (1/4)  100 = 25. Expected HH = (1/4)  100 = 25. Expected TT = (1/4)  100 = 25. Expected TT = (1/4)  100 = 25. Expected HT = (1/2)  100 = 50. Expected HT = (1/2)  100 = 50.

Example We will use the sample data given for 60 rolls of a die to calculate the  2 statistic. We will use the sample data given for 60 rolls of a die to calculate the  2 statistic. Make a chart showing both the observed and expected counts (in parentheses). Make a chart showing both the observed and expected counts (in parentheses). HHTTHT 16 (25) 36 (25) 48 (50)

Example Now calculate  2. Now calculate  2.

Computing the p-value In this example, df = 2. In this example, df = 2. To find the p-value, use the TI-83 to calculate the probability that  2 (2) would be at least as large as To find the p-value, use the TI-83 to calculate the probability that  2 (2) would be at least as large as  2 cdf(8.16, E99, 2) =  2 cdf(8.16, E99, 2) = Therefore, p-value = (reject H 0 ). Therefore, p-value = (reject H 0 ).