Marquette University High School
NAMEAP StatisticsWed May 9 2012NOTE: AP STATS EXAM IS (IN THE AFTERNOON) ONE WEEK FROM TODAY! Inference Distribution of Categorical Variables: Chi-Square Procedures, Chapter 14, (connects to AP Topic Outline IV. B. 6)TODAY: 14.1, Chi-square test for goodness of fit (whether a single, specified population distribution seems valid – by count, not proportions)Tomorrow: 14.2, Chi-square test for homogeneity of populations (compare two or more population proportions)IMPORTANT: You will see a lot of proportions when dealing with chi-square problems. The chi-square procedures covered here for observed data apply only to COUNT DATA, not proportions. Proportions may appear in the hypotheses statements, but only count data are used for observations (expected values, since they are just averages, can be fractional, but are still not proportions). Do NOT try to use proportions in the calculations!An example using a uniform distributionLet’s say I used my calculator to simulate rolling a die 96 times: MATH PRB randInt(1,6,96). Let X = face value of the rolled die. The following counts were observed:Face value123456Count of observations191617171413Expected observations161616161616Is the die I used fair?H0: = 1/6 or .1667 The die is fair.Ha: 0.1667The die is unfair or loaded.14.1: Test for Goodness of FitChapter Objective 1: Explain what is meant by a chi-square goodness of fit.There is a single test that can be applied to see if the observed sample distribution is significantly different in some way from the hypothesized population distribution. It is called the chi-square test for goodness of fit (hereinafter simply 2GOF) (p 836).In general, the expected count (not observed) for any categorical variable is obtained by multiplying the proportion of the distribution for each category by the sample size (p 837).The 2GOF test stat is a point on the horizontal axis, and the area to the right under the curve is the P-value of the test (p 839).2GOF will only give you information about how close the actual population proportions are to the hypothesized proportions (not where they really are – just distance).When is it appropriate situation to use 2GOF?The test is applied when you have one categorical variable from a single population. It is used to determine whether sample data are consistent with a hypothesized distribution.What is 2 statistic?2=i=1nObserved-Expected2ExpectedHow do I find the degrees of freedom a situation has?df = (n-1)There is an analogy between our earlier definition of a sample variance s2=(x-x)2n-1 and the new definition of the 2GOF 2=(Obs-Exp)2Exp in that both are weighted averages of squared deviations from expected values and both have the same number of degrees of freedom (df = n – 1). Also, is like t in that there is a different 2 distribution for each unique number of degrees of freedom.What conditions need to be met in order to carry out a 2 test?The chi-square goodness of fit test is appropriate when the following conditions are met:The sampling method is simple random sampling.The population is at least 10 times as large as the sample.The variable under study is categorical.Book condition: Individual expected counts (not observed) are at least 1 and no more than 20% of all expected counts are less than 5.Simplified condition: The expected value (not observed) of the number of sample observations in each level of the variable is at least 5.Back to our example: What is the smallest number of times that I have to roll the die to meet the above criteria?16=5???From chapter 11 (p 705)From StatTrek:This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan (significance level, test, and conditions), (3) analyze sample data, and (4) interpret results.State the HypothesesEvery hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis. The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false; and vice versa.For a chi-square goodness of fit test, the hypotheses take the following form.H0: The data are consistent with a specified distribution. Ha: The data are not consistent with a specified distribution.Typically, the null hypothesis specifies the proportion of observations at each level of the categorical variable. The alternative hypothesis is that at least one of the specified proportions is not true.Formulate an Analysis PlanThe analysis plan describes how to use sample data to accept or reject the null hypothesis. The plan should specify the following elements.Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used.Test method. Use the chi-square goodness of fit test to determine whether observed sample frequencies differ significantly from expected frequencies specified in the null hypothesis. The chi-square goodness of fit test is described in the next section, and demonstrated in the sample problem at the end of this lesson.Analyze Sample DataUsing sample data, find the degrees of freedom, expected frequency counts, test statistic, and the P-value associated with the test statistic.Degrees of freedom. The degrees of freedom (DF) is equal to the number of levels (k) of the categorical variable minus 1: DF = k - 1 .Expected frequency counts. The expected frequency counts at each level of the categorical variable are equal to the sample size times the hypothesized proportion from the null hypothesisEi = npiwhere Ei is the expected frequency count for the ith level of the categorical variable, n is the total sample size, and pi is the hypothesized proportion of observations in level i.Test statistic. The test statistic is a chi-square random variable (Χ2) defined by the following equation. Χ2 = Σ [ (Oi - Ei)2 / Ei ] where Oi is the observed frequency count for the ith level of the categorical variable, and Ei is the expected frequency count for the ith level of the categorical variable.P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic. Since the test statistic is a chi-square, use the Chi-Square Distribution Calculator to assess the probability associated with the test statistic. Use the degrees of freedom computed above.Interpret ResultsIf the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when the P-value is less than the significance level.Chapter Objective 2: Conduct a chi-square goodness of fit test.How do I conduct this test by hand?2=i=1nObserved Count-Expected Count2Expected Count=(19-16)216+(16-16)216+(17-16)216+(17-16)216+(14-16)216+(13-16)216=3216+0216+1216+1216+-2216+-3216=.5625+0+.0625+.0625+.25+.5625=1.5-5715014871700619125391795Our book’s Table D doesn’t list critical values this small. All of the levels of significance shown represent areas in the right tail of the chi square distribution.How do I use my graphing calculator to do this?(TI89 users please refer to Tech Toolbox p 843-845.)STAT TESTS 2GOF—Test… ENTER Chi squared equals 1.5 with 5 degrees of freedom. The P value equals 0.9131By conventional criteria, this difference is considered to be not statistically significant. We would not reject H0 at the 90% level, and this appears to be a fair die.The P value answers this question: If the theory that generated the expected values were correct, what is the probability of observing such a large discrepancy (or larger) between observed and expected values? A small P value is evidence that the data are not sampled from the distribution you expected.A online visualization of this can be seen at ’s try that again, but with Mr. Griesbach’s data:Face value123456Count of observations91510141721Expected observations Where is this seen on the chi-square distribution of critical values table?-5715014871700What does this mean? This means that if you select a random sample of 6 observations (6 sides of the die), there is a 20.2% chance that the chi-square statistic from that sample will be greater than or equal to 7.25.We reject H0 at the 90% level, and assert that there is evidence that this is (or may be) an unfair (or loaded) die.What values are acceptable?! It depends. The right tail is . Industry: Health/Radiation Safety. Q: Why is the range of acceptable values for chi-square so wide (0.98-0.02)? How is the acceptable range determined when dealing with measurements involving randomness of decay?A: The probability range that is specified by the individual invoking the statistical test can be as wide or narrow as desired. Recall that the chi-square statistic, for a given number of observations (counts in the case of radioactivity measurements), is represented by a probability density function and has a shape similar to a normal distribution that is skewed to the right (that is, has a somewhat longer tail on the right than on the left). If a range from 0.02 to 0.98 is specified as acceptable, the investigator is implying that he/she will accept a value of chi-square that falls in a range that has, in each tail at both the low-value and high-value ends, no less than a 2 percent probability of occurring.Let’s practice…`(i)(ii) DISTR 2cdf(ANS, +, df) or more specifcally 2cdf(1.41,1E99,1):Let’s look closer at the curve… (p841)As the degrees of freedom increase, the curve approaches a Normal distribution. Shown above, df=1, df=4, and df=8 (p841).The properties of the chi-square distributions shown here apply to chi-square distributions in general and are not specific to the chi-square goodness of fit test.In the final analysis, we must be guided by our own intuition and judgment.The chi-square test, being of a statistical nature, serves only as an indicator, and cannot be iron clad.If a 2 statistics turns out to be significant, how do I determine which observations contribute the most to the total value?A large chi-square stat has a small P-value, and a smaller the P-value the more evidence you have against the H0. (p 840) To find which observations contribute the most to the total value, look back at the observations of my original simulation of a die:3216+0216+1216+1216+-2216+-3216=.5625+0+.0625+.0625+.25+.5625=1.5Here we see that the roll of 1 or 6 contributed the most.This test is not restricted to uniform distributions. Let’s look at a non-uniform distribution.(Save the MC exercises for later, go to the last page.)MULTIPLE-CHOICE EXERCISESUse the following to answer questions 1 through 3:Using computer software, I generate 1000 random numbers that are supposed to follow a standard normal distribution. I classify these 1000 numbers according to whether their values are less than –2 (value < –2), between –2 and 0 (–2 ? value < 0), between 0 and 2 (0 ? value < 2), or at least 2 (value ≥??). The results are given in the following table. The expected counts are computed using the 68–95–99.7 rule. Less thanBetweenBetweenAt least–2–2 and 00 and 22Observed count1849246822Expected count2547547525To test to see if the distribution of observed counts differs significantly from the distribution of expected counts, we use the χ2 statistic. 1.In this case, the χ2 statistic has approximately a chi-square (χ2) distribution. How many degrees of freedom does this distribution have? A) 3. B) 4. C) 7. D) 999. E) 1000. 2.The component (O – E)2/E of the χ2 statistic corresponding to the category “less than 2” isA) 0.28. B) 1.96. C) 2.72. D) 3.03. E) 49. 3.The value of the χ2 statistic is found to be 3.03. The P-value of the test is A)greater than 0.20. D)between 0.01 and 0.05.B)between 0.10 and 0.20. E)less than 0.01. C)between 0.05 and 0.10.4.Which of the following statements is true of chi-square distributions? A)They take on only positive values. B)Their density curves are skewed to the left. C)As the number of degrees of freedom increases, their density curves look more and more like a uniform distribution.D)As the number of degrees of freedom increases, their density curves look less and less like a normal curve.E)All of the above.Use the following to answer questions 5 through 8:A random sample of 100 traffic tickets given to motorists in a large city is examined. The tickets are classified according to the race of the driver. The results are summarized in the following table. WhiteBlackHispanicOtherNumber of tickets4637116The proportion of this city’s population in each of the racial categories listed above is as follows.WhiteBlackHispanicOtherProportion0.650.300.030.02 We wish to test whether the racial distribution of traffic tickets in the city is the same as the racial distribution of the city’s population. To do so, we use the χ2 statistic. 5.The component (O – E)2/E of the χ2 statistic corresponding to the category “Hispanic” is A) 2.67. B) 5.82. C) 21.33. D) 36.51. E) 4011.36.6.We compute the value of the χ2 statistic to be 36.52. Assuming that this statistic has approximately a χ2 distribution, the P-value of our test is A)greater than 0.20. D)between 0.01 and 0.05. B)between 0.10 and 0.20. E)less than 0.01. C)between 0.05 and 0.10.7.The category that contributes the largest component to the χ2 statistic is A) White. B) Black. C) Hispanic. D) Other. E) The answer cannot be determined since this is only a sample.8.We may assume that the χ2 statistic has an approximate χ2 distribution because of which of the following? A)The observed count for each category is greater than 5. B)The sample size is 100, which is large enough for the approximation to be valid. C)The expected count for each category is greater than 1.D)The number of categories is small relative to the number of observations.E)We may not assume that the χ2 statistic has an approximate χ2 distribution in this case.Use the following to answer questions 9 through 13:I teach a large introductory statistics course. In the past, the proportions of students that received grades of A, B, C, D, or F have been, respectively, 0.20, 0.30, 0.30, 0.10, and 0.10. This year, there were 200 students in the class, and I gave them the following grades.GradeABCDFNumber56746091I wish to test to see whether the distribution of grades this year was different from the distribution in the past. To do so, I plan to use the χ2 statistic. 9.Assuming that the χ2 statistic has approximately a χ2 distribution, how many degrees of freedom does the distribution have? A) 200. B) 199. C) 9. D) 5. E) 4. 10.The component (O – E)2/E of the χ2 statistic corresponding to a grade of C is A) 0. B) 1. C) 33.77. D) 30. E) 11,880.30.11.I compute the value of the χ2 statistic to be 33.77. The P-value of the test is A)greater than 0.20. D)between 0.01 and 0.05. B)between 0.10 and 0.20. E)less than 0.01. C)between 0.05 and 0.10.12.The grade category that contributes the largest component to the χ2 statistic is A) A. B) B. C) C. D) D. E) F. Use the following to answer questions 14 and 15:Using computer software, I generate 1000 random numbers that are supposed to follow a standard normal distribution. I classify these 1000 numbers according to whether their values are less than 0 or greater than or equal to 0. The results are given in the table below.Less Than 0Greater Than or Equal to 0Number512488Because the standard normal distribution is symmetric about 0, I would expect half of the random numbers generated to be less than 0 and half to be greater than or equal to 0. To test to see if the distribution of the observed number in each category differs significantly from the expected distribution of counts, I use the χ2 statistic. 14.The value of the χ2 statistic is A) 0.024. B) 0.048. C) 0.288. D) 0.576. E) 1.152. 15.In this case, the χ2 statistic has approximately a χ2 distribution. How many degrees of freedom does this distribution have? A) 0. B) 1. C) 2. D) 999. E) None of the above. Answers to book exercisesNAMEMs. KresovicAP StatisticsWed 9 May 201214.1 Homework: 2GOF(Variation of Activity 14A, p 834-5, avoids peanut and chocolate allergies)Consider the entire count of Skittles in the class as one large sample from the production process.SKITTLESColorYellowRedOrangeGreenPurpleTotal Observation12345678910TOTAL ObservationsExpected proportions.195.200.202.197.2061Expected countsDo these data give you reason to doubt the color distribution of Skittles advertised by Wm. Wrigley Jr. Co.? What test would you use? What evidence does it produce?For which color Skittles does your sample proportion differ the most from the proportion claimed by the company?What test will you use?What evidence does it produce?Can you use the individual sample counts to construct a confidence interval for the mean number of Skittles in the population of all(What’s the population?) __________________________________________________ produced by Wrigley? If so, do it. If not, explain why not.Multiple-choice exerciseLetter response ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- city university high school memphis
- university high school san diego
- university high school academy southfield
- university high school san diego ca
- university high school jersey city
- university high school michigan
- university high school schedule
- university high school academy mi
- university high school preparatory academy southfield
- marquette university high school athletics
- marquette university high school baseball
- marquette university high school basketball