Lesson 4.2: Testing Goodness of Fit in One-way Tables

""
“Heels over Heads 2” by zizzybaloobah is licensed under CC BY-NC 2.0

Lesson Learning Objectives

  • Check the conditions needed for a chi-square test of goodness of fit.
  • Carry-out a chi-square test of goodness of fit.

Lesson 4.2 Checklist

Learning activity Graded? Estimated time
Read OpenIntro Statistics section 6.3 and supplementary notes No 30 mins
Watch instructional video No 15 mins
Answer two lesson check-in questions Yes 15 mins
Work through virtual statistical software lab No 45 mins
Answer two virtual statistical software lab questions Yes 15 mins
Work on practice exercises No 1.5 hours
Explore suggested websites No 15 mins

Learning Activities

Readings 📖 and Instructional Video 🎦

Chi-Square Goodness-of-Fit Test

Read Section 6.3: Testing for Goodness of Fit Using Chi-Square in OpenIntro Statistics (Diez et al., 2019) CC BY-SA 3.0. In the last lesson, we analyzed a categorical data variable with two categories, which we summarized using the proportion in one of the categories. In this lesson, we analyze a categorical data variable with more than two categories. We can summarize the data in a one-way table of the counts or frequencies in each category. We can then perform a goodness-of-fit test to see whether the observed counts align with the counts we would expect under a null model. As you read, look-up new terminology in the Glossary and self-assess your understanding by attempting the guided practice exercises.

Note: There is a mistake in the stock market example in Figure 6.11 in Section 6.3.5. The expected frequency for a waiting time of 1 day under the geometric model should be 742 (not 743). The resulting test statistic should be 4.54 (not 4.61), and the p-value should be 0.604 (not 0.5951).

Watch the following video, 6 3 Testing for Goodness of Fit Using Chi Square (Çetinkaya-Rundel, 2018), on this topic (duration 00:14:45).

Comparing Counts: Goodness of Fit

Read Supplementary Notes 4.2, which works through a goodness-of-fit chi-square test example to determine if observed counts are representative of expected counts under a model in which each category is equally likely.

Lesson Check-in Questions ✍

Answer the two check-in questions for Lesson 4.2 in your Moodle course. The questions are based on the material covered in the readings and instructional videos. The questions are multiple-choice, fill-in-the-blank, matching, or calculation questions, and they are auto-graded in Moodle. Once you access the questions, you have 15 minutes to submit your answers. Overall the Lesson Check-in Questions count 6% toward your total grade.

Virtual Statistical Software Lab 💻

Work through the virtual statistical software lab: Software Lab 4.2. In this lab you’ll practice two chi-square goodness-of-fit tests: One is for the fair die example in Supplementary Notes 4.2, and the other is for the stock market example in Section 6.3.5 of the textbook. As you work through the lab, answer the exercises in the shaded boxes. These exercises are not graded, but the solutions are available: Software Lab 4.2 Solutions. The lab should take you no more than 45 minutes to complete.

Virtual Statistical Software Lab Questions ✍

Answer the two virtual statistical software lab questions for Software Lab 4.2 in your Moodle course. The questions are based on the lab you just completed. The questions are multiple-choice, fill-in-the-blank, matching, or calculation questions, and they are auto-graded in Moodle. Once you access the questions, you have 15 minutes to submit your answers. Overall the Software Lab Questions count 6% toward your total grade.

Practice Exercises 🖊

Work on the following exercises in OpenIntro Statistics: Exercises 6.31 and 6.33 and Chapter Exercise 6.47 (Diez et al., 2019) CC BY-SA 3.0. Check your answers using these solutions (Diez et al., 2019) CC BY-SA 3.0. You’ll deepen your understanding much more effectively if you genuinely attempt the questions by yourself before checking the solutions.

Work on the WeBWorK exercises, which are linked from your Moodle course. Check your answers using the solutions provided.

Suggested Websites 🌎

  • For another take on testing goodness of fit in one-way tables, have a look at this well-written online resource: Chi-Square Goodness of Fit Test | Formula, Guide & Examples (Turney, 2023).
  • To practice chi-square goodness-of-fit test calculations, try Chi-Square Test Calculator [Application] (Statistics Kingdom, n.d.). To use the calculator, make sure you’ve selected “goodness of fit test,” set the significance level (\alpha) to 0.05, and set the continuity correction to false.
    • For the fair die example in Supplementary Notes 4.2, insert/delete rows as needed in the “enter sample data” area to have six rows in total, and enter the observed frequencies (96, 94, 90, 89, 114, 117) and the expected values (100, 100, 100, 100, 100, 100). Click “calculate” to see the results.
    • For the jury selection example in Section 6.3 of the textbook, insert/delete rows as needed to have four rows in total, and enter the observed frequencies (205, 26, 25, 19) and the expected values (198, 19.25, 33, 24.75). Click “calculate” to see the results.
    • For the stock market example in Section 6.3.5 of the textbook, insert/delete rows as needed to have seven rows in total, and enter the observed frequencies (717, 369, 155, 69, 28, 14, 10) and the expected values (742, 338, 154, 70, 32, 14, 12). Click “calculate” to see the results.

Media Attributions

Heels Over Heads 2, by zizzybaloobah (2005), on Flickr, CC BY-NC 2.0

References

Çetinkaya-Rundel, M. (2018, Feb. 19). 6 3 testing for goodness of fit using chi square [Video]. YouTube. https://www.youtube.com/watch?v=Uk36WGxujkc

Diez, D. M., Çetinkaya-Rundel, M., Barr, C. D. (2019). OpenIntro Statistics (4th ed.). OpenIntro. https://www.openintro.org/book/os/

Statistics Kingdom. (n.d.). Chi-square test calculator [Application]. https://www.statskingdom.com/310GoodnessChi.html

Turney, S. (2023, Jun. 22). Chi-square goodness of fit test | formula, guide & examples. Scribbr. https://www.scribbr.com/statistics/chi-square-goodness-of-fit/

zizzybaloobah. (2005). Heels over heads 2 [Photograph]. Flickr. https://flic.kr/p/4WepG

 

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Introduction to Probability and Statistics Copyright © 2023 by Thompson Rivers University is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book