Math
Goodness of fit.
Definition
A chi-square test that determines whether observed frequency data fits an expected distribution. It compares what you observed in a sample to what you would expect if a certain hypothesis were true.
How it works · 6 phases
Step by step.
- State the null hypothesis that the data follows the expected distribution.
- Calculate expected counts for each category.
- Compute χ² = Σ(observed − expected)² / expected for each category.
- Find degrees of freedom (df = number of categories − 1).
- Compare χ² to the critical value or find the p-value.
- Reject or fail to reject the null hypothesis.
Examples
Real-world.
- 1 Testing if a die is fair by rolling it 120 times and checking if each face appears about 20 times
- 2 Checking if customer visits are evenly distributed across weekdays
- 3 Testing whether M&M color proportions match the company's claimed distribution
Key Fact
χ² = Σ(O − E)² / E, with df = number of categories − 1