How a goodness-of-fit test checks whether data match a stated distribution
Answer: A goodness-of-fit test checks whether observed counts are close enough to the counts expected from a stated distribution, often by using a chi-square statistic.
The question the test answers
These tests indicate whether it is reasonable to treat a random sample as coming from a specific distribution.
Data are often assumed to come from a particular distribution.
Observed and expected counts
Observed values are the data values. Expected values are those the null hypothesis would lead you to expect.
If the observed values and the corresponding expected values are not close to each other, the test statistic can get very large.
See also
Claims
- id: C1 claim: The test checks whether a sample comes from a stated distribution. source: S2 evidence: "a random sample comes from a specific distribution"
- id: C2 claim: Data are often assumed to come from a particular distribution. source: S2 evidence: "Data are often assumed to come from a particular distribution."
- id: C3 claim: Observed values are data, and expected values come from the theory or null model. source: S1 evidence: "O = observed values (data) E = expected values (from theory)"
Sources
- [S1] 11.2 Goodness-of-Fit Test. OpenStax Introductory Statistics. https://openstax.org/books/introductory-statistics/pages/11-2-goodness-of-fit-test . License: CC-BY-4.0. Accessed 2026-11-26.
- [S2] Do the observations come from a particular distribution?. National Institute of Standards and Technology. https://www.itl.nist.gov/div898/handbook/prc/section2/prc21.htm . License: US government work, public domain. Accessed 2026-11-26.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: OpenStax Introductory Statistics, 11.2 Goodness-of-Fit Test; National Institute of Standards and Technology, Do the observations come from a particular distribution?. CC-BY-4.0 (https://creativecommons.org/licenses/by/4.0/). OpenStax Introductory Statistics, Creative Commons Attribution License 4.0. US government work, public domain (https://www.usa.gov/government-works). Work of the U.S. government (National Institute of Standards and Technology). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: OpenStax Introductory Statistics, 11.2 Goodness-of-Fit Test; National Institute of Standards and Technology, Do the observations come from a particular distribution?. CC-BY-4.0 (https://creativecommons.org/licenses/by/4.0/). OpenStax Introductory Statistics, Creative Commons Attribution License 4.0. US government work, public domain (https://www.usa.gov/government-works). Work of the U.S. government (National Institute of Standards and Technology).
Cite this
iinventedlight. 2026. "How a goodness-of-fit test checks whether data match a stated distribution." iinventedlight Library, iil:note:rjmk90h4, version of 2026-11-26. https://iinventedlight.com/library/notes/chi-square-goodness-of-fit-test/. License: CC-BY-4.0.
@misc{iil_note_rjmk90h4,
author = {{iinventedlight}},
title = {{How a goodness-of-fit test checks whether data match a stated distribution}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/chi-square-goodness-of-fit-test/},
note = {Permanent ID iil:note:rjmk90h4. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/chi-square-goodness-of-fit-test.md.