Chi-Square Goodness-of-Fit Test
Chi-square goodness-of-fit test comparing observed counts to an expected distribution.
About this tool
Enter observed counts and, optionally, expected counts. Leave expected blank to test against equal frequencies. The tool reports χ², df, p and Cohen's w.
How to use
How it works
The test compares observed counts with those a hypothesis predicts: Σ(O − E)² ÷ E. df is categories − 1 − estimated parameters. A low-count warning appears when expected counts are too small for the chi-square approximation to be trustworthy.
χ² = Σ (O − E)² ÷ E df = k − 1 − (parameters estimated)
Worked example
Is the die fair?
- Input
- Observed 5, 8, 9, 8, 10, 20 (n = 60)
- Output
- χ²(5) = 13.40, p = .020, w = 0.47
- Walkthrough
- Expected 10 each. (25 + 4 + 1 + 4 + 0 + 100) ÷ 10 = 13.4. The right-tail p for 13.4 on 5 df is.0199.
Limitations
- Counts, not percentages.
- Expected counts under about 5 make the p-value unreliable.
Questions
How do I test a die for fairness?
What does 18, 22, 20, 19, 21 give?
How many degrees of freedom?
Features
- Uniform or custom expected
- Cohen's w
- Low-count warning
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Student's t-distribution
Khan Academy
Why t-tables differ from z for small samples.
Watch on YouTubeHypothesis testing and p-values
StatQuest with Josh Starmer
Intuition for t/z/χ² decision rules.
Watch on YouTube
- Introductory Statistics
OpenStax
Free textbook for hypothesis tests and tables.
- Student's t-distribution
Wikipedia
Distribution reference behind the t-table tool.