Statistics

Chi-Square Goodness-of-Fit Test

Students compare observed colored counters with a planned arrangement.

Chi-Square Goodness-of-Fit Test definition

A chi-square goodness-of-fit test compares observed counts in categories with counts expected under a specified distribution.

In Spanish
prueba chi-cuadrado de bondad de ajuste
Topic
Hypothesis tests and inference

Chi-Square Goodness-of-Fit Test in a picture

Chi-Square Goodness-of-Fit Test diagramFor 80 observations and a hypothesized probability of 1/4, the expected category count is 20.Sample size: 80Count all observationsNull category probability: 1/4Use the hypothesized proportionExpected count: 80 × 1/4 = 20Compare observed count with 20
For 80 observations and a hypothesized probability of 1/4, the expected category count is 20.

How it works

Multiply the sample size by each hypothesized category probability to find its expected count. Add (observed − expected)²/expected across the categories. With k categories and fully specified probabilities, the usual reference uses k − 1 degrees of freedom, assuming independent observations and sufficiently large expected counts.

Worked examples

Under an equal-share null across 5 categories, find each expected count for 50 observations.

50/5 = 10.

If one category has observed count 24 and expected count 20, find its contribution.

(24 − 20)²/20 = 16/20 = 0.8.

Find the degrees of freedom for 6 categories with fully specified probabilities.

6 − 1 = 5.

Common mistake

Use the null probabilities to calculate expected counts. Fitting parameters from the data can change the reference degrees of freedom.

Quick check

For n = 60 and null probability 1/3, what is the expected count?

What is tested with a goodness-of-fit test?

Show answer

Whether one categorical distribution matches specified probabilities.

Which tail is used for the usual chi-square goodness-of-fit p-value?

Show answer

The right tail, where discrepancies are larger.

Sources

Flashcard

Chi-Square Goodness-of-Fit Test

Reveal the definition

A chi-square goodness-of-fit test compares observed counts in categories with counts expected under a specified distribution.

Effortless Math. “Chi-Square Goodness-of-Fit Test.” Math Dictionary.