Introduction to Chi-Squared Goodness of Fit Test
What you'll learn: When and why to use the chi-squared test to check if observed categorical data matches an expected distribution.
What Is the Chi-Squared Goodness of Fit Test?
The chi-squared goodness of fit test helps you answer this question: Does my observed categorical data match what I expected?
Unlike t-tests or z-tests for proportions that compare one or two groups, the chi-squared goodness of fit test handles situations where you have multiple categories and want to see if the frequencies you observed align with a theoretical distribution.
When to Use It
Use this test when:
- Your data consists of counts in categories (not continuous measurements)
- You have an expected distribution to compare against
- You want to test if observed frequencies differ significantly from expected ones
Common Examples
- Die fairness: You roll a die 600 times. If it's fair, you expect 100 rolls per face. Did you observe roughly 100 for each, or does the die seem biased?
- Genetics: You expect a 9:3:3:1 ratio of phenotypes. Do your breeding experiment results fit that model?
- Customer preferences: Your marketing theory predicts 40% will choose red, 35% blue, 25% green. Do actual purchases match?
How It Works (Conceptually)
The test measures how far your observed frequencies are from your expected frequencies across all categories. If the difference is too large (beyond what random chance would explain), you reject the hypothesis that your data follows the expected distribution.
Think of it like checking if a jigsaw piece fits: small gaps are okay (random variation), but if it's way off, something's wrong with your expectation.
Key Takeaway: The chi-squared goodness of fit test determines whether observed categorical frequencies match an expected distribution across multiple categories—ideal when you have more than two outcomes to compare against a theoretical model.