Mathematics

Chi Square Test for Goodness of Fit

The Chi Square Test for Goodness of Fit is a statistical test used to determine whether an observed frequency distribution differs from a theoretical distribution. It compares the observed frequencies of different categories with the expected frequencies to assess if there is a significant difference. This test is commonly used in various fields such as biology, business, and social sciences to analyze categorical data.

Written by Perlego with AI-assistance

7 Key excerpts on "Chi Square Test for Goodness of Fit"

  • Book cover image for: Statistical Reasoning in the Behavioral Sciences
    • Bruce M. King, Patrick J. Rosopa, Edward W. Minium(Authors)
    • 2018(Publication Date)
    • Wiley
      (Publisher)
    21 Chi-Square and Inference about Frequencies When you have finished studying this chapter, you should be able to: • Understand that the chi-square test is used to test hypotheses about the number of cases falling into the categories of a frequency distribution; • Understand that  2 provides a measure of the difference between observed frequencies and the frequencies that would be expected if the null hypothesis were true; • Explain why the chi-square test is best viewed as a test about proportions; • Compute  2 for one-variable goodness-of-fit problems; • Compute  2 to test for independence between two variables; and • Compute effect size for the chi-square test. In previous chapters, we have been concerned with numerical scores and testing hypotheses about the mean or the correlation coefficient. In this chapter, you will learn to make inferences about frequencies—the number of cases falling into the categories of a frequency distribution. For example, among four brands of soft drinks, is there a difference in the proportion of consumers who prefer the taste of each? Is there a difference among registered voters in their preference for three candidates running for local office? To answer questions like these, a researcher com- pares the observed (sample) frequencies for the several categories of the distribution with those frequencies expected according to his or her hypothesis. The difference between observed and expected frequencies is expressed in terms of a statistic named chi-square ( 2 ), introduced by Karl Pearson in 1900. 21.1 The Chi-Square Test for Goodness of Fit The chi-square (pronounced “ki”) test was developed for categorical data; that is, for data com- categorical data data comprising quali- tative categories prising qualitative categories, such as eye color, gender, or political affiliation. Although the chi-square test is conducted in terms of frequencies, it is best viewed conceptually as a test about proportions.
  • Book cover image for: Introduction to Statistics and Data Analysis
    • Roxy Peck, Chris Olsen, , Tom Short, Roxy Peck, Chris Olsen, Tom Short(Authors)
    • 2019(Publication Date)
    Communicating the Results of Statistical Analyses Three different chi-square tests were introduced in this chapter—the goodness-of-fit test, the test for homogeneity, and the test for independence. They are used in different settings and to answer different questions. When summarizing the results of a chi-square test, be sure to indicate which chi-square test was performed. One way to do this is to be clear about how the data were collected and the nature of the hypotheses being tested. It is also a good idea to include a table of observed and expected counts in addition to reporting the value of the test statistic and the P -value. And finally, make sure to give a conclusion in context, and that the conclusion is worded appropriately for the type of test Copyright 2020 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. CHAPTER 12 The Analysis of Categorical Data and Goodness-of-Fit Tests 680 conducted. For example, don’t use terms such as independence and association to describe the conclusion if the test performed was a test for homogeneity. Interpreting the Results of Statistical Analyses As with the other hypothesis tests considered, it is common to find the result of a chi-square test summarized by giving the value of the chi-square test statistic and an associated P -value. Because categorical data can be summarized compactly in frequency tables, the data are often given in the article (unlike data for numerical variables, which are rarely given).
  • Book cover image for: Introductory Statistics
    • Prem S. Mann(Author)
    • 2020(Publication Date)
    • Wiley
      (Publisher)
    The expected frequencies, denoted by E, are the frequencies that we expect to obtain if the null hypothesis is true. The expected frequency for a category is obtained as E = np where n is the sample size and p is the probability that an element belongs to that category if the null hypothesis is true. Degrees of Freedom for a Goodness-of-Fit Test In a goodness-of-fit test, the degrees of freedom are d f = k − 1 where k denotes the number of possible outcomes (or categories) for the experiment. The procedure to make a goodness-of-fit test involves the same five steps that we used in the preceding chapters. The chi-square goodness-of-fit test is always a right-tailed test. Test Statistic for a Goodness-of-Fit Test The test statistic for a goodness-of-fit test is χ 2 , and its value is calculated as χ 2 = ∑ (O − E ) 2 ________ E where O = observed frequency for a category E = expected frequency for a category = np Remember that a chi-square goodness-of-fit test is always a right-tailed test. 11.2 A Goodness-of-Fit Test 491 Whether or not the null hypothesis is rejected depends on how much the observed and expected frequencies differ from each other. To find how large the difference between the observed frequencies and the expected frequencies is, we do not look at just Σ (O − E ), because some of the O − E values will be positive and others will be negative. The net result of the sum of these differences will always be zero. Therefore, we square each of the O − E values to obtain (O − E ) 2 , and then weight them according to the reciprocals of their expected frequen- cies. The sum of the resulting numbers gives the computed value of the test statistic χ 2 . To make a goodness-of-fit test, the sample size should be large enough so that the expected frequency for each category is at least 5. If there is a category with an expected frequency of less than 5, either increase the sample size or combine two or more categories to make each expected frequency at least 5.
  • Book cover image for: Statistics for The Behavioral Sciences
    2. The test for goodness of fit compares the frequency distribution for a sample to the population distribution SUMMARY 591 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s). Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it. parametric test (561) nonparametric test 561) chi-square test for goodness of fit (562) observed frequencies (564) expected frequencies (565) chi-square statistic (566) chi-square distribution (568) test for independence (574) Cohen’s w (583) phi-coefficient (584) Cramér’s V (585) KEY TERMS that is predicted by H 0 . The test determines how well the observed frequencies (sample data) fit the expected frequencies (data predicted by H 0 ). 3. The expected frequencies for the goodness-of-fit test are determined by expected frequency = f e = pn where p is the hypothesized proportion (according to H 0 ) of observations falling into a category and n is the size of the sample. 4. The chi-square statistic is computed by chi-square = χ 2 = S s f o 2 f e d 2 f e where f o is the observed frequency for a particular category and f e is the expected frequency for that category. Large values for χ 2 indicate that there is a large discrepancy between the observed ( f o ) and the expected ( f e ) frequencies and may warrant rejection of the null hypothesis. 5. Degrees of freedom for the test for goodness of fit are df = C – 1 where C is the number of categories in the variable. Degrees of freedom measure the number of categories for which f e values can be freely chosen. As can be seen from the formula, all but the last f e value to be determined are free to vary.
  • Book cover image for: Biostatistics
    eBook - PDF

    Biostatistics

    A Foundation for Analysis in the Health Sciences

    • Wayne W. Daniel, Chad L. Cross(Authors)
    • 2018(Publication Date)
    • Wiley
      (Publisher)
    Use the Mantel–Haenszel chi-square test statistic to determine if we can conclude that there is an association between the risk factor and food insecurity. Let  = .05. 1 2 . 8 S U M M A R Y In this chapter, some uses of the versatile chi-square distribution are discussed. Chi-square goodness-of-fit tests applied to the nor- mal, binomial, and Poisson distributions are presented. We see that the procedure consists of computing a statistic X 2 = ∑ [ (O i − E i ) 2 E i ] that measures the discrepancy between the observed (O i ) and expected (E i ) frequencies of occurrence of values in certain dis- crete categories. When the appropriate null hypothesis is true, this quantity is distributed approximately as  2 . When X 2 is greater than or equal to the tabulated value of  2 for some , the null hypothesis is rejected at the  level of significance. Tests of independence and tests of homogeneity are also dis- cussed in this chapter. The tests are mathematically equivalent but conceptually different. Again, these tests essentially test the goodness-of-fit of observed data to expectation under hypotheses, respectively, of independence of two criteria of classifying the data and the homogeneity of proportions among two or more groups. In addition, we discussed and illustrated in this chapter four other techniques for analyzing frequency data that can be presented in the form of a 2 × 2 contingency table: McNemar’s test, the Fisher’s exact test, the odds ratio, relative risk, and the Mantel–Haenszel procedure. Finally, we discussed the basic con- cepts of survival analysis and illustrated the computational proce- dures by means of two examples.
  • Book cover image for: Fundamental Statistics for the Behavioral Sciences
    (A portion of that table is presented in Table 19.2.) Using the calculator at http://www.statpages.org/pdfs.html, we see the following result. Chi-Square Note: p is a one-tailed area (from Chi-Sq to infinity) ChiSq d.f. p 4.129 0.0422 1 Calc ChiSq Calc p We can also use R with the simple command >1-pchisq(4.129, 1) [1] 0.04215425 The chi-square distribution, like many other distributions we have seen, depends on the degrees of freedom. These are found running down the left side of Table 19.2. For the goodness-of-fit test the degrees of freedom are defined as k 2 1, where k is the number of categories (in our example, 2). Examples of the chi-square distribution for four different degrees of freedom are shown in Figure 19.1, along with the critical values and shaded rejection regions for a 5 .05. You can see that the critical value for a specified level of a (e.g., a 5 .05) will be larger for larger degrees of freedom. For our example we have k 2 1 5 2 2 1 5 1 df . From Table 19.2 you will see that, at a 5 .05, X 2 .05 (1) 5 3.84. Thus when H 0 is true, only 5% of the time would we obtain a value of X 2 > 3.84. Because our obtained value is 4.129, we will reject H 0 and conclude that the therapeutic touch judge does not make correct and incorrect choices equally often. (The exact probability of that chi-square is .0422.) The practitioners that Emily Rosa tested would appear not to be guessing at random. In fact, their performance was statistically worse than random.
  • Book cover image for: Endocrine Manifestations of Systemic Autoimmune Diseases
    For large samples (n > 40), some of the critical values d n,1−α determined from the asymptotic approximation to the sampling distribution of D n are offered in Table 14.5, where c = n + √ n/10 1/2 . 14.4 The Kolmogorov-Smirnov Test for Goodness of Fit 627 We note briefly that in virtually all instances the K-S test is more powerful than Pearson’s chi-square test when both are applicable in testing goodness of fit between a sample and a theoretical distribution function. In fact, for F 0 (x) a completely specified normal distribution function, the K-S test is asymptotically more powerful than the chi-square test. And when n is small, the K-S procedure, unlike the chi-square test, provides an exact test of H 0 : F (x) = F 0 (x). When is Pearson’s chi-square test superior to the K-S test for assessing goodness of fit? If F 0 (x) is discrete and completely specified, then the chi-square routine provided in Section 14.2 should be used (the sampling distribution of D n is not exact in this circumstance). Additionally, if F 0 (x) is discrete but not com- pletely specified, then the discussion pertaining to the chi-square test given in Section 14.3 applies. We now turn to some example problems involving the K-S routine for testing goodness of fit. Example 14.4.1 The run time of a commuter bus in a certain city is thought to be uniformly distributed with time to destination limits of 35 minutes to 50 minutes depending upon morning traffic flow. A random sample of n = 10 run times was taken, yielding the following realizations: 37, 42, 48, 30, 38, 39, 49, 47, 40, 41. For α = 0.05, determine if the sample is indeed from a uniform distribution. From (7.2), the null distribution function is completely determined as F 0 (x; 35, 50) = ⎧ ⎪ ⎨ ⎪ ⎩ 0, x < 35; x−35 15 , 35 ≤ x < 50; 1, x > 50. Hence we shall test H 0 : F (x) = F 0 (x; 35, 50), against H 1 : F (x) = F 0 (x; 35, 50) for at least one x.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.