Chi-square goodness-of-fit statistic and interpretation
The statistic measures disagreement with the supplied expectations. Degrees of freedom deduct the category-total constraint and your fitted parameter count. The expected-count screen flags small cells; no p value or significance decision is returned.
To calculate probabilities for the discrete events supported on that page, use the Probability Calculator and follow its own input conventions.
The formula
Sum squared observed-minus-expected differences divided by each positive expected count. Observed and expected totals must match. Degrees of freedom equal category count minus one minus fitted parameters.
Verified worked example
Observed counts 30 and 20 against expected counts 25 and 25 give χ² = 25/25 + 25/25 = 2. With two categories and no fitted parameters, degrees of freedom is 1.
How to use this calculator
- Enter matching observed and expected category lists; observed counts must be whole and expected counts positive.
- Enter the number of model parameters fitted from these same counts.
- Read the statistic, degrees of freedom, and expected-count screen before carrying out any separate inference.
Chi-Square Goodness of Fit input conventions
Each observed entry counts independent observations assigned to one mutually exclusive category. Expected entries describe the same categories under a specified model and must sum to the observed total. They can be fractional because they are model expectations. Enter how many model parameters were fitted from these counts so the degrees-of-freedom adjustment is explicit.
Interpreting chi-square goodness-of-fit statistic
Small expected counts can make the asymptotic chi-square approximation unsuitable. The displayed screen flags any category below five as a prompt to examine the design, rather than declaring the test valid in every other situation. This page calculates the statistic and degrees of freedom only. It does not return a p value, select a significance level, or determine whether a model should be accepted or rejected.
Assumptions & limitations
What this calculation assumes
- Observed counts are independent, categories are mutually exclusive, and expected counts represent the same total.
What to keep in mind
- Goodness-of-fit statistic only; no p value, critical threshold, or independence-table inference.
Common questions
Is this a contingency-table independence test?
No. It compares one list of category counts with specified expectations. An independence test requires rows and columns with expected counts derived from marginal totals.
Can expected counts be zero?
No. A zero expected count makes its contribution undefined; a category impossible under the model needs separate treatment if observations occur there.
Can expected counts be fractional?
Yes. They are model expectations, not observed people or events. They must be positive and total the same number as the observed counts.
Sources & further reading
Reviewed on