STATISTICS CALCULATOR

Chi-Square Goodness of Fit Calculator

Enter observed and expected counts for matching categories to calculate a Pearson chi-square goodness-of-fit statistic and its degrees of freedom.

Calculator

Whole nonnegative observed counts, one entry per category.
Positive expected counts; their total must match the observed total.
YOUR RESULTS
Chi-square goodness-of-fit statistic2
Degrees of freedom
1
Total observed count
50
Expected-count screen
All expected counts are at least 5

Page guide

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.

The formula

χ² = Σ(Oᵢ − Eᵢ)²/Eᵢ; degrees of freedom = categories − 1 − fitted parameters.

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

  1. Enter matching observed and expected category lists; observed counts must be whole and expected counts positive.
  2. Enter the number of model parameters fitted from these same counts.
  3. 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