Chi-Square Statistic From Observed and Expected Counts
Calculate Pearson’s goodness-of-fit statistic from counts in matching categories and the expected frequencies predicted under your model.
Formula & assumptions
χ² = Σ(Oᵢ − Eᵢ)²/Eᵢ
Observed counts are nonnegative integers and expectations are positive with matching totals. The output is the statistic for the supplied bins.
Worked example
- Observed counts
- 14,19,17
- Expected counts
- 15,20,15
- Chi-square statistic
- 0.383333333
Interpreting the result
A statistic of zero means every observed count matches its expected count exactly.